/* Some more analysis of the number of solutions on empty Miracle Sudokus in Picat. Here are some analysis of the 9 "basic" Sudoku instances found in http://hakank.org/picat/miracle_sudoku.pi go6/0 . This Picat model was created by Hakan Kjellerstrand, hakank@gmail.com See also my Picat page: http://www.hakank.org/picat/ */ import cp,util. main => go. % % First, let's check if there are pairs of instances where all rows/column are % permutation of each other. % Note that these are row/columns permutations, not fully symmetric solutions. % % Instance matches: % p = plain matrix, t=transposed matrix, matches=[the permutation] % % Note that there is a huge number of redundancy here: % p=I,t=J is really the same symmetry t=I,p=J % % Note especially instances 4, 5, and 6 which has permutations (in some way) with % all other instances, which - again - don't mean that they are symmetric of % each other in a traditional way. % % [p = 1,p = 2,matches = [[1,8],[2,9],[3,7],[4,3],[5,1],[6,2],[7,6],[8,4],[9,5]]] % [t = 1,t = 2,matches = [[1,5],[2,6],[3,7],[4,8],[5,9],[6,1],[7,2],[8,3],[9,4]]] % [p = 1,p = 4,matches = [[1,5],[2,4],[3,6],[4,2],[5,1],[6,3],[7,7],[8,9],[9,8]]] % [p = 1,t = 5,matches = [[1,1],[2,3],[3,2],[4,9],[5,8],[6,7],[7,6],[8,5],[9,4]]] % [p = 1,p = 6,matches = [[1,7],[2,9],[3,8],[4,4],[5,6],[6,5],[7,1],[8,3],[9,2]]] % [p = 1,p = 9,matches = [[1,6],[2,4],[3,5],[4,9],[5,7],[6,8],[7,1],[8,2],[9,3]]] % [t = 1,t = 9,matches = [[1,3],[2,4],[3,5],[4,6],[5,7],[6,8],[7,9],[8,1],[9,2]]] % % [p = 2,p = 1,matches = [[1,5],[2,6],[3,4],[4,8],[5,9],[6,7],[7,3],[8,1],[9,2]]] % [t = 2,t = 1,matches = [[1,6],[2,7],[3,8],[4,9],[5,1],[6,2],[7,3],[8,4],[9,5]]] % [p = 2,p = 4,matches = [[1,1],[2,3],[3,2],[4,9],[5,8],[6,7],[7,6],[8,5],[9,4]]] % [p = 2,t = 5,matches = [[1,8],[2,7],[3,9],[4,5],[5,4],[6,6],[7,2],[8,1],[9,3]]] % [p = 2,p = 6,matches = [[1,6],[2,5],[3,4],[4,3],[5,2],[6,1],[7,8],[8,7],[9,9]]] % [p = 2,p = 9,matches = [[1,7],[2,8],[3,9],[4,2],[5,3],[6,1],[7,5],[8,6],[9,4]]] % [t = 2,t = 9,matches = [[1,8],[2,9],[3,1],[4,2],[5,3],[6,4],[7,5],[8,6],[9,7]]] % % [t = 3,t = 4,matches = [[1,7],[2,6],[3,5],[4,4],[5,3],[6,2],[7,1],[8,9],[9,8]]] % [t = 3,p = 5,matches = [[1,3],[2,2],[3,1],[4,9],[5,8],[6,7],[7,6],[8,5],[9,4]]] % [t = 3,t = 6,matches = [[1,5],[2,4],[3,3],[4,2],[5,1],[6,9],[7,8],[8,7],[9,6]]] % [t = 3,p = 7,matches = [[1,9],[2,1],[3,2],[4,3],[5,4],[6,5],[7,6],[8,7],[9,8]]] % [p = 3,t = 7,matches = [[1,4],[2,5],[3,6],[4,7],[5,8],[6,9],[7,2],[8,3],[9,1]]] % [t = 3,p = 8,matches = [[1,2],[2,3],[3,4],[4,5],[5,6],[6,7],[7,8],[8,9],[9,1]]] % [p = 3,t = 8,matches = [[1,9],[2,7],[3,8],[4,1],[5,2],[6,3],[7,4],[8,5],[9,6]]] % % [p = 4,p = 1,matches = [[1,5],[2,4],[3,6],[4,2],[5,1],[6,3],[7,7],[8,9],[9,8]]] % [p = 4,p = 2,matches = [[1,1],[2,3],[3,2],[4,9],[5,8],[6,7],[7,6],[8,5],[9,4]]] % [t = 4,t = 3,matches = [[1,7],[2,6],[3,5],[4,4],[5,3],[6,2],[7,1],[8,9],[9,8]]] % [t = 4,p = 5,matches = [[1,6],[2,7],[3,8],[4,9],[5,1],[6,2],[7,3],[8,4],[9,5]]] % [p = 4,t = 5,matches = [[1,8],[2,9],[3,7],[4,3],[5,1],[6,2],[7,6],[8,4],[9,5]]] % [p = 4,p = 6,matches = [[1,6],[2,4],[3,5],[4,9],[5,7],[6,8],[7,1],[8,2],[9,3]]] % [t = 4,t = 6,matches = [[1,8],[2,9],[3,1],[4,2],[5,3],[6,4],[7,5],[8,6],[9,7]]] % [t = 4,p = 7,matches = [[1,6],[2,5],[3,4],[4,3],[5,2],[6,1],[7,9],[8,8],[9,7]]] % [t = 4,p = 8,matches = [[1,8],[2,7],[3,6],[4,5],[5,4],[6,3],[7,2],[8,1],[9,9]]] % [p = 4,p = 9,matches = [[1,7],[2,9],[3,8],[4,4],[5,6],[6,5],[7,1],[8,3],[9,2]]] % % [t = 5,p = 1,matches = [[1,1],[2,3],[3,2],[4,9],[5,8],[6,7],[7,6],[8,5],[9,4]]] % [t = 5,p = 2,matches = [[1,8],[2,7],[3,9],[4,5],[5,4],[6,6],[7,2],[8,1],[9,3]]] % [p = 5,t = 3,matches = [[1,3],[2,2],[3,1],[4,9],[5,8],[6,7],[7,6],[8,5],[9,4]]] % [t = 5,p = 4,matches = [[1,5],[2,6],[3,4],[4,8],[5,9],[6,7],[7,3],[8,1],[9,2]]] % [p = 5,t = 4,matches = [[1,5],[2,6],[3,7],[4,8],[5,9],[6,1],[7,2],[8,3],[9,4]]] % [t = 5,p = 6,matches = [[1,7],[2,8],[3,9],[4,2],[5,3],[6,1],[7,5],[8,6],[9,4]]] % [p = 5,t = 6,matches = [[1,3],[2,4],[3,5],[4,6],[5,7],[6,8],[7,9],[8,1],[9,2]]] % [p = 5,p = 7,matches = [[1,2],[2,1],[3,9],[4,8],[5,7],[6,6],[7,5],[8,4],[9,3]]] % [p = 5,p = 8,matches = [[1,4],[2,3],[3,2],[4,1],[5,9],[6,8],[7,7],[8,6],[9,5]]] % [t = 5,p = 9,matches = [[1,6],[2,5],[3,4],[4,3],[5,2],[6,1],[7,8],[8,7],[9,9]]] % % [p = 6,p = 1,matches = [[1,7],[2,9],[3,8],[4,4],[5,6],[6,5],[7,1],[8,3],[9,2]]] % [p = 6,p = 2,matches = [[1,6],[2,5],[3,4],[4,3],[5,2],[6,1],[7,8],[8,7],[9,9]]] % [t = 6,t = 3,matches = [[1,5],[2,4],[3,3],[4,2],[5,1],[6,9],[7,8],[8,7],[9,6]]] % [p = 6,p = 4,matches = [[1,7],[2,8],[3,9],[4,2],[5,3],[6,1],[7,5],[8,6],[9,4]]] % [t = 6,t = 4,matches = [[1,3],[2,4],[3,5],[4,6],[5,7],[6,8],[7,9],[8,1],[9,2]]] % [t = 6,p = 5,matches = [[1,8],[2,9],[3,1],[4,2],[5,3],[6,4],[7,5],[8,6],[9,7]]] % [p = 6,t = 5,matches = [[1,6],[2,4],[3,5],[4,9],[5,7],[6,8],[7,1],[8,2],[9,3]]] % [t = 6,p = 7,matches = [[1,4],[2,3],[3,2],[4,1],[5,9],[6,8],[7,7],[8,6],[9,5]]] % [t = 6,p = 8,matches = [[1,6],[2,5],[3,4],[4,3],[5,2],[6,1],[7,9],[8,8],[9,7]]] % [p = 6,p = 9,matches = [[1,1],[2,3],[3,2],[4,9],[5,8],[6,7],[7,6],[8,5],[9,4]]] % % [t = 7,p = 3,matches = [[1,9],[2,7],[3,8],[4,1],[5,2],[6,3],[7,4],[8,5],[9,6]]] % [p = 7,t = 3,matches = [[1,2],[2,3],[3,4],[4,5],[5,6],[6,7],[7,8],[8,9],[9,1]]] % [p = 7,t = 4,matches = [[1,6],[2,5],[3,4],[4,3],[5,2],[6,1],[7,9],[8,8],[9,7]]] % [p = 7,p = 5,matches = [[1,2],[2,1],[3,9],[4,8],[5,7],[6,6],[7,5],[8,4],[9,3]]] % [p = 7,t = 6,matches = [[1,4],[2,3],[3,2],[4,1],[5,9],[6,8],[7,7],[8,6],[9,5]]] % [p = 7,p = 8,matches = [[1,3],[2,4],[3,5],[4,6],[5,7],[6,8],[7,9],[8,1],[9,2]]] % [t = 7,t = 8,matches = [[1,6],[2,4],[3,5],[4,9],[5,7],[6,8],[7,1],[8,2],[9,3]]] % % [t = 8,p = 3,matches = [[1,4],[2,5],[3,6],[4,7],[5,8],[6,9],[7,2],[8,3],[9,1]]] % [p = 8,t = 3,matches = [[1,9],[2,1],[3,2],[4,3],[5,4],[6,5],[7,6],[8,7],[9,8]]] % [p = 8,t = 4,matches = [[1,8],[2,7],[3,6],[4,5],[5,4],[6,3],[7,2],[8,1],[9,9]]] % [p = 8,p = 5,matches = [[1,4],[2,3],[3,2],[4,1],[5,9],[6,8],[7,7],[8,6],[9,5]]] % [p = 8,t = 6,matches = [[1,6],[2,5],[3,4],[4,3],[5,2],[6,1],[7,9],[8,8],[9,7]]] % [p = 8,p = 7,matches = [[1,8],[2,9],[3,1],[4,2],[5,3],[6,4],[7,5],[8,6],[9,7]]] % [t = 8,t = 7,matches = [[1,7],[2,8],[3,9],[4,2],[5,3],[6,1],[7,5],[8,6],[9,4]]] % % [p = 9,p = 1,matches = [[1,7],[2,8],[3,9],[4,2],[5,3],[6,1],[7,5],[8,6],[9,4]]] % [t = 9,t = 1,matches = [[1,8],[2,9],[3,1],[4,2],[5,3],[6,4],[7,5],[8,6],[9,7]]] % [p = 9,p = 2,matches = [[1,6],[2,4],[3,5],[4,9],[5,7],[6,8],[7,1],[8,2],[9,3]]] % [t = 9,t = 2,matches = [[1,3],[2,4],[3,5],[4,6],[5,7],[6,8],[7,9],[8,1],[9,2]]] % [p = 9,p = 4,matches = [[1,7],[2,9],[3,8],[4,4],[5,6],[6,5],[7,1],[8,3],[9,2]]] % [p = 9,t = 5,matches = [[1,6],[2,5],[3,4],[4,3],[5,2],[6,1],[7,8],[8,7],[9,9]]] % [p = 9,p = 6,matches = [[1,1],[2,3],[3,2],[4,9],[5,8],[6,7],[7,6],[8,5],[9,4]]] % [numInstanceMatches = 72,numTests = 307,0.234528] % % I.e. of all the 307 tests (including transposes) only 72 (~23%) results in a full match % of permutations of all rows. % % % Let's take this further and check the different permutation patterns. % % Permutation patterns: % Note that there is a huge number of redundancy here: % p=I,t=J is really the same symmetry t=I,p=J % % m = [[1,1],[2,3],[3,2],[4,9],[5,8],[6,7],[7,6],[8,5],[9,4]] % val = [[p = 1,t = 5],[p = 2,p = 4],[p = 4,p = 2],[t = 5,p = 1],[p = 6,p = 9],[p = 9,p = 6]] % % m = [[1,2],[2,1],[3,9],[4,8],[5,7],[6,6],[7,5],[8,4],[9,3]] % val = [[p = 5,p = 7],[p = 7,p = 5]] % % m = [[1,2],[2,3],[3,4],[4,5],[5,6],[6,7],[7,8],[8,9],[9,1]] % val = [[t = 3,p = 8],[p = 7,t = 3]] % % m = [[1,3],[2,2],[3,1],[4,9],[5,8],[6,7],[7,6],[8,5],[9,4]] % val = [[t = 3,p = 5],[p = 5,t = 3]] % % m = [[1,3],[2,4],[3,5],[4,6],[5,7],[6,8],[7,9],[8,1],[9,2]] % val = [[t = 1,t = 9],[p = 5,t = 6],[t = 6,t = 4],[p = 7,p = 8],[t = 9,t = 2]] % % m = [[1,4],[2,3],[3,2],[4,1],[5,9],[6,8],[7,7],[8,6],[9,5]] % val = [[p = 5,p = 8],[t = 6,p = 7],[p = 7,t = 6],[p = 8,p = 5]] % % m = [[1,4],[2,5],[3,6],[4,7],[5,8],[6,9],[7,2],[8,3],[9,1]] % val = [[p = 3,t = 7],[t = 8,p = 3]] % % m = [[1,5],[2,4],[3,3],[4,2],[5,1],[6,9],[7,8],[8,7],[9,6]] % val = [[t = 3,t = 6],[t = 6,t = 3]] % % m = [[1,5],[2,4],[3,6],[4,2],[5,1],[6,3],[7,7],[8,9],[9,8]] % val = [[p = 1,p = 4],[p = 4,p = 1]] % % m = [[1,5],[2,6],[3,4],[4,8],[5,9],[6,7],[7,3],[8,1],[9,2]] % val = [[p = 2,p = 1],[t = 5,p = 4]] % % m = [[1,5],[2,6],[3,7],[4,8],[5,9],[6,1],[7,2],[8,3],[9,4]] % val = [[t = 1,t = 2],[p = 5,t = 4]] % % m = [[1,6],[2,4],[3,5],[4,9],[5,7],[6,8],[7,1],[8,2],[9,3]] % val = [[p = 1,p = 9],[p = 4,p = 6],[p = 6,t = 5],[t = 7,t = 8],[p = 9,p = 2]] % % m = [[1,6],[2,5],[3,4],[4,3],[5,2],[6,1],[7,8],[8,7],[9,9]] % val = [[p = 2,p = 6],[t = 5,p = 9],[p = 6,p = 2],[p = 9,t = 5]] % % m = [[1,6],[2,5],[3,4],[4,3],[5,2],[6,1],[7,9],[8,8],[9,7]] % val = [[t = 4,p = 7],[t = 6,p = 8],[p = 7,t = 4],[p = 8,t = 6]] % % m = [[1,6],[2,7],[3,8],[4,9],[5,1],[6,2],[7,3],[8,4],[9,5]] % val = [[t = 2,t = 1],[t = 4,p = 5]] % % m = [[1,7],[2,6],[3,5],[4,4],[5,3],[6,2],[7,1],[8,9],[9,8]] % val = [[t = 3,t = 4],[t = 4,t = 3]] % % m = [[1,7],[2,8],[3,9],[4,2],[5,3],[6,1],[7,5],[8,6],[9,4]] % val = [[p = 2,p = 9],[t = 5,p = 6],[p = 6,p = 4],[t = 8,t = 7],[p = 9,p = 1]] % % m = [[1,7],[2,9],[3,8],[4,4],[5,6],[6,5],[7,1],[8,3],[9,2]] % val = [[p = 1,p = 6],[p = 4,p = 9],[p = 6,p = 1],[p = 9,p = 4]] % % m = [[1,8],[2,7],[3,6],[4,5],[5,4],[6,3],[7,2],[8,1],[9,9]] % val = [[t = 4,p = 8],[p = 8,t = 4]] % % m = [[1,8],[2,7],[3,9],[4,5],[5,4],[6,6],[7,2],[8,1],[9,3]] % val = [[p = 2,t = 5],[t = 5,p = 2]] % % m = [[1,8],[2,9],[3,1],[4,2],[5,3],[6,4],[7,5],[8,6],[9,7]] % val = [[t = 2,t = 9],[t = 4,t = 6],[t = 6,p = 5],[p = 8,p = 7],[t = 9,t = 1]] % % m = [[1,8],[2,9],[3,7],[4,3],[5,1],[6,2],[7,6],[8,4],[9,5]] % val = [[p = 1,p = 2],[p = 4,t = 5]] % % m = [[1,9],[2,1],[3,2],[4,3],[5,4],[6,5],[7,6],[8,7],[9,8]] % val = [[t = 3,p = 7],[p = 8,t = 3]] % % m = [[1,9],[2,7],[3,8],[4,1],[5,2],[6,3],[7,4],[8,5],[9,6]] % val = [[p = 3,t = 8],[t = 7,p = 3]] % % permutationPatternCount = 25 % % One can note that the permutation patterns that involves the most instances is % % m = [[1,1],[2,3],[3,2],[4,9],[5,8],[6,7],[7,6],[8,5],[9,4]] % val = [[p = 1,t = 5],[p = 2,p = 4],[p = 4,p = 2],[t = 5,p = 1],[p = 6,p = 9],[p = 9,p = 6]] % % The instances involved are: % 1,2,4,5,6,9 % % i.e. not 3,7,8 % go ?=> InstanceMatches = [], PermutationMap = new_map(), instances(Instances), %% print the instances % CC = 1, % foreach(C in Instances) % printf("%% CC: %d\n", CC), % foreach(Row in C) println(Row) end, % CC := CC + 1, % nl % end, N=9, NumTests := 1, foreach(I in 1..N, J in 1..N) println('CHECKING'=[I,J]), println(plainI), if I != J then % Don't compare same instance NumTests := NumTests + 1, check_permutation(Instances[I],p,Instances[J],p,Counts,Matches), if Counts >= 4 then InstanceMatches := InstanceMatches ++ [[p=I,p=J,matches=Matches]], PermutationMap.put(Matches,PermutationMap.get(Matches,[])++[[p=I,p=J]]) end end, println(transposeOfI), check_permutation(Instances[I].transpose,t,Instances[J],p,Counts2,Matches2), NumTests := NumTests + 1, % println(counts2=Counts2), if Counts2 >= 4 then InstanceMatches := InstanceMatches ++ [[t=I,p=J,matches=Matches2]], PermutationMap.put(Matches2,PermutationMap.get(Matches2,[])++[[t=I,p=J]]) end, if I != J then % Don't compare transposes of same instance println(transposeOfIJ), check_permutation(Instances[I].transpose,t,Instances[J].transpose,t,Counts3,Matches3), NumTests := NumTests + 1, if Counts3 >= 4 then InstanceMatches := InstanceMatches ++ [[t=I,t=J,matches=Matches3]], PermutationMap.put(Matches3,PermutationMap.get(Matches3,[])++[[t=I,t=J]]) end end, nl, println(plainItransposeOfJ), check_permutation(Instances[I],p,Instances[J].transpose,t,Counts4,Matches4), NumTests := NumTests + 1, % println(counts2=Counts2), if Counts4 >= 4 then InstanceMatches := InstanceMatches ++ [[p=I,t=J,matches=Matches4]], PermutationMap.put(Matches4,PermutationMap.get(Matches4,[])++[[p=I,t=J]]) end, nl end, println("Instance matches:"), foreach(IM in InstanceMatches) println(IM) end, NumInstanceMatches=InstanceMatches.len, println([numInstanceMatches=NumInstanceMatches, numTests=NumTests,to_fstring("%03f", NumInstanceMatches/NumTests)]), println("\nPermutation patterns:"), PCount = 1, foreach(M in PermutationMap.keys.sort) println(m=M), Val = PermutationMap.get(M), println(val=Val), nl, PCount := PCount + 1 end, println(permutationPatternCount=PCount), nl. go => true. check_permutation(S1,T1,S2,T2,Counts1,Matches1) => % println(s1=S1), % println(s2=S2), N = 9, Counts = 0, Matches = [], foreach(I in 1..N, J in 1..N) if S1[I] == S2[J] then % println(match=[I,J]), Matches := Matches ++ [[I,J]], % println(s1I=S1[I]), % println(s2J=S2[J]), Counts := Counts + 1 end end, % println(counts=Counts), if Counts >= 8 then % println("FULL MATCH!"), println(row_matches=[T1,T2]=Matches) end, Matches1 = Matches, Counts1 = Counts. % % Here are the 9 instances from miracle_sudoku.pi go6/0 % which I will further analyse. % NOTE: The instance number is not the same as in the comment of miracle_sudoku.pi go/6. % % CC: 1 % [3,7,2,6,1,5,9,4,8] % [9,4,8,3,7,2,6,1,5] % [6,1,5,9,4,8,3,7,2] % [8,3,7,2,6,1,5,9,4] % [5,9,4,8,3,7,2,6,1] % [2,6,1,5,9,4,8,3,7] % [4,8,3,7,2,6,1,5,9] % [1,5,9,4,8,3,7,2,6] % [7,2,6,1,5,9,4,8,3] % % CC: 2 % [5,9,4,8,3,7,2,6,1] % [2,6,1,5,9,4,8,3,7] % [8,3,7,2,6,1,5,9,4] % [1,5,9,4,8,3,7,2,6] % [7,2,6,1,5,9,4,8,3] % [4,8,3,7,2,6,1,5,9] % [6,1,5,9,4,8,3,7,2] % [3,7,2,6,1,5,9,4,8] % [9,4,8,3,7,2,6,1,5] % % CC: 3 % [2,7,3,8,4,9,5,1,6] % [5,1,6,2,7,3,8,4,9] % [8,4,9,5,1,6,2,7,3] % [6,2,7,3,8,4,9,5,1] % [9,5,1,6,2,7,3,8,4] % [3,8,4,9,5,1,6,2,7] % [1,6,2,7,3,8,4,9,5] % [4,9,5,1,6,2,7,3,8] % [7,3,8,4,9,5,1,6,2] % % CC: 4 % [5,9,4,8,3,7,2,6,1] % [8,3,7,2,6,1,5,9,4] % [2,6,1,5,9,4,8,3,7] % [9,4,8,3,7,2,6,1,5] % [3,7,2,6,1,5,9,4,8] % [6,1,5,9,4,8,3,7,2] % [4,8,3,7,2,6,1,5,9] % [7,2,6,1,5,9,4,8,3] % [1,5,9,4,8,3,7,2,6] % % CC: 5 % [3,6,9,7,1,4,2,5,8] % [7,1,4,2,5,8,6,9,3] % [2,5,8,6,9,3,1,4,7] % [6,9,3,1,4,7,5,8,2] % [1,4,7,5,8,2,9,3,6] % [5,8,2,9,3,6,4,7,1] % [9,3,6,4,7,1,8,2,5] % [4,7,1,8,2,5,3,6,9] % [8,2,5,3,6,9,7,1,4] % % CC: 6 % [4,8,3,7,2,6,1,5,9] % [7,2,6,1,5,9,4,8,3] % [1,5,9,4,8,3,7,2,6] % [8,3,7,2,6,1,5,9,4] % [2,6,1,5,9,4,8,3,7] % [5,9,4,8,3,7,2,6,1] % [3,7,2,6,1,5,9,4,8] % [6,1,5,9,4,8,3,7,2] % [9,4,8,3,7,2,6,1,5] % % CC: 7 % [7,1,4,2,5,8,6,9,3] % [3,6,9,7,1,4,2,5,8] % [8,2,5,3,6,9,7,1,4] % [4,7,1,8,2,5,3,6,9] % [9,3,6,4,7,1,8,2,5] % [5,8,2,9,3,6,4,7,1] % [1,4,7,5,8,2,9,3,6] % [6,9,3,1,4,7,5,8,2] % [2,5,8,6,9,3,1,4,7] % % CC: 8 % [6,9,3,1,4,7,5,8,2] % [2,5,8,6,9,3,1,4,7] % [7,1,4,2,5,8,6,9,3] % [3,6,9,7,1,4,2,5,8] % [8,2,5,3,6,9,7,1,4] % [4,7,1,8,2,5,3,6,9] % [9,3,6,4,7,1,8,2,5] % [5,8,2,9,3,6,4,7,1] % [1,4,7,5,8,2,9,3,6] % % CC: 9 % [4,8,3,7,2,6,1,5,9] % [1,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