#1065. 进制判断

进制判断

Description

image

Format

Input

image

Output

image

Samples

2 
15A6F 
1011
0 0 0 1 
1 1 1 1
4 
1234567 
12345678 
FF 
GG
0 1 1 1
0 0 1 1 
0 0 0 1 
0 0 0 0