for i in A: print(' '.join(map(str, i)))
for row in A: for val in row: print '{:4}'.format(val), print