###################################################################### # most current version: # #http://sites.math.rutgers.edu/~zeilberg/tokhniot/NotAlone.txt # ## NotAlone.txt Save this file as NotAlone.txt to use it, # # stay in the # ## same directory, get into Maple (by typing: maple ) # ## and then type: read `NotAlone.txt` # ##you also need the file M88.txt available from # #http://sites.math.rutgers.edu/~zeilberg/tokhniot/M88.txt # ## Then follow the instructions given there # ## # ## Written by Doron Zeilberger, Rutgers University , # ## DoronZeil at gmail dot com # ###################################################################### print(`First Written: Aug. 14, 2024: tested for Maple 2020 `): print(`Version of Sept. 25, 2024, thanks to Christoph Koutschan`): with(combinat): with(plots): read `M88.txt`: print(): print(`This is NotAlone.txt, A Maple package`): print(`to create and solve Not Alone puzzles of the style designed by Prasanna Seshadri `): print(` that appear in the New York Times Sunday magazine (summer 2024).`): print(): print(`The most current version is available from:`): print(` http://sites.math.rutgers.edu/~zeilberg/tokhniot/NotAlone.txt .`): print(`Please report all bugs to: DoronZeil at gmail dot com .`): print(): print(`-----------------------------`): print(`For general help, and a list of the MAIN functions,`): print(` type "ezra();". For specific help type "ezra(procedure_name);" `): print(): print(`-----------------------------`): print(`For a list of the supporting procedures type ezra1()`): print(`For specific help type "ezra(procedure_name);" `): print(`For a list of the supporting functions type: ezra1();`): print(): print(`-----------------------------`): print(`-----------------------------`): ezra1:=proc() if args=NULL then print(`The SUPPORTING procedures are: Ank, FC, FC1, FillIn1, FFin, IsBad, Gnk, Gnmk, IsBad, IsBadR, IsGood, IsSubM, MakeBetter, MakeHarder, RanExt, RandPuz, RanSol, RPuzP, Shane`): print(` `): else ezra(args): fi: end: ezra:=proc() if args=NULL then print(`The main procedures are: MakeHardPuz, PlotPuz, Ptor, RPuz, SolveN`): print(` `): elif nargs=1 and args[1]=Ank then print(`Ank(n,k): all 0-1 vectors of length n with k 1's. Try:`): print(`Ank(10,4);`): elif nargs=1 and args[1]=FC then print(`FC(M,X,k1,k2): Applies FC1(M,X,k1,k2) as much as possible. Try:`): print(`FC([[1,0,X],[0,1,X]],3,3);`): elif nargs=1 and args[1]=FC1 then print(`FC1(M,X,k1,k2): Given a matrix in {0,1,X} finds whether there is place with 10X and then it returns the same with the X becoming a 0`): print(`or X01, both horizintally and vertically. (k1,k2) are the Not Alone parameters. Try:`): print(`FC1([[1,0,X],[0,1,X]],X,3,3);`): elif nargs=1 and args[1]=FFin then print(`FFin(M,X,k1,k2) : Given a partial solution of a Not Alone puzzle with still some X finds all the way`): print(`to fill-it in and still stay legal`): elif nargs=1 and args[1]=FillIn1 then print(`FillIn1(M,X,k1,k2): fills in X's where the number of 0's or 1's in a row in exactly k1 and ditto for columns with k2. Try:`): print(`FillIn1([[X,X,X,1,X,X],[X$6],[X,X,X,1,0,X],[1,0,X,X,X,X],[X$6],[X,0,X,X,X,X]],X,3,3);`): elif nargs=1 and args[1]=Gnk then print(`Gnk(n,k): all 0-1 vectors of length n with k 1's and no one alone, i.e. [0,1,0], and [1,0,1] are forbidden. Try:`): print(`Gnk(6,3);`): elif nargs=1 and args[1]=Gnmk then print(`Gnmk(n,m,k1,k2): all m by n 0-1 matrices where each row avoids [1,0,1],[0,1,0], has k1 1's and no column has [1,0,1],[0,1,0] and each column has k2 1's. Try`): print(`Gnmk(6,4,3,2);`): elif nargs=1 and args[1]=G1nmk then print(`G1nmk(n,m,k): all m by n 0-1 matrices where each row avoids [1,0,1],[0,1,0], has k 1's and no column has [1,0,1],[0,1,0] `): print(`G1nmk(6,6,3):`): elif nargs=1 and args[1]=IsBad then prinmt(`IsBad(M,k1,k2): Is the matrix M with alphabet {0,1,X} bad in the Not Alone sense and that the number of 0s <=k1 and number of 1's<=k1 in every row`): print(`and number of 0s and number of 1s<=k2 in every column. Try:`): print(`M:=Ptor([[X$6],[X,X,1,1,X,X],[X$6],[1,X,1,X,X,X],[X,1,X,X,X,X],[X$6]],X,3,3); IsBad(M,3,3);`): elif nargs=1 and args[1]=IsBadR then print(`IsBadR(M,X,k1,k2,R): Given a partial solution M does there exist an place that`): print(` changing X to either 0 or 1 will be (R-1)-bad. with R=0 it is the same IsBad(M,k1,k2)`): elif nargs=1 and args[1]=IsGood then print(`IsGood(v): Given a 0-1 vector decides whether it is good at the end`): elif nargs=1 and args[1]=IsSubM then print(`IsSubM(M1,M2,X): Given a matrix M1 in {0,1,X} and a matrix M2 of the same dimensions in {0,1} checks that the non-Z entries of M1 are the same as those of M2. Try:`): print(`IsSubM([[1,X],[X,0]],[[1,0],[0,0]]);`): elif nargs=1 and args[1]=MakeBetter then print(`MakeBetter(M,X,k1,k2,d): Given a partial solution,M, to a (k1,k2) Not Alone puzzle tries to find a better one using IsbadR with d`): print(`Try:`): print(`M:=SolveN1([[X$8],[X$8],[X,0,0,X,X,1,0,X],[X,0,1,X,X,0,1,X],[X$8],[X,X,X,1,1,X,X,X],[X$8],[X,X,X,X,X,X,1,X]],X,4,4); MakeBetter(M,X,4,4,2);`): elif nargs=1 and args[1]=MakeHarder then print(`MakeHarder(M,k1,k2,X): given a (k1,k2) puzzle in terms of X tries to make it harder`): elif nargs=1 and args[1]=MakeHardPuz then print(`MakeHardPuz(n,m,k1,k2,X,c,K,TL). Makes a hard Not Alone puzzle (where all clues are crucial to have a unique solution) on an m by n grid with time limit TL`): print(`with k1 1s in every row and k2 1s in every column. Try:`): print(`MakeHardPuz(6,6,3,3,X,8,1000,5);`): elif nargs=1 and args[1]=PlotPuz then print(`PlotPuz(P): prints the puzzle P. Try:`): print(`PlotPuz([[X,X,0,X,X,0],[X,X,1,X,X,1],[X$6],[X,X,X,1,X,X],[X$6],[X$5,0]]);`): elif nargs=1 and args[1]=Ptor then print(`Ptor(M,X,k1,k2): Given a NotAlone puzzle where X is blank 1 is filled circle and 0 is empty circle finds all solutions. USING BRUTE FORCE, with a data base, M88.txt, created by`): print(`Christoph Koutschan`): print(`This file is available from `): print(``): print(` http://sites.math.rutgers.edu/~zeilberg/tokhniot/M88.txt `): print(``): print(`and should be in the SAME directory as this file, in your computer`): print(``): print(`For example, for the Aug. 11, 2024 puzzle by`): print(`Presanna Seshardi, type:`): print(`Ptor([[X$6],[X,X,1,1,X,X],[X$6],[1,X,1,X,X,X],[X,1,X,X,X,X],[X$6]],X,3,3);`): print(`For the Aug. 18, 2024 type`): print(`Ptor([[X,X,0,X,X,0],[X,X,1,X,X,1],[X$6],[X,X,X,1,X,X],[X$6],[X$5,0]],X,3,3);`): print(`For the Aug. 25, 2024 type`): print(`Ptor([[X,X,X,1,X,X],[X$6],[X,X,X,1,0,X],[1,0,X,X,X,X],[X$6],[X,0,X,X,X,X]],X,3,3);`): print(`For the Sept. 8, 2024 puzzle type:`): print(`Ptor([[X$8],[X$8],[X,0,0,X,X,1,0,X],[X,0,1,X,X,0,1,X],[X$8],[X,X,X,1,1,X,X,X],[X$8],[X,0,X,X,X,X,1,X]],X,4,4);`): print(`For the Sept. 15, 2024 puzzle type`): print(`Ptor([[X$8],[X$5,0,0,1],[X,X,X,1,0,X,X,X],[X$8],[X,X,1,0,X$4],[X$7,0],[0$2,X$6],[X,X,X,X,X,0,X,X]],X,4,4);`): print(`For the Sept. 22 2024 puzzle type`): print(`Ptor([[X$3,0,X$4],[X$5,1,X,X],[X,0,X$6],[X,X,X,0,X,X,X,0],[X,0,X,X,1,X,X,1],[X$3,0,X$4],[X$8],[X$8]],X,4,4);`): print(`For the Sept. 29, 2024 puzzle type`): print(`Ptor([[X$3,0,X$4],[X$5,1,X,X],[X,0,X$6],[X,X,X,0,X,X,X,0],[X,0,X,X,1,X,X,1],[X$3,0,X$4],[X$8],[X$8]],X,4,4);`): print(`For the Oct. 6, 2024 puzzle type`): print(`Ptor([[X,X,0,X$5],[X,0,X,X,0,1,X,X],[X$5,0,1,X],[X,X,1,0,X,X,0,X],[X,X,X,1,0,X,X,X],[X$4,1,0,X,X],[X$8],[1,X$7]],X,4,4);`): print(`For the Oct. 13, 2024 puzzle type`): print(`Ptor([[X,X,X,X,X,X,1,X],[X,X,1,X,X,X,X,X],[X$8],[X,X,1,0,X,X,X,X],[X$8],[X$7,0],[X,X,X,X,0,X,X,X],[X,X,X,X,1,X,1,X]],X,4,4);`): elif nargs=1 and args[1]=RanExt then print(`RanExt(M,k1,k2): given a 0-1 matrix M where every row has k1 0s and k1 1s and avoids the patterns 101 and 010`): print(`and the columns also avoid these and every column has at most k2 0s and at most k2 1s`): print(`finds a random extension with one more row. Try:`): print(`RanExt([],3,3);`): elif nargs=1 and args[1]=RandPuz then print(`RandPuz(n,m,k1,k2,X,c,K): A random m by n Not Alove puzzle with row sums k1 and column sums k2 and c clues. Try:`): print(`RandPuz1(6,6,3,3,X,10,100);`): elif nargs=1 and args[1]=RanSol then print(`RanSol(k1,k2): A random good balanced 0-1 matrix. Try:`): print(`RanSol(3,3);`): elif nargs=1 and args[1]=RPuz then print(`RPuz(k1,k2,c,X,T0): A random (k1,k2) puzzle with c clues and then removing as many as possible and keeping the answer unique, and taking at most T0 seconds. Try:`): print(`RPuz(4,4,28,X,10);`): elif nargs=1 and args[1]=RPuzP then print(`RPuzP(k1,k2,c,X): A random (k1,k2) puzzle with c clues. `): print(`For (3,3) make c at least 12 or it would be very slow`): print(`For (4,4) make c at least 30 `): print(`Try:`): print(`RPuzP(4,4,30,X);`): elif nargs=1 and args[1]=Shane then print(`Shane(M,i,j,c): Given a matrix M a constant c, and i,j indicatiing a location [i,j], returns the new matrix that is the same except that the [i,j] entry is now:`): print(`Shane([[X,1,X],[X,X,1]],1,3,1);`): elif nargs=1 and args[1]=SolveN then print(`SolveN(M,X,k1,k2): Given a NotAlone puzzle where X is blank 1 is filled circle and 0 is empty circle finds all solutions. USING LOGIC. `): print(`WARNING: for some puzzles it is MUCH slower than Ptor(M,X,k1,k2) for k1=k2=4`): print(``): print(`For example, for the Aug. 11, 2024 puzzle by`): print(`Presanna Seshardi, type:`): print(`SolveN([[X$6],[X,X,1,1,X,X],[X$6],[1,X,1,X,X,X],[X,1,X,X,X,X],[X$6]],X,3,3);`): print(`For the Aug. 18, 2024 puzzle type`): print(`SolveN([[X,X,0,X,X,0],[X,X,1,X,X,1],[X$6],[X,X,X,1,X,X],[X$6],[X$5,0]],X,3,3);`): print(`For the Aug. 25 2024 puzzle type`): print(`SolveN([[X,X,X,1,X,X],[X$6],[X,X,X,1,0,X],[1,0,X,X,X,X],[X$6],[X,0,X,X,X,X]],X,3,3);`): print(`For the Sept. 8, 2024 puzzle type:`): print(`SolveN([[X$8],[X$8],[X,0,0,X,X,1,0,X],[X,0,1,X,X,0,1,X],[X$8],[X,X,X,1,1,X,X,X],[X$8],[X,0,X,X,X,X,1,X]],X,4,4);`): print(`For the Sept. 15, 2024 puzzle type`): print(`SolveN([[X$8],[X$5,0,0,1],[X,X,X,1,0,X,X,X],[X$8],[X,X,1,0,X$4],[X$7,0],[0$2,X$6],[X,X,X,X,X,0,X,X]],X,4,4);`): print(`For the Sept. 22 2024 puzzle type`): print(`SolveN([[X$3,0,X$4],[X$5,1,X,X],[X,0,X$6],[X,X,X,0,X,X,X,0],[X,0,X,X,1,X,X,1],[X$3,0,X$4],[X$8],[X$8]],X,4,4);`): print(`For the Sept. 29, 2024 puzzle type`): print(`SolveN([[X$3,0,X$4],[X$5,1,X,X],[X,0,X$6],[X,X,X,0,X,X,X,0],[X,0,X,X,1,X,X,1],[X$3,0,X$4],[X$8],[X$8]],X,4,4);`): print(`For the Oct. 6, 2024 puzzle type`): print(`SolveN([[X,X,0,X$5],[X,0,X,X,0,1,X,X],[X$5,0,1,X],[X,X,1,0,X,X,0,X],[X,X,X,1,0,X,X,X],[X$4,1,0,X,X],[X$8],[1,X$7]],X,4,4);`): print(`For the Oct. 13, 2024 puzzle type`): print(`SolveN([[X,X,X,X,X,X,1,X],[X,X,1,X,X,X,X,X],[X$8],[X,X,1,0,X,X,X,X],[X$8],[X$7,0],[X,X,X,X,0,X,X,X],[X,X,X,X,1,X,1,X]],X,4,4);`): else print(`There is no such thing as`, args): fi: end: with(combinat): #Ank(n,k): all 0-1 vectors of length n with k 1's Ank:=proc(n,k) local gu1,gu2,gu11: option remember: if n=0 then if k=0 then RETURN({[]}): else RETURN({}): fi: fi: gu1:=Ank(n-1,k-1): gu2:=Ank(n-1,k): {seq([op(gu11),1],gu11 in gu1), seq([op(gu11),0],gu11 in gu2)}: end: #Gnk(n,k): all 0-1 vectors of length n with k 1's and no one alone, i.e. [0,1,0], and [1,0,1] are forbidden. Try: #Gnk(6,3); Gnk:=proc(n,k) local mu,gu,mu1,i1: option remember: mu:=Ank(n,k): gu:={}: for mu1 in mu do if {seq([op(i1..i1+2,mu1)],i1=1..nops(mu1)-2)} intersect {[0,1,0],[1,0,1]}={} then gu:=gu union {mu1}: fi: od: gu: end: #IsGood(v): Given a 0-1 vector decides whether it is good at the end IsGood:=proc(v) if nops(v)<=2 then RETURN(true): fi: not evalb( member([op(nops(v)-2..nops(v),v)], {[1,0,1],[0,1,0]})): end: #G1nmk(n,m,k): all m by n 0-1 matrices where each row avoids [1,0,1],[0,1,0], has k 1's and no column has [1,0,1],[0,1,0] #G1nmk(6,6,3): G1nmk:=proc(n,m,k) local gu,lu,mu,lu1,mu1,hal,i1,j1: option remember: lu:=Gnk(n,k): if m=1 then RETURN({seq([lu1],lu1 in lu)}): fi: mu:=G1nmk(n,m-1,k): gu:={}: for lu1 in lu do for mu1 in mu do hal:=[op(mu1),lu1]: if {seq(IsGood([seq(hal[i1][j1],i1=1..m)]),j1=1..n)}={true} then gu:=gu union {hal}: fi: od: od: gu: end: #Gnmk(n,m,k1,k2): all m by n 0-1 matrices where each row avoids [1,0,1],[0,1,0], has k1 1's and no column has [1,0,1],[0,1,0] and each column has k2 1's. Try #Gnmk(6,4,3,2); Gnmk:=proc(n,m,k1,k2) local lu,lu1,gu,i1,j1: option rememeber: if m=6 and n=6 and k1=3 and k2=3 then RETURN( {[[0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [1, 1, 1, 0, 0, 0 ], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0]], [[0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1 , 1], [0, 0, 1, 1, 1, 0], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [1, 1, 0, 0, 0, 1]], [[0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [0, 1, 1, 0, 0, 1], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [1, 0, 0, 1, 1, 0]], [[0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [0, 1, 1, 1, 0, 0], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [1, 0, 0, 0, 1, 1]], [[0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [1, 0, 0, 0, 1, 1], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [0, 1, 1, 1, 0, 0]], [[0, 0, 0, 1, 1, 1], [ 0, 0, 0, 1, 1, 1], [1, 0, 0, 1, 1, 0], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [0, 1, 1, 0, 0, 1]], [[0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [1, 1, 0, 0, 0, 1 ], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [0, 0, 1, 1, 1, 0]], [[0, 0, 0, 1, 1 , 1], [0, 0, 0, 1, 1, 1], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [0, 0, 0, 1, 1, 1]], [[0, 0, 0, 1, 1, 1], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [1, 1, 1, 0, 0, 0]], [[0, 0, 0, 1, 1, 1], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [1, 1, 1, 0, 0, 0], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1]], [[0, 0, 0, 1, 1, 1], [0, 0, 1, 1, 1, 0], [0, 1, 1, 1, 0, 0], [1, 1, 1, 0, 0, 0], [1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 1, 1]], [[ 0, 0, 0, 1, 1, 1], [0, 0, 1, 1, 1, 0], [1, 1, 1, 0, 0, 0], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [0, 0, 1, 1, 1, 0]], [[0, 0, 0, 1, 1, 1], [0, 0, 1, 1, 1, 0 ], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [1, 1, 0, 0, 0, 1], [0, 0, 0, 1, 1, 1]], [[0, 0, 0, 1, 1, 1], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [1, 1, 1, 0, 0, 0]], [[0, 0, 0, 1, 1, 1], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 1, 1, 0, 0, 0], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0]], [[0, 0, 0, 1, 1, 1], [0, 1, 1, 0, 0, 1], [1, 1, 1, 0, 0, 0], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [0, 1, 1, 0, 0, 1]], [[0, 0, 0, 1, 1, 1], [0, 1, 1, 0, 0, 1], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [1, 0, 0, 1, 1, 0], [0, 0, 0, 1, 1, 1]], [[0, 0, 0, 1, 1, 1], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [ 1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [1, 1, 1, 0, 0, 0]], [[0, 0, 0, 1, 1, 1] , [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [1, 1, 1, 0, 0, 0], [1, 0, 0, 0, 1, 1 ], [1, 0, 0, 0, 1, 1]], [[0, 0, 0, 1, 1, 1], [0, 1, 1, 1, 0, 0], [1, 1, 1, 0, 0 , 0], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [0, 1, 1, 1, 0, 0]], [[0, 0, 0, 1 , 1, 1], [0, 1, 1, 1, 0, 0], [1, 1, 1, 0, 0, 0], [1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 1, 1], [0, 0, 1, 1, 1, 0]], [[0, 0, 0, 1, 1, 1], [0, 1, 1, 1, 0, 0], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [1, 0, 0, 0, 1, 1], [0, 0, 0, 1, 1, 1]], [[0, 0, 0, 1, 1, 1], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [1, 1, 1, 0, 0, 0]], [[0, 0, 0, 1, 1, 1], [1, 0, 0, 0, 1, 1], [ 1, 0, 0, 0, 1, 1], [1, 1, 1, 0, 0, 0], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0]], [[0, 0, 0, 1, 1, 1], [1, 0, 0, 0, 1, 1], [1, 1, 0, 0, 0, 1], [1, 1, 1, 0, 0, 0] , [0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0]], [[0, 0, 0, 1, 1, 1], [1, 0, 0, 0, 1, 1], [1, 1, 1, 0, 0, 0], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [1, 0, 0, 0, 1, 1]], [[0, 0, 0, 1, 1, 1], [1, 0, 0, 0, 1, 1], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [0, 1, 1, 1, 0, 0], [0, 0, 0, 1, 1, 1]], [[0, 0, 0, 1, 1, 1], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 1, 1, 0, 0, 0]], [[0, 0, 0, 1, 1, 1], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [1, 1, 1, 0, 0, 0], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1]], [[0, 0, 0, 1, 1, 1], [1, 0, 0, 1, 1, 0], [1, 1, 1, 0, 0, 0], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 0, 0, 1, 1, 0]], [[0, 0, 0, 1, 1, 1], [1, 0, 0, 1, 1, 0], [1, 1, 1, 0, 0, 0], [ 1, 1, 1, 0, 0, 0], [0, 1, 1, 0, 0, 1], [0, 0, 0, 1, 1, 1]], [[0, 0, 0, 1, 1, 1] , [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0 ], [1, 1, 1, 0, 0, 0]], [[0, 0, 0, 1, 1, 1], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0 , 1], [1, 1, 1, 0, 0, 0], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0]], [[0, 0, 0, 1 , 1, 1], [1, 1, 0, 0, 0, 1], [1, 1, 1, 0, 0, 0], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [1, 1, 0, 0, 0, 1]], [[0, 0, 0, 1, 1, 1], [1, 1, 0, 0, 0, 1], [1, 1, 1, 0, 0, 0], [0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0], [1, 0, 0, 0, 1, 1]], [[0, 0, 0, 1, 1, 1], [1, 1, 0, 0, 0, 1], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 1]], [[0, 0, 0, 1, 1, 1], [1, 1, 1, 0, 0, 0], [ 1, 1, 1, 0, 0, 0], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [1, 1, 1, 0, 0, 0]], [[0, 0, 0, 1, 1, 1], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [0, 0, 1, 1, 1, 0] , [0, 0, 0, 1, 1, 1], [1, 1, 0, 0, 0, 1]], [[0, 0, 0, 1, 1, 1], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [0, 1, 1, 0, 0, 1], [0, 0, 0, 1, 1, 1], [1, 0, 0, 1, 1, 0]], [[0, 0, 0, 1, 1, 1], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [0, 1, 1, 1, 0, 0], [0, 0, 0, 1, 1, 1], [1, 0, 0, 0, 1, 1]], [[0, 0, 0, 1, 1, 1], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [1, 0, 0, 0, 1, 1], [0, 0, 0, 1, 1, 1], [0, 1, 1, 1, 0, 0]], [[0, 0, 0, 1, 1, 1], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [1, 0, 0, 1, 1, 0], [0, 0, 0, 1, 1, 1], [0, 1, 1, 0, 0, 1]], [[0, 0, 0, 1, 1, 1], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [1, 1, 0, 0, 0, 1], [0, 0, 0, 1, 1, 1], [0, 0, 1, 1, 1, 0]], [[0, 0, 0, 1, 1, 1], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [ 1, 1, 1, 0, 0, 0], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1]], [[0, 0, 1, 1, 1, 0] , [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [1, 1, 0, 0, 0, 1], [1, 1, 1, 0, 0, 0 ], [1, 1, 1, 0, 0, 0]], [[0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1 , 1], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [1, 1, 0, 0, 0, 1]], [[0, 0, 1, 1 , 1, 0], [0, 0, 0, 1, 1, 1], [1, 0, 0, 0, 1, 1], [1, 1, 0, 0, 0, 1], [1, 1, 1, 0, 0, 0], [0, 1, 1, 1, 0, 0]], [[0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 1], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [1, 1, 1, 0, 0, 0], [0, 0, 1, 1, 1, 0]], [[0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 1], [1, 1, 0, 0, 0, 1], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [0, 0, 0, 1, 1, 1]], [[0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [ 0, 0, 0, 1, 1, 1], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [1, 1, 1, 0, 0, 0]], [[0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [1, 1, 0, 0, 0, 1] , [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1]], [[0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [0, 1, 1, 0, 0, 1], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [1, 0, 0, 1, 1, 0]], [[0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [0, 1, 1, 1, 0, 0], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 1, 1]], [[0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [1, 0, 0, 0, 1, 1], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [0, 1, 1, 1, 0, 0]], [[0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [1, 0, 0, 1, 1, 0], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [0, 1, 1, 0, 0, 1]], [[0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [0, 0, 1, 1, 1, 0]], [[0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [1, 1, 1, 0, 0, 0], [ 1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [0, 0, 0, 1, 1, 1]], [[0, 0, 1, 1, 1, 0] , [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0 ], [1, 1, 0, 0, 0, 1]], [[0, 0, 1, 1, 1, 0], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0 , 1], [1, 1, 0, 0, 0, 1], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0]], [[0, 0, 1, 1 , 1, 0], [0, 1, 1, 0, 0, 1], [1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 1, 1], [1, 0, 0, 1, 1, 0], [0, 1, 1, 1, 0, 0]], [[0, 0, 1, 1, 1, 0], [0, 1, 1, 0, 0, 1], [1, 1, 0, 0, 0, 1], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [0, 1, 1, 0, 0, 1]], [[0, 0, 1, 1, 1, 0], [0, 1, 1, 0, 0, 1], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [1, 0, 0, 1, 1, 0], [0, 0, 1, 1, 1, 0]], [[0, 0, 1, 1, 1, 0], [0, 1, 1, 1, 0, 0], [ 0, 1, 1, 0, 0, 1], [1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 1, 1], [1, 0, 0, 1, 1, 0]], [[0, 0, 1, 1, 1, 0], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [1, 0, 0, 0, 1, 1] , [1, 0, 0, 0, 1, 1], [1, 1, 0, 0, 0, 1]], [[0, 0, 1, 1, 1, 0], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1]], [[0, 0, 1, 1, 1, 0], [0, 1, 1, 1, 0, 0], [1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [0, 1, 1, 1, 0, 0]], [[0, 0, 1, 1, 1, 0], [0, 1, 1, 1, 0, 0], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 1, 1], [0, 0, 1, 1, 1, 0]], [[0, 0, 1, 1, 1, 0], [0, 1, 1, 1, 0, 0], [1, 1, 1, 0, 0, 0], [1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 1, 1], [0, 0, 0, 1, 1, 1]], [[0, 0, 1, 1, 1, 0], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [1, 1, 0, 0, 0, 1]], [[0, 0, 1, 1, 1, 0], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [ 1, 1, 0, 0, 0, 1], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0]], [[0, 0, 1, 1, 1, 0] , [1, 0, 0, 0, 1, 1], [1, 1, 0, 0, 0, 1], [0, 1, 1, 0, 0, 1], [0, 1, 1, 1, 0, 0 ], [1, 0, 0, 1, 1, 0]], [[0, 0, 1, 1, 1, 0], [1, 0, 0, 0, 1, 1], [1, 1, 0, 0, 0 , 1], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [1, 0, 0, 0, 1, 1]], [[0, 0, 1, 1 , 1, 0], [1, 0, 0, 0, 1, 1], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0]], [[0, 0, 1, 1, 1, 0], [1, 0, 0, 0, 1, 1], [1, 1, 0, 0, 0, 1], [1, 1, 1, 0, 0, 0], [0, 1, 1, 1, 0, 0], [0, 0, 0, 1, 1, 1]], [[0, 0, 1, 1, 1, 0], [1, 0, 0, 1, 1, 0], [1, 0, 0, 0, 1, 1], [1, 1, 0, 0, 0, 1], [0, 1, 1, 0, 0, 1], [0, 1, 1, 1, 0, 0]], [[0, 0, 1, 1, 1, 0], [1, 0, 0, 1, 1, 0], [ 1, 0, 0, 1, 1, 0], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 1, 0, 0, 0, 1]], [[0, 0, 1, 1, 1, 0], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [1, 1, 0, 0, 0, 1] , [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1]], [[0, 0, 1, 1, 1, 0], [1, 0, 0, 1, 1, 0], [1, 1, 0, 0, 0, 1], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 0, 0, 1, 1, 0]], [[0, 0, 1, 1, 1, 0], [1, 0, 0, 1, 1, 0], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [0, 1, 1, 0, 0, 1], [0, 0, 1, 1, 1, 0]], [[0, 0, 1, 1, 1, 0], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [0, 0, 0, 1, 1, 1], [0, 0, 1, 1, 1, 0], [1, 1, 1, 0, 0, 0]], [[0, 0, 1, 1, 1, 0], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [1, 1, 0, 0, 0, 1]], [[0, 0, 1, 1, 1, 0], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [0, 1, 1, 0, 0, 1], [0, 0, 1, 1, 1, 0], [1, 0, 0, 1, 1, 0]], [[0, 0, 1, 1, 1, 0], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [ 0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0], [1, 0, 0, 0, 1, 1]], [[0, 0, 1, 1, 1, 0] , [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 1, 1], [0, 0, 1, 1, 1, 0 ], [0, 1, 1, 1, 0, 0]], [[0, 0, 1, 1, 1, 0], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0 , 1], [1, 0, 0, 1, 1, 0], [0, 0, 1, 1, 1, 0], [0, 1, 1, 0, 0, 1]], [[0, 0, 1, 1 , 1, 0], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0]], [[0, 0, 1, 1, 1, 0], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [1, 1, 1, 0, 0, 0], [0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 1]], [[0, 0, 1, 1, 1, 0], [1, 1, 1, 0, 0, 0], [1, 1, 0, 0, 0, 1], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [1, 1, 1, 0, 0, 0]], [[0, 0, 1, 1, 1, 0], [1, 1, 1, 0, 0, 0], [ 1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 1, 1], [0, 0, 0, 1, 1, 1], [0, 1, 1, 1, 0, 0]], [[0, 0, 1, 1, 1, 0], [1, 1, 1, 0, 0, 0], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1] , [0, 0, 0, 1, 1, 1], [0, 0, 1, 1, 1, 0]], [[0, 0, 1, 1, 1, 0], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [1, 1, 0, 0, 0, 1]], [[0, 0, 1, 1, 1, 0], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [1, 1, 0, 0, 0, 1], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1]], [[0, 1, 1, 0, 0, 1], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [1, 0, 0, 1, 1, 0], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0]], [[0, 1, 1, 0, 0, 1], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [1, 0, 0, 1, 1, 0]], [[0, 1, 1, 0, 0, 1], [0, 0, 0, 1, 1, 1], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [1, 1, 1, 0, 0, 0], [0, 1, 1, 0, 0, 1]], [[0, 1, 1, 0, 0, 1], [0, 0, 0, 1, 1, 1], [1, 0, 0, 1, 1, 0], [ 1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [0, 0, 0, 1, 1, 1]], [[0, 1, 1, 0, 0, 1] , [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [1, 0, 0, 1, 1, 0], [1, 1, 0, 0, 0, 1 ], [1, 1, 0, 0, 0, 1]], [[0, 1, 1, 0, 0, 1], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1 , 0], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [1, 0, 0, 1, 1, 0]], [[0, 1, 1, 0 , 0, 1], [0, 0, 1, 1, 1, 0], [1, 0, 0, 1, 1, 0], [1, 0, 0, 0, 1, 1], [1, 1, 0, 0, 0, 1], [0, 1, 1, 1, 0, 0]], [[0, 1, 1, 0, 0, 1], [0, 0, 1, 1, 1, 0], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [1, 1, 0, 0, 0, 1], [0, 1, 1, 0, 0, 1]], [[0, 1, 1, 0, 0, 1], [0, 0, 1, 1, 1, 0], [1, 0, 0, 1, 1, 0], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [0, 0, 1, 1, 1, 0]], [[0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [ 0, 0, 0, 1, 1, 1], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [1, 1, 1, 0, 0, 0]], [[0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [0, 0, 1, 1, 1, 0], [1, 0, 0, 1, 1, 0] , [1, 0, 0, 1, 1, 0], [1, 1, 0, 0, 0, 1]], [[0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0]], [[0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [0, 1, 1, 1, 0, 0], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [1, 0, 0, 0, 1, 1]], [[0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 0, 0, 0, 1, 1], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [0, 1, 1, 1, 0, 0]], [[0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [0, 1, 1, 0, 0, 1]], [[0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 1, 0, 0, 0, 1], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [0, 0, 1, 1, 1, 0]], [[0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 1, 1, 0, 0, 0], [ 1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [0, 0, 0, 1, 1, 1]], [[0, 1, 1, 0, 0, 1] , [0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0], [1, 0, 0, 1, 1, 0], [1, 0, 0, 0, 1, 1 ], [1, 1, 0, 0, 0, 1]], [[0, 1, 1, 0, 0, 1], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0 , 0], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [1, 0, 0, 1, 1, 0]], [[0, 1, 1, 0 , 0, 1], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [1, 0, 0, 1, 1, 0], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1]], [[0, 1, 1, 0, 0, 1], [0, 1, 1, 1, 0, 0], [1, 0, 0, 1, 1, 0], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [0, 1, 1, 1, 0, 0]], [[0, 1, 1, 0, 0, 1], [0, 1, 1, 1, 0, 0], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [1, 0, 0, 0, 1, 1], [0, 1, 1, 0, 0, 1]], [[0, 1, 1, 0, 0, 1], [1, 0, 0, 0, 1, 1], [ 1, 0, 0, 0, 1, 1], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [1, 0, 0, 1, 1, 0]], [[0, 1, 1, 0, 0, 1], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [1, 0, 0, 1, 1, 0] , [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0]], [[0, 1, 1, 0, 0, 1], [1, 0, 0, 0, 1, 1], [1, 0, 0, 1, 1, 0], [0, 0, 1, 1, 1, 0], [0, 1, 1, 1, 0, 0], [1, 1, 0, 0, 0, 1]], [[0, 1, 1, 0, 0, 1], [1, 0, 0, 0, 1, 1], [1, 0, 0, 1, 1, 0], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [1, 0, 0, 0, 1, 1]], [[0, 1, 1, 0, 0, 1], [1, 0, 0, 0, 1, 1], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [0, 1, 1, 1, 0, 0], [0, 1, 1, 0, 0, 1]], [[0, 1, 1, 0, 0, 1], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [0, 0, 0, 1, 1, 1], [0, 1, 1, 0, 0, 1], [1, 1, 1, 0, 0, 0]], [[0, 1, 1, 0, 0, 1], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [0, 0, 1, 1, 1, 0], [0, 1, 1, 0, 0, 1], [1, 1, 0, 0, 0, 1]], [[0, 1, 1, 0, 0, 1], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [ 0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 0, 0, 1, 1, 0]], [[0, 1, 1, 0, 0, 1] , [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [0, 1, 1, 1, 0, 0], [0, 1, 1, 0, 0, 1 ], [1, 0, 0, 0, 1, 1]], [[0, 1, 1, 0, 0, 1], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1 , 0], [1, 0, 0, 0, 1, 1], [0, 1, 1, 0, 0, 1], [0, 1, 1, 1, 0, 0]], [[0, 1, 1, 0 , 0, 1], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1]], [[0, 1, 1, 0, 0, 1], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [1, 1, 0, 0, 0, 1], [0, 1, 1, 0, 0, 1], [0, 0, 1, 1, 1, 0]], [[0, 1, 1, 0, 0, 1], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [1, 1, 1, 0, 0, 0], [0, 1, 1, 0, 0, 1], [0, 0, 0, 1, 1, 1]], [[0, 1, 1, 0, 0, 1], [1, 1, 0, 0, 0, 1], [ 1, 0, 0, 0, 1, 1], [1, 0, 0, 1, 1, 0], [0, 0, 1, 1, 1, 0], [0, 1, 1, 1, 0, 0]], [[0, 1, 1, 0, 0, 1], [1, 1, 0, 0, 0, 1], [1, 0, 0, 1, 1, 0], [0, 0, 1, 1, 1, 0] , [0, 0, 1, 1, 1, 0], [1, 1, 0, 0, 0, 1]], [[0, 1, 1, 0, 0, 1], [1, 1, 0, 0, 0, 1], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [0, 0, 1, 1, 1, 0], [0, 1, 1, 0, 0, 1]], [[0, 1, 1, 0, 0, 1], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [1, 0, 0, 1, 1, 0]], [[0, 1, 1, 0, 0, 1], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [1, 0, 0, 1, 1, 0], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0]], [[0, 1, 1, 0, 0, 1], [1, 1, 1, 0, 0, 0], [1, 0, 0, 1, 1, 0], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [1, 1, 1, 0, 0, 0]], [[0, 1, 1, 0, 0, 1], [1, 1, 1, 0, 0, 0], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [0, 0, 0, 1, 1, 1], [0, 1, 1, 0, 0, 1]], [[0, 1, 1, 0, 0, 1], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [ 0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [1, 0, 0, 1, 1, 0]], [[0, 1, 1, 0, 0, 1] , [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [1, 0, 0, 1, 1, 0], [0, 0, 0, 1, 1, 1 ], [0, 0, 0, 1, 1, 1]], [[0, 1, 1, 1, 0, 0], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1 , 1], [1, 0, 0, 0, 1, 1], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0]], [[0, 1, 1, 1 , 0, 0], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [1, 0, 0, 0, 1, 1]], [[0, 1, 1, 1, 0, 0], [0, 0, 0, 1, 1, 1], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [1, 1, 1, 0, 0, 0], [0, 1, 1, 1, 0, 0]], [[0, 1, 1, 1, 0, 0], [0, 0, 0, 1, 1, 1], [1, 0, 0, 0, 1, 1], [1, 1, 0, 0, 0, 1], [1, 1, 1, 0, 0, 0], [0, 0, 1, 1, 1, 0]], [[0, 1, 1, 1, 0, 0], [0, 0, 0, 1, 1, 1], [ 1, 0, 0, 0, 1, 1], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [0, 0, 0, 1, 1, 1]], [[0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 1], [1, 0, 0, 0, 1, 1] , [1, 1, 0, 0, 0, 1], [1, 1, 1, 0, 0, 0]], [[0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [1, 0, 0, 0, 1, 1], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1]], [[0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 1, 1]], [[0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [1, 1, 0, 0, 0, 1], [0, 1, 1, 1, 0, 0]], [[0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0], [1, 0, 0, 0, 1, 1], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [0, 0, 1, 1, 1, 0]], [[0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0], [1, 0, 0, 1, 1, 0], [1, 0, 0, 0, 1, 1], [1, 1, 0, 0, 0, 1], [0, 1, 1, 0, 0, 1]], [[0, 1, 1, 1, 0, 0], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [ 1, 0, 0, 0, 1, 1], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0]], [[0, 1, 1, 1, 0, 0] , [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0 ], [1, 0, 0, 0, 1, 1]], [[0, 1, 1, 1, 0, 0], [0, 1, 1, 0, 0, 1], [1, 0, 0, 0, 1 , 1], [1, 0, 0, 0, 1, 1], [1, 0, 0, 1, 1, 0], [0, 1, 1, 1, 0, 0]], [[0, 1, 1, 1 , 0, 0], [0, 1, 1, 0, 0, 1], [1, 0, 0, 0, 1, 1], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [0, 1, 1, 0, 0, 1]], [[0, 1, 1, 1, 0, 0], [0, 1, 1, 0, 0, 1], [1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 1, 1], [1, 0, 0, 1, 1, 0], [0, 0, 1, 1, 1, 0]], [[0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [0, 0, 0, 1, 1, 1], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [1, 1, 1, 0, 0, 0]], [[0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [ 0, 0, 1, 1, 1, 0], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [1, 1, 0, 0, 0, 1]], [[0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [0, 1, 1, 0, 0, 1], [1, 0, 0, 0, 1, 1] , [1, 0, 0, 0, 1, 1], [1, 0, 0, 1, 1, 0]], [[0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1]], [[0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [0, 1, 1, 1, 0, 0]], [[0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [1, 0, 0, 1, 1, 0], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [0, 1, 1, 0, 0, 1]], [[0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [0, 0, 1, 1, 1, 0]], [[0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [1, 1, 1, 0, 0, 0], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [0, 0, 0, 1, 1, 1]], [[0, 1, 1, 1, 0, 0], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [ 0, 0, 0, 1, 1, 1], [0, 1, 1, 1, 0, 0], [1, 1, 1, 0, 0, 0]], [[0, 1, 1, 1, 0, 0] , [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [0, 0, 1, 1, 1, 0], [0, 1, 1, 1, 0, 0 ], [1, 1, 0, 0, 0, 1]], [[0, 1, 1, 1, 0, 0], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1 , 1], [0, 1, 1, 0, 0, 1], [0, 1, 1, 1, 0, 0], [1, 0, 0, 1, 1, 0]], [[0, 1, 1, 1 , 0, 0], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [1, 0, 0, 0, 1, 1]], [[0, 1, 1, 1, 0, 0], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0]], [[0, 1, 1, 1, 0, 0], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [1, 0, 0, 1, 1, 0], [0, 1, 1, 1, 0, 0], [0, 1, 1, 0, 0, 1]], [[0, 1, 1, 1, 0, 0], [1, 0, 0, 0, 1, 1], [ 1, 0, 0, 0, 1, 1], [1, 1, 0, 0, 0, 1], [0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0]], [[0, 1, 1, 1, 0, 0], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [1, 1, 1, 0, 0, 0] , [0, 1, 1, 1, 0, 0], [0, 0, 0, 1, 1, 1]], [[0, 1, 1, 1, 0, 0], [1, 0, 0, 1, 1, 0], [1, 0, 0, 0, 1, 1], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 0, 0, 1, 1, 0]], [[0, 1, 1, 1, 0, 0], [1, 0, 0, 1, 1, 0], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [0, 1, 1, 0, 0, 1], [0, 1, 1, 1, 0, 0]], [[0, 1, 1, 1, 0, 0], [1, 0, 0, 1, 1, 0], [1, 0, 0, 0, 1, 1], [1, 1, 0, 0, 0, 1], [0, 1, 1, 0, 0, 1], [0, 0, 1, 1, 1, 0]], [[0, 1, 1, 1, 0, 0], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 0, 0, 0, 1, 1]], [[0, 1, 1, 1, 0, 0], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [1, 0, 0, 0, 1, 1], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1]], [[0, 1, 1, 1, 0, 0], [1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 1, 1], [ 0, 0, 0, 1, 1, 1], [0, 0, 1, 1, 1, 0], [1, 1, 1, 0, 0, 0]], [[0, 1, 1, 1, 0, 0] , [1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 1, 1], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0 ], [1, 1, 0, 0, 0, 1]], [[0, 1, 1, 1, 0, 0], [1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 1 , 1], [1, 0, 0, 0, 1, 1], [0, 0, 1, 1, 1, 0], [0, 1, 1, 1, 0, 0]], [[0, 1, 1, 1 , 0, 0], [1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 1, 1], [1, 0, 0, 1, 1, 0], [0, 0, 1, 1, 1, 0], [0, 1, 1, 0, 0, 1]], [[0, 1, 1, 1, 0, 0], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [1, 0, 0, 0, 1, 1]], [[0, 1, 1, 1, 0, 0], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 1, 1], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0]], [[0, 1, 1, 1, 0, 0], [1, 1, 1, 0, 0, 0], [ 1, 0, 0, 0, 1, 1], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [1, 1, 1, 0, 0, 0]], [[0, 1, 1, 1, 0, 0], [1, 1, 1, 0, 0, 0], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1] , [0, 0, 0, 1, 1, 1], [0, 1, 1, 1, 0, 0]], [[0, 1, 1, 1, 0, 0], [1, 1, 1, 0, 0, 0], [1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 1, 1], [0, 0, 0, 1, 1, 1], [0, 0, 1, 1, 1, 0]], [[0, 1, 1, 1, 0, 0], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [1, 0, 0, 0, 1, 1]], [[0, 1, 1, 1, 0, 0], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [1, 0, 0, 0, 1, 1], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1]], [[1, 0, 0, 0, 1, 1], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [0, 1, 1, 1, 0, 0], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0]], [[1, 0, 0, 0, 1, 1], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [0, 1, 1, 1, 0, 0]], [[1, 0, 0, 0, 1, 1], [0, 0, 0, 1, 1, 1], [0, 0, 1, 1, 1, 0], [ 0, 1, 1, 1, 0, 0], [1, 1, 1, 0, 0, 0], [1, 1, 0, 0, 0, 1]], [[1, 0, 0, 0, 1, 1] , [0, 0, 0, 1, 1, 1], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [1, 1, 1, 0, 0, 0 ], [1, 0, 0, 0, 1, 1]], [[1, 0, 0, 0, 1, 1], [0, 0, 0, 1, 1, 1], [0, 1, 1, 1, 0 , 0], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [0, 0, 0, 1, 1, 1]], [[1, 0, 0, 0 , 1, 1], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [0, 1, 1, 1, 0, 0], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1]], [[1, 0, 0, 0, 1, 1], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [0, 1, 1, 1, 0, 0]], [[1, 0, 0, 0, 1, 1], [0, 0, 1, 1, 1, 0], [0, 1, 1, 1, 0, 0], [0, 1, 1, 0, 0, 1], [1, 1, 0, 0, 0, 1], [1, 0, 0, 1, 1, 0]], [[1, 0, 0, 0, 1, 1], [0, 0, 1, 1, 1, 0], [ 0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 1, 1]], [[1, 0, 0, 0, 1, 1], [0, 0, 1, 1, 1, 0], [0, 1, 1, 1, 0, 0], [1, 1, 0, 0, 0, 1] , [1, 1, 0, 0, 0, 1], [0, 0, 1, 1, 1, 0]], [[1, 0, 0, 0, 1, 1], [0, 0, 1, 1, 1, 0], [0, 1, 1, 1, 0, 0], [1, 1, 1, 0, 0, 0], [1, 1, 0, 0, 0, 1], [0, 0, 0, 1, 1, 1]], [[1, 0, 0, 0, 1, 1], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [0, 1, 1, 1, 0, 0], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0]], [[1, 0, 0, 0, 1, 1], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [0, 1, 1, 1, 0, 0]], [[1, 0, 0, 0, 1, 1], [0, 1, 1, 0, 0, 1], [0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0], [1, 0, 0, 1, 1, 0], [1, 1, 0, 0, 0, 1]], [[1, 0, 0, 0, 1, 1], [0, 1, 1, 0, 0, 1], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [1, 0, 0, 1, 1, 0], [1, 0, 0, 0, 1, 1]], [[1, 0, 0, 0, 1, 1], [0, 1, 1, 0, 0, 1], [0, 1, 1, 1, 0, 0], [ 1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [0, 1, 1, 0, 0, 1]], [[1, 0, 0, 0, 1, 1] , [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [0, 0, 0, 1, 1, 1], [1, 0, 0, 0, 1, 1 ], [1, 1, 1, 0, 0, 0]], [[1, 0, 0, 0, 1, 1], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0 , 0], [0, 0, 1, 1, 1, 0], [1, 0, 0, 0, 1, 1], [1, 1, 0, 0, 0, 1]], [[1, 0, 0, 0 , 1, 1], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [0, 1, 1, 0, 0, 1], [1, 0, 0, 0, 1, 1], [1, 0, 0, 1, 1, 0]], [[1, 0, 0, 0, 1, 1], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1]], [[1, 0, 0, 0, 1, 1], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [0, 1, 1, 1, 0, 0]], [[1, 0, 0, 0, 1, 1], [0, 1, 1, 1, 0, 0], [ 0, 1, 1, 1, 0, 0], [1, 0, 0, 1, 1, 0], [1, 0, 0, 0, 1, 1], [0, 1, 1, 0, 0, 1]], [[1, 0, 0, 0, 1, 1], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [1, 1, 0, 0, 0, 1] , [1, 0, 0, 0, 1, 1], [0, 0, 1, 1, 1, 0]], [[1, 0, 0, 0, 1, 1], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [1, 1, 1, 0, 0, 0], [1, 0, 0, 0, 1, 1], [0, 0, 0, 1, 1, 1]], [[1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [0, 0, 0, 1, 1, 1], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [1, 1, 1, 0, 0, 0]], [[1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [0, 0, 1, 1, 1, 0], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [1, 1, 0, 0, 0, 1]], [[1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [0, 1, 1, 0, 0, 1], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [1, 0, 0, 1, 1, 0]], [[1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [1, 0, 0, 0, 1, 1]], [[1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [ 0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0]], [[1, 0, 0, 0, 1, 1] , [1, 0, 0, 0, 1, 1], [1, 0, 0, 1, 1, 0], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0 ], [0, 1, 1, 0, 0, 1]], [[1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [1, 1, 0, 0, 0 , 1], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0]], [[1, 0, 0, 0 , 1, 1], [1, 0, 0, 0, 1, 1], [1, 1, 1, 0, 0, 0], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [0, 0, 0, 1, 1, 1]], [[1, 0, 0, 0, 1, 1], [1, 0, 0, 1, 1, 0], [0, 0, 1, 1, 1, 0], [0, 1, 1, 1, 0, 0], [0, 1, 1, 0, 0, 1], [1, 1, 0, 0, 0, 1]], [[1, 0, 0, 0, 1, 1], [1, 0, 0, 1, 1, 0], [0, 1, 1, 1, 0, 0], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 0, 0, 1, 1, 0]], [[1, 0, 0, 0, 1, 1], [1, 0, 0, 1, 1, 0], [ 0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [0, 1, 1, 0, 0, 1], [1, 0, 0, 0, 1, 1]], [[1, 0, 0, 0, 1, 1], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [0, 1, 1, 0, 0, 1] , [0, 1, 1, 0, 0, 1], [0, 1, 1, 1, 0, 0]], [[1, 0, 0, 0, 1, 1], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [0, 1, 1, 1, 0, 0], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1]], [[1, 0, 0, 0, 1, 1], [1, 1, 0, 0, 0, 1], [0, 1, 1, 0, 0, 1], [0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0], [1, 0, 0, 1, 1, 0]], [[1, 0, 0, 0, 1, 1], [1, 1, 0, 0, 0, 1], [0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [1, 1, 0, 0, 0, 1]], [[1, 0, 0, 0, 1, 1], [1, 1, 0, 0, 0, 1], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0], [1, 0, 0, 0, 1, 1]], [[1, 0, 0, 0, 1, 1], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [0, 1, 1, 1, 0, 0]], [[1, 0, 0, 0, 1, 1], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [ 0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0]], [[1, 0, 0, 0, 1, 1] , [1, 1, 0, 0, 0, 1], [1, 1, 1, 0, 0, 0], [0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0 ], [0, 0, 0, 1, 1, 1]], [[1, 0, 0, 0, 1, 1], [1, 1, 1, 0, 0, 0], [0, 1, 1, 1, 0 , 0], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [1, 1, 1, 0, 0, 0]], [[1, 0, 0, 0 , 1, 1], [1, 1, 1, 0, 0, 0], [0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 1], [1, 1, 0, 0, 0, 1]], [[1, 0, 0, 0, 1, 1], [1, 1, 1, 0, 0, 0], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [0, 0, 0, 1, 1, 1], [1, 0, 0, 0, 1, 1]], [[1, 0, 0, 0, 1, 1], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [0, 1, 1, 1, 0, 0]], [[1, 0, 0, 0, 1, 1], [1, 1, 1, 0, 0, 0], [ 1, 1, 1, 0, 0, 0], [0, 1, 1, 1, 0, 0], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1]], [[1, 0, 0, 1, 1, 0], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [0, 1, 1, 0, 0, 1] , [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0]], [[1, 0, 0, 1, 1, 0], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [0, 1, 1, 0, 0, 1]], [[1, 0, 0, 1, 1, 0], [0, 0, 0, 1, 1, 1], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 1, 1, 0, 0, 0], [1, 0, 0, 1, 1, 0]], [[1, 0, 0, 1, 1, 0], [0, 0, 0, 1, 1, 1], [0, 1, 1, 0, 0, 1], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [0, 0, 0, 1, 1, 1]], [[1, 0, 0, 1, 1, 0], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [0, 1, 1, 0, 0, 1], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1]], [[1, 0, 0, 1, 1, 0], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [0, 1, 1, 0, 0, 1]], [[1, 0, 0, 1, 1, 0], [0, 0, 1, 1, 1, 0], [0, 1, 1, 0, 0, 1], [ 0, 1, 1, 0, 0, 1], [1, 1, 0, 0, 0, 1], [1, 0, 0, 1, 1, 0]], [[1, 0, 0, 1, 1, 0] , [0, 0, 1, 1, 1, 0], [0, 1, 1, 0, 0, 1], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1 ], [0, 0, 1, 1, 1, 0]], [[1, 0, 0, 1, 1, 0], [0, 0, 1, 1, 1, 0], [0, 1, 1, 1, 0 , 0], [0, 1, 1, 0, 0, 1], [1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 1, 1]], [[1, 0, 0, 1 , 1, 0], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [0, 0, 0, 1, 1, 1], [1, 0, 0, 1, 1, 0], [1, 1, 1, 0, 0, 0]], [[1, 0, 0, 1, 1, 0], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [0, 0, 1, 1, 1, 0], [1, 0, 0, 1, 1, 0], [1, 1, 0, 0, 0, 1]], [[1, 0, 0, 1, 1, 0], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0]], [[1, 0, 0, 1, 1, 0], [0, 1, 1, 0, 0, 1], [ 0, 1, 1, 0, 0, 1], [0, 1, 1, 1, 0, 0], [1, 0, 0, 1, 1, 0], [1, 0, 0, 0, 1, 1]], [[1, 0, 0, 1, 1, 0], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 0, 0, 0, 1, 1] , [1, 0, 0, 1, 1, 0], [0, 1, 1, 1, 0, 0]], [[1, 0, 0, 1, 1, 0], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [0, 1, 1, 0, 0, 1]], [[1, 0, 0, 1, 1, 0], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 1, 0, 0, 0, 1], [1, 0, 0, 1, 1, 0], [0, 0, 1, 1, 1, 0]], [[1, 0, 0, 1, 1, 0], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 1, 1, 0, 0, 0], [1, 0, 0, 1, 1, 0], [0, 0, 0, 1, 1, 1]], [[1, 0, 0, 1, 1, 0], [0, 1, 1, 1, 0, 0], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 0, 0, 0, 1, 1], [1, 0, 0, 1, 1, 0]], [[1, 0, 0, 1, 1, 0], [0, 1, 1, 1, 0, 0], [0, 1, 1, 0, 0, 1], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [0, 1, 1, 1, 0, 0]], [[1, 0, 0, 1, 1, 0], [0, 1, 1, 1, 0, 0], [0, 1, 1, 0, 0, 1], [ 1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 1, 1], [0, 0, 1, 1, 1, 0]], [[1, 0, 0, 1, 1, 0] , [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [0, 1, 1, 0, 0, 1], [1, 0, 0, 0, 1, 1 ], [1, 0, 0, 0, 1, 1]], [[1, 0, 0, 1, 1, 0], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0 , 0], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [0, 1, 1, 0, 0, 1]], [[1, 0, 0, 1 , 1, 0], [1, 0, 0, 0, 1, 1], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [0, 1, 1, 1, 0, 0], [1, 0, 0, 1, 1, 0]], [[1, 0, 0, 1, 1, 0], [1, 0, 0, 0, 1, 1], [0, 1, 1, 0, 0, 1], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [1, 0, 0, 0, 1, 1]], [[1, 0, 0, 1, 1, 0], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [0, 1, 1, 0, 0, 1], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0]], [[1, 0, 0, 1, 1, 0], [1, 0, 0, 0, 1, 1], [ 1, 0, 0, 0, 1, 1], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [0, 1, 1, 0, 0, 1]], [[1, 0, 0, 1, 1, 0], [1, 0, 0, 0, 1, 1], [1, 1, 0, 0, 0, 1], [0, 1, 1, 0, 0, 1] , [0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0]], [[1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [0, 0, 0, 1, 1, 1], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 1, 1, 0, 0, 0]], [[1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [0, 0, 1, 1, 1, 0], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 1, 0, 0, 0, 1]], [[1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 0, 0, 1, 1, 0]], [[1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [0, 1, 1, 1, 0, 0], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 0, 0, 0, 1, 1]], [[1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [1, 0, 0, 0, 1, 1], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [0, 1, 1, 1, 0, 0]], [[1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [ 0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1]], [[1, 0, 0, 1, 1, 0] , [1, 0, 0, 1, 1, 0], [1, 1, 0, 0, 0, 1], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1 ], [0, 0, 1, 1, 1, 0]], [[1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [1, 1, 1, 0, 0 , 0], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [0, 0, 0, 1, 1, 1]], [[1, 0, 0, 1 , 1, 0], [1, 1, 0, 0, 0, 1], [0, 1, 1, 0, 0, 1], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [1, 1, 0, 0, 0, 1]], [[1, 0, 0, 1, 1, 0], [1, 1, 0, 0, 0, 1], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [0, 0, 1, 1, 1, 0], [1, 0, 0, 1, 1, 0]], [[1, 0, 0, 1, 1, 0], [1, 1, 0, 0, 0, 1], [0, 1, 1, 0, 0, 1], [0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0], [1, 0, 0, 0, 1, 1]], [[1, 0, 0, 1, 1, 0], [1, 1, 0, 0, 0, 1], [ 1, 1, 0, 0, 0, 1], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [0, 1, 1, 0, 0, 1]], [[1, 0, 0, 1, 1, 0], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [0, 1, 1, 0, 0, 1] , [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0]], [[1, 0, 0, 1, 1, 0], [1, 1, 1, 0, 0, 0], [0, 1, 1, 0, 0, 1], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [1, 1, 1, 0, 0, 0]], [[1, 0, 0, 1, 1, 0], [1, 1, 1, 0, 0, 0], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [0, 0, 0, 1, 1, 1], [1, 0, 0, 1, 1, 0]], [[1, 0, 0, 1, 1, 0], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [0, 1, 1, 0, 0, 1]], [[1, 0, 0, 1, 1, 0], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [0, 1, 1, 0, 0, 1], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1]], [[1, 1, 0, 0, 0, 1], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [0, 0, 1, 1, 1, 0], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0]], [[1, 1, 0, 0, 0, 1], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [ 1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [0, 0, 1, 1, 1, 0]], [[1, 1, 0, 0, 0, 1] , [0, 0, 0, 1, 1, 1], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [1, 1, 1, 0, 0, 0 ], [1, 1, 0, 0, 0, 1]], [[1, 1, 0, 0, 0, 1], [0, 0, 0, 1, 1, 1], [0, 0, 1, 1, 1 , 0], [0, 1, 1, 1, 0, 0], [1, 1, 1, 0, 0, 0], [1, 0, 0, 0, 1, 1]], [[1, 1, 0, 0 , 0, 1], [0, 0, 0, 1, 1, 1], [0, 0, 1, 1, 1, 0], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [0, 0, 0, 1, 1, 1]], [[1, 1, 0, 0, 0, 1], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 1], [1, 1, 0, 0, 0, 1], [1, 1, 1, 0, 0, 0]], [[1, 1, 0, 0, 0, 1], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1]], [[1, 1, 0, 0, 0, 1], [0, 0, 1, 1, 1, 0], [ 0, 0, 1, 1, 1, 0], [0, 1, 1, 0, 0, 1], [1, 1, 0, 0, 0, 1], [1, 0, 0, 1, 1, 0]], [[1, 1, 0, 0, 0, 1], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [0, 1, 1, 1, 0, 0] , [1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 1, 1]], [[1, 1, 0, 0, 0, 1], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [1, 0, 0, 0, 1, 1], [1, 1, 0, 0, 0, 1], [0, 1, 1, 1, 0, 0]], [[1, 1, 0, 0, 0, 1], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [1, 0, 0, 1, 1, 0], [1, 1, 0, 0, 0, 1], [0, 1, 1, 0, 0, 1]], [[1, 1, 0, 0, 0, 1], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [0, 0, 1, 1, 1, 0]], [[1, 1, 0, 0, 0, 1], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [1, 1, 1, 0, 0, 0], [1, 1, 0, 0, 0, 1], [0, 0, 0, 1, 1, 1]], [[1, 1, 0, 0, 0, 1], [0, 1, 1, 0, 0, 1], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [1, 0, 0, 1, 1, 0], [1, 1, 0, 0, 0, 1]], [[1, 1, 0, 0, 0, 1], [0, 1, 1, 0, 0, 1], [0, 0, 1, 1, 1, 0], [ 1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [0, 1, 1, 0, 0, 1]], [[1, 1, 0, 0, 0, 1] , [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [0, 0, 1, 1, 1, 0], [1, 0, 0, 1, 1, 0 ], [1, 0, 0, 1, 1, 0]], [[1, 1, 0, 0, 0, 1], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0 , 1], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [0, 0, 1, 1, 1, 0]], [[1, 1, 0, 0 , 0, 1], [0, 1, 1, 0, 0, 1], [0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0], [1, 0, 0, 1, 1, 0], [1, 0, 0, 0, 1, 1]], [[1, 1, 0, 0, 0, 1], [0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 1], [1, 0, 0, 0, 1, 1], [1, 1, 1, 0, 0, 0]], [[1, 1, 0, 0, 0, 1], [0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [1, 0, 0, 0, 1, 1], [1, 1, 0, 0, 0, 1]], [[1, 1, 0, 0, 0, 1], [0, 1, 1, 1, 0, 0], [ 0, 0, 1, 1, 1, 0], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [0, 1, 1, 1, 0, 0]], [[1, 1, 0, 0, 0, 1], [0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0], [1, 0, 0, 1, 1, 0] , [1, 0, 0, 0, 1, 1], [0, 1, 1, 0, 0, 1]], [[1, 1, 0, 0, 0, 1], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1]], [[1, 1, 0, 0, 0, 1], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [0, 0, 1, 1, 1, 0]], [[1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 1, 1], [0, 0, 0, 1, 1, 1], [0, 0, 1, 1, 1, 0], [0, 1, 1, 1, 0, 0], [1, 1, 1, 0, 0, 0]], [[1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 1, 1], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [0, 1, 1, 1, 0, 0], [1, 1, 0, 0, 0, 1]], [[1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 1, 1], [0, 0, 1, 1, 1, 0], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [1, 0, 0, 0, 1, 1]], [[1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [ 0, 0, 1, 1, 1, 0], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0]], [[1, 1, 0, 0, 0, 1] , [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0 ], [0, 0, 1, 1, 1, 0]], [[1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 1, 1], [1, 0, 0, 1, 1 , 0], [0, 0, 1, 1, 1, 0], [0, 1, 1, 1, 0, 0], [0, 1, 1, 0, 0, 1]], [[1, 1, 0, 0 , 0, 1], [1, 0, 0, 1, 1, 0], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [0, 1, 1, 0, 0, 1], [1, 1, 0, 0, 0, 1]], [[1, 1, 0, 0, 0, 1], [1, 0, 0, 1, 1, 0], [0, 0, 1, 1, 1, 0], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 0, 0, 1, 1, 0]], [[1, 1, 0, 0, 0, 1], [1, 0, 0, 1, 1, 0], [0, 0, 1, 1, 1, 0], [0, 1, 1, 1, 0, 0], [0, 1, 1, 0, 0, 1], [1, 0, 0, 0, 1, 1]], [[1, 1, 0, 0, 0, 1], [1, 0, 0, 1, 1, 0], [ 1, 0, 0, 1, 1, 0], [0, 0, 1, 1, 1, 0], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1]], [[1, 1, 0, 0, 0, 1], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [0, 1, 1, 0, 0, 1] , [0, 1, 1, 0, 0, 1], [0, 0, 1, 1, 1, 0]], [[1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [0, 0, 0, 1, 1, 1], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [1, 1, 1, 0, 0, 0]], [[1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [1, 1, 0, 0, 0, 1]], [[1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [0, 1, 1, 0, 0, 1], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [1, 0, 0, 1, 1, 0]], [[1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [1, 0, 0, 0, 1, 1]], [[1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 1, 1], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [0, 1, 1, 1, 0, 0]], [[1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [1, 0, 0, 1, 1, 0], [ 0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [0, 1, 1, 0, 0, 1]], [[1, 1, 0, 0, 0, 1] , [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0 ], [0, 0, 1, 1, 1, 0]], [[1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [1, 1, 1, 0, 0 , 0], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 1]], [[1, 1, 0, 0 , 0, 1], [1, 1, 1, 0, 0, 0], [0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [1, 1, 1, 0, 0, 0]], [[1, 1, 0, 0, 0, 1], [1, 1, 1, 0, 0, 0], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 1], [1, 1, 0, 0, 0, 1]], [[1, 1, 0, 0, 0, 1], [1, 1, 1, 0, 0, 0], [0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 1], [1, 0, 0, 0, 1, 1]], [[1, 1, 0, 0, 0, 1], [1, 1, 1, 0, 0, 0], [ 1, 1, 1, 0, 0, 0], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [0, 0, 1, 1, 1, 0]], [[1, 1, 0, 0, 0, 1], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [0, 0, 1, 1, 1, 0] , [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1]], [[1, 1, 1, 0, 0, 0], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0]], [[1, 1, 1, 0, 0, 0], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [0, 0, 1, 1, 1, 0], [1, 1, 1, 0, 0, 0], [1, 1, 0, 0, 0, 1]], [[1, 1, 1, 0, 0, 0], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [0, 1, 1, 0, 0, 1], [1, 1, 1, 0, 0, 0], [1, 0, 0, 1, 1, 0]], [[1, 1, 1, 0, 0, 0], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [0, 1, 1, 1, 0, 0], [1, 1, 1, 0, 0, 0], [1, 0, 0, 0, 1, 1]], [[1, 1, 1, 0, 0, 0], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [1, 0, 0, 0, 1, 1], [1, 1, 1, 0, 0, 0], [0, 1, 1, 1, 0, 0]], [[1, 1, 1, 0, 0, 0], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [ 1, 0, 0, 1, 1, 0], [1, 1, 1, 0, 0, 0], [0, 1, 1, 0, 0, 1]], [[1, 1, 1, 0, 0, 0] , [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [1, 1, 0, 0, 0, 1], [1, 1, 1, 0, 0, 0 ], [0, 0, 1, 1, 1, 0]], [[1, 1, 1, 0, 0, 0], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1 , 1], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [0, 0, 0, 1, 1, 1]], [[1, 1, 1, 0 , 0, 0], [0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [1, 1, 0, 0, 0, 1], [1, 1, 1, 0, 0, 0]], [[1, 1, 1, 0, 0, 0], [0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 1], [1, 0, 0, 0, 1, 1], [1, 1, 0, 0, 0, 1], [0, 1, 1, 1, 0, 0]], [[1, 1, 1, 0, 0, 0], [0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 1], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [0, 0, 1, 1, 1, 0]], [[1, 1, 1, 0, 0, 0], [0, 0, 1, 1, 1, 0], [ 0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 1], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1]], [[1, 1, 1, 0, 0, 0], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [1, 1, 0, 0, 0, 1] , [1, 1, 0, 0, 0, 1], [0, 0, 0, 1, 1, 1]], [[1, 1, 1, 0, 0, 0], [0, 1, 1, 0, 0, 1], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [1, 0, 0, 1, 1, 0], [1, 1, 1, 0, 0, 0]], [[1, 1, 1, 0, 0, 0], [0, 1, 1, 0, 0, 1], [0, 0, 0, 1, 1, 1], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [0, 1, 1, 0, 0, 1]], [[1, 1, 1, 0, 0, 0], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [0, 0, 0, 1, 1, 1], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0]], [[1, 1, 1, 0, 0, 0], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [0, 0, 0, 1, 1, 1]], [[1, 1, 1, 0, 0, 0], [0, 1, 1, 1, 0, 0], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [1, 0, 0, 0, 1, 1], [1, 1, 1, 0, 0, 0]], [[1, 1, 1, 0, 0, 0], [0, 1, 1, 1, 0, 0], [0, 0, 0, 1, 1, 1], [ 1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [0, 1, 1, 1, 0, 0]], [[1, 1, 1, 0, 0, 0] , [0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 1], [1, 0, 0, 0, 1, 1 ], [1, 1, 0, 0, 0, 1]], [[1, 1, 1, 0, 0, 0], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0 , 0], [0, 0, 0, 1, 1, 1], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1]], [[1, 1, 1, 0 , 0, 0], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [0, 0, 0, 1, 1, 1]], [[1, 1, 1, 0, 0, 0], [1, 0, 0, 0, 1, 1], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [0, 1, 1, 1, 0, 0], [1, 1, 1, 0, 0, 0]], [[1, 1, 1, 0, 0, 0], [1, 0, 0, 0, 1, 1], [0, 0, 0, 1, 1, 1], [0, 0, 1, 1, 1, 0], [0, 1, 1, 1, 0, 0], [1, 1, 0, 0, 0, 1]], [[1, 1, 1, 0, 0, 0], [1, 0, 0, 0, 1, 1], [ 0, 0, 0, 1, 1, 1], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [1, 0, 0, 0, 1, 1]], [[1, 1, 1, 0, 0, 0], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [0, 0, 0, 1, 1, 1] , [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0]], [[1, 1, 1, 0, 0, 0], [1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1, 1], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [0, 0, 0, 1, 1, 1]], [[1, 1, 1, 0, 0, 0], [1, 0, 0, 1, 1, 0], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [0, 1, 1, 0, 0, 1], [1, 1, 1, 0, 0, 0]], [[1, 1, 1, 0, 0, 0], [1, 0, 0, 1, 1, 0], [0, 0, 0, 1, 1, 1], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 0, 0, 1, 1, 0]], [[1, 1, 1, 0, 0, 0], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [0, 0, 0, 1, 1, 1], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1]], [[1, 1, 1, 0, 0, 0], [1, 0, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0], [0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [0, 0, 0, 1, 1, 1]], [[1, 1, 1, 0, 0, 0], [1, 1, 0, 0, 0, 1], [0, 0, 0, 1, 1, 1], [ 0, 0, 0, 1, 1, 1], [0, 0, 1, 1, 1, 0], [1, 1, 1, 0, 0, 0]], [[1, 1, 1, 0, 0, 0] , [1, 1, 0, 0, 0, 1], [0, 0, 0, 1, 1, 1], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0 ], [1, 1, 0, 0, 0, 1]], [[1, 1, 1, 0, 0, 0], [1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 1 , 1], [0, 0, 0, 1, 1, 1], [0, 0, 1, 1, 1, 0], [0, 1, 1, 1, 0, 0]], [[1, 1, 1, 0 , 0, 0], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [0, 0, 0, 1, 1, 1], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0]], [[1, 1, 1, 0, 0, 0], [1, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1], [0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 1]], [[1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [1, 1, 1, 0, 0, 0]], [[1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [ 0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [1, 1, 0, 0, 0, 1]], [[1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [0, 1, 1, 0, 0, 1], [0, 0, 0, 1, 1, 1] , [0, 0, 0, 1, 1, 1], [1, 0, 0, 1, 1, 0]], [[1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [0, 1, 1, 1, 0, 0], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [1, 0, 0, 0, 1, 1]], [[1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [1, 0, 0, 0, 1, 1], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [0, 1, 1, 1, 0, 0]], [[1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [1, 0, 0, 1, 1, 0], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [0, 1, 1, 0, 0, 1]], [[1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [1, 1, 0, 0, 0, 1], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [0, 0, 1, 1, 1, 0]], [[1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1]]}): elif m=8 and n=8 and k1=4 and k2=4 then RETURN(M88()): fi: lu:=G1nmk(n,m,k1): gu:={}: for lu1 in lu do if {seq(add(lu1[i1][j1],i1=1..m),j1=1..n)}={k2} then gu:=gu union {lu1}: fi: od: gu: end: #IsSubM(M1,M2,X): Given a matrix M1 in {0,1,X} and a matrix M2 of the same dimensions in {0,1} checks that the non-Z entries of M1 are the same as those of M2. Try: #IsSubM([[1,X],[X,0]],[[1,0],[0,0]]); IsSubM:=proc(M1,M2,X) local i,j: if not (nops(M1)=nops(M2) and nops(M1[1])=nops(M2[1])) then RETURN(FAIL): fi: for i from 1 to nops(M1) do for j from 1 to nops(M1[1]) do if M1[i][j]<>X and M1[i][j]<>M2[i][j] then RETURN(false): fi: od: od: true: end: #Ptor(M,X,k1,k2): Given a NotAlone puzzle where X is blank 1 is filled circle and 0 is empty circle finds all solutions. For example, forr the Aug. 11, 2024 puzzle by #Presanna Seshardi, type: #Ptor([[X$6],[X,X,1,1,X,X],[X$6],[1,X,1,X,X,X],[X,1,X,X,X,X],[X$6]],3,3); Ptor:=proc(M,X,k1,k2) local i,m,n,lu,lu1,gu: if {seq(op(M[i]),i=1..nops(M))} minus {0,1,X}<>{} then print(`bad puzzle`): RETURN(FAIL): fi: m:=nops(M): n:=nops(M[1]): lu:=Gnmk(n,m,k1,k2): gu:={}: for lu1 in lu do if IsSubM(M,lu1,X) then gu:=gu union {lu1}: fi: od: gu: end: #RandPuz1(n,m,k1,k2,X,c): A random m by n Not Alove puzzle with row sums k1 and column sums k2 and c clues. Try #RandPuz1(6,6,3,3,X,6); RandPuz1:=proc(n,m,k1,k2,X,c) local M,gu,L,i,j,T,i1,ce: gu:=Gnmk(n,m,k1,k2): M:=gu[rand(1..nops(gu))()]: L:={seq(seq([i,j],j=1..n),i=1..m)}: for i from 1 to m do for j from 1 to n do T[i,j]:=X: od: od: for i1 from 1 to c do ce:=L[rand(1..nops(L))()]: T[op(ce)]:=M[ce[1]][ce[2]]: L:=L minus {ce}: od: M:=[seq([seq(T[i,j],j=1..n)],i=1..m)]: if nops(Ptor(M,X,k1,k2))<>1 then RETURN(FAIL): fi: M: end: #RandPuz(n,m,k1,k2,X,c,K): A random m by n Not Alove puzzle with row sums k1 and column sums k2 and c clues. Try #RandPuz1(6,6,3,3,X,6,100); RandPuz:=proc(n,m,k1,k2,X,c,K) local M,i: for i from 1 to K do M:=RandPuz1(n,m,k1,k2,X,c): if M<>FAIL then RETURN(M): fi: od: FAIL: end: #MakeHarder(M,k1,k2,X): given a (k1,k2) puzzle in terms of X tries to make it harder MakeHarder:=proc(M,k1,k2,X) local m,n,i,j,M1: m:=nops(M): n:=nops(M[1]): if nops(Ptor(M,X,k1,k2))<>1 then RETURN(FAIL): fi: for i from 1 to m do for j from 1 to n do if M[i][j]<>X then M1:=[op(1..i-1,M),[op(1..j-1,M[i]),X,op(j+1..n,M[i])],op(i+1..m,M)]: if nops(Ptor(M1,X,k1,k2))=1 then RETURN(M1): fi: fi: od: od: FAIL: end: #MakeHardPuz(n,m,k1,k2,X,c,K,TL). Makes a hard Not Alone puzzle (where all clues are crucial to have a unique solution) on an m by n grid #with k1 1s in every row and k2 1s in every column. Try: #MakeHardPuz(6,6,3,3,X,8,1000,TL); MakeHardPuz:=proc(n,m,k1,k2,X,c,K, TL) local M,M1,t0: t0:=time(): if c<=n*m/4 then print(`with c equal to`, c, `it may take a long time we recommend that you make c at least`, trunc(n*m/4)): fi: M:=RandPuz(n,m,k1,k2,X,c,K): if M=FAIL then RETURN(FAIL): fi: M1:=MakeHarder(M,k1,k2,X): while M1<>FAIL and time()-t0FAIL do M1:=M2: M2:=FC1(M1,X,k1,k2): od: M1: end: #IsBad(M,k1,k2): Is the matrix M with alphabet {0,1,X} bad in the Not Alone sense and that the number of 0s <=k1 and number of 1's<=k1 in every row #and number of 0s <=k2 and number of 1's<=k2 in every column #and column. Try: #M:=Ptor([[X$6],[X,X,1,1,X,X],[X$6],[1,X,1,X,X,X],[X,1,X,X,X,X],[X$6]],3,3); IsBad(M,X,3,3); IsBad:=proc(M,k1,k2) local i,j,lu,z: for i from 1 to nops(M) do for j from 1 to nops(M[i])-2 do if [M[i,j],M[i,j+1],M[i,j+2]]=[1,0,1] then RETURN(true): fi: if [M[i,j],M[i,j+1],M[i,j+2]]=[0,1,0] then RETURN(true): fi: od: od: for j from 1 to nops(M[1]) do for i from 1 to nops(M)-2 do if [M[i,j],M[i+1,j],M[i+2,j]]=[1,0,1] then RETURN(true): fi: if [M[i,j],M[i+1,j],M[i+2,j]]=[0,1,0] then RETURN(true): fi: od: od: for i from 1 to nops(M) do lu:=add(z[M[i][j]],j=1..nops(M[i])): if coeff(lu,z[0],1)>k1 or coeff(lu,z[1],1)>k2 then RETURN(true): fi: od: for j from 1 to nops(M[1]) do lu:=add(z[M[i][j]],i=1..nops(M)): if coeff(lu,z[0],1)>k1 or coeff(lu,z[1],1)>k2 then RETURN(true): fi: od: false: end: #FillIn1(M,X,k1,k2): fills in X's where the number of 0's or 1's in a row in exactly k1 and ditto for columns with k2. Try: #FillIn1([[X,X,X,1,X,X],[X$6],[X,X,X,1,0,X],[1,0,X,X,X,X],[X$6],[X,0,X,X,X,X]],X,3,3); FillIn1:=proc(M,X,k1,k2) local i,j,z,M1,lu: for i from 1 to nops(M) do lu:=add(z[M[i][j]],j=1..nops(M[i])): if coeff(lu,z[0],1)=k1 and coeff(lu,z[1],1)+coeff(lu,z[X],1)=k1 and coeff(lu,z[X],1)>0 then M1:=M: for j from 1 to nops(M[i]) do if M1[i][j]=X then M1:=Shane(M1,i,j,1): fi: od: if not IsBad(M1,k1,k2) then RETURN(M1): fi: fi: if coeff(lu,z[1],1)=k1 and coeff(lu,z[0],1)+coeff(lu,z[X],1)=k1 and coeff(lu,z[X],1)>0 then M1:=M: for j from 1 to nops(M[i]) do if M1[i][j]=X then M1:=Shane(M1,i,j,0): fi: od: if not IsBad(M1,k1,k2) then RETURN(M1): fi: fi: od: #### for j from 1 to nops(M[1]) do lu:=add(z[M[i][j]],i=1..nops(M)): if coeff(lu,z[0],1)=k2 and coeff(lu,z[1],1)+coeff(lu,z[X],1)=k2 and coeff(lu,z[X],1)>0 then M1:=M: for i from 1 to nops(M) do if M1[i][j]=X then M1:=Shane(M1,i,j,1): fi: od: if not IsBad(M1,k1,k2) then RETURN(M1): fi: fi: if coeff(lu,z[1],1)=k2 and coeff(lu,z[0],1)+coeff(lu,z[X],1)=k2 and coeff(lu,z[X],1)>0 then M1:=M: for i from 1 to nops(M) do if M1[i][j]=X then M1:=Shane(M1,i,j,0): fi: od: if not IsBad(M1,k1,k2) then RETURN(M1): fi: fi: od: ### FAIL: end: #FillIn(M,X,k1,k2): Applies FillIn1(M,X) as much as possible. Try #FillIn([[1,0,X],[0,1,X]],X,3,3); FillIn:=proc(M,X,k1,k2) local M1,M2: M1:=M: M2:=FillIn1(M1,X,k1,k2): while M2<>FAIL do M1:=M2: M2:=FillIn1(M1,X,k1,k2): od: M1: end: #NumX(M,X): the number of X's still in M #Try NuX([[X,0,1],[1,X,0]],X); NumX:=proc(M,X) local i,j,z: coeff(add(add(z[M[i][j]],j=1..nops(M[i])),i=1..nops(M)),z[X],1): end: #SolveN1(M,X,k1,k2): solves the Not Alone puzzle M where X is blank and there are k1 1s and k2 0s in each row and each colunm, #using logic. SolveN1:=proc(M,X,k1,k2) local M1,M2,M3: M1:=M: M2:=FillIn(FC(M,X,k1,k2),X,k1,k2): while M1<>M2 and NumX(M2,X)>0 do M3:=FillIn(FC(M2,X,k1,k2),X,k1,k2): M1:=M2: M2:=M3: od: M2: end: #IsBadR(M,X,k1,k2,R): Given a partial solution M does there exist an place that # changing X to either 0 or 1 will be (R-1)-bad. with R=0 it is the same IsBad(M,k1,k2) IsBadR:=proc(M,X,k1,k2,R) local i,j: if NuX(M,X)=0 then RETURN(false): fi: if R=0 then RETURN(IsBad(M,k1,k2)): fi: for i from 1 to nops(M) do for j from 1 to nops(M[i]) do if M[i][j]=X then if IsBadR(Shane(M,i,j,0),X,k1,k2,R-1) and IsBadR(Shane(M,i,j,1),X,k1,k2,R-1) then RETURN(true): fi: fi: od: od: false: end: #MakeBetter(M,X,k1,k2,d): Given a partial solution,M, to a (k1,k2) Not Alone puzzle tries to find a better one using IsbadR with d #Try: #M:=SolveN1([[X$8],[X$8],[X,0,0,X,X,1,0,X],[X,0,1,X,X,0,1,X],[X$8],[X,X,X,1,1,X,X,X],[X$8],[X,X,X,X,X,X,1,X]],X,4,4); MakeBetter(M,X,4,4,2); MakeBetter:=proc(M,X,k1,k2,d) local i,j,d1: for i from 1 to nops(M) do for j from 1 to nops(M[i]) do if M[i][j]=X then for d1 from 0 to d do if IsBadR(Shane(M,i,j,0),X,k1,k2,d1) then if IsBadR(Shane(M,i,j,1),X,k1,k2,d1) then print(`something bad happened`): RETURN(FAIL): fi: RETURN(Shane(M,i,j,1)): elif IsBadR(Shane(M,i,j,1),X,k1,k2,d1) then if IsBadR(Shane(M,i,j,0),X,k1,k2,d1) then print(`something bad happened`): RETURN(FAIL): fi: RETURN(Shane(M,i,j,0)): fi: od: fi: od: od: FAIL: end: #FFin(M,X,k1,k2) : Given a partial solution of a Not Alone puzzle with still some X finds all the way #to fill-it in and still stay legal FFin:=proc(M,X,k1,k2) local i,j,M1,M0,gu: if NumX(M,X)=0 then RETURN({M}): fi: gu:={}: for i from 1 to nops(M) do for j from 1 to nops(M[i]) do if M[i][j]=X then M0:=Shane(M,i,j,0): if not IsBad(M0,k1,k2) then gu:=gu union FFin(M0,X,k1,k2): fi: M1:=Shane(M,i,j,1): if not IsBad(M1,k1,k2) then gu:=gu union FFin(M1,X,k1,k2): fi: RETURN(gu): fi: od: od: gu: end: #SolveN(M,X,k1,k2): solves the Not Alone puzzle M where X is blank and there are k1 1s and k2 0s in each row and each colunm, #using logic. SolveN:=proc(M,X,k1,k2) local i,M1,M2,M3: if {seq(op(M[i]),i=1..nops(M))} minus {0,1,X}<>{} then print(`bad puzzle`): RETURN(FAIL): fi: M1:=SolveN1(M,X,k1,k2): M2:=MakeBetter(M1,X,k1,k2,2): while M1<>M2 and NumX(M2,X)>0 and M2<>FAIL do M3:=MakeBetter(M2,X,k1,k2,2): M1:=M2: M2:=M3: od: FFin(M1,X,k1,k2): end: #RanExt(M,k1,k2): given a 0-1 matrix M where every row has k1 0s and k1 1s and avoids the patterns 101 and 010 #and the columns also avoid these and every column has at most k2 0s and at most k2 1s #finds a random extension with one more row. Try: #RanExt([],3,3); RanExt:=proc(M,k1,k2) local gu,M1,i,kha1,M2: gu:=Gnk(2*k1,k1): if M=[] then RETURN([gu[rand(1..nops(gu))()]]): fi: if nops(M[1])<>2*k1 then RETURN(FAIL): fi: for i from 1 to 100 do kha1:=gu[rand(1..nops(gu))()]: M1:=[op(M),kha1]: if not IsBad(M1,k1,k2) then RETURN(M1): fi: od: M1:=[op(1..nops(M)-1,M)]: gu:=gu minus {M[nops(M)]}: for i from 1 to 100 do kha1:=gu[rand(1..nops(gu))()]: M2:=[op(M1),kha1]: if not IsBad(M2,k1,k2) then RETURN(M2): fi: od: FAIL: end: #RanSol1(k1,k2): A random good balanced 0-1 matrix. Try: #RanSol1(3,3); RanSol1:=proc(k1,k2) local M,i: M:=[]: for i from 1 to 2*k2 do M:=RanExt(M,k1,k2): if M=FAIL then RETURN(FAIL): fi: od: M: end: #RanSol(k1,k2): A random good balanced 0-1 matrix. Try: #RanSol(3,3); RanSol:=proc(k1,k2) local gu,i: gu:=RanSol1(k1,k2): if gu<>FAIL and nops(gu)=2*k2 then RETURN(gu): fi: for i from 1 to 20 do gu:=RanSol1(k1,k2): if gu<>FAIL and nops(gu)=2*k2 then RETURN(gu): fi: od: FAIL: end: #RPuz1(k1,k2,c,X): A random (k1,k2) puzzle with c clues. Try: #RPuz1(4,4,14,X); RPuz1:=proc(k1,k2,c,X) local gu,i,j,kha,M,gu1: if c>=4*k1*k2 then RETURN(FAIL): fi: gu:={seq(seq([i,j],j=1..2*k1),i=1..2*k2)}: for i from 1 to c do kha:=gu[rand(1..nops(gu))()]: gu:=gu minus {kha}: od: M:=RanSol(k1,k2): for gu1 in gu do M:=Shane(M,op(gu1),X): od: M: end: #RPuzP(k1,k2,c,X): A random (k1,k2) puzzle with c clues. Try: #RPuzP(4,4,14,X); RPuzP:=proc(k1,k2,c,X) local i,M: for i from 1 to 40 do M:=RPuz1(k1,k2,c,X): if nops(SolveN(M,X,k1,k2))=1 then RETURN(M): fi: od: FAIL: end: #RPuz(k1,k2,c,X,T0): A random (k1,k2) puzzle with c clues and then removing as many as possible and keeping the answer unique and taking at most T0 seconds. Try: #RPuz(4,4,28,X,10); RPuz:=proc(k1,k2,c,X,T0) local i,j,M,M1,t0: M:=RPuzP(k1,k2,c,X): t0:=time(): if M=FAIL then RETURN(FAIL): fi: for i from 1 to nops(M) while time()-t0<=T0 do for j from 1 to nops(M[i]) while time()-t0<=T0 do if M[i][j]<>X then M1:=Shane(M,i,j,X): if nops(SolveN(M1,X,k1,k2))=1 then M:=M1: fi: fi: od: od: M: end: