import sys def debug(): global a for i in range(0,9): for j in range(0,9): if a[i][j][0] == 0xFFEEFFEE: print '0', elif a[i][j][0] == 0xFEFEFEFE: print '1', elif a[i][j][0] == 0xEFEFEFEF: print '2', ...