N=2<>(i%4*4+j%4))%2+(j-j%4+(3830337252>>(i%4*8+j%4*2))%4)*2][i//4==j//4]+N*(i//2)for j in R]for i in R],[[-1]]][N<5]:print(*m)