• Welcome to the Speedsolving.com, home of the web's largest puzzle community!
    You are currently viewing our forum as a guest which gives you limited access to join discussions and access our other features.

    Registration is fast, simple and absolutely free so please, join our community of 40,000+ people from around the world today!

    If you are already a member, simply login to hide this message and begin participating in the community!

Announcing: New 4x4x4 Brute Force Solver

Status
Not open for further replies.

cuBerBruce

Member
Joined
Oct 8, 2006
Messages
914
Location
Malden, MA, USA
WCA
2006NORS01
YouTube
Visit Channel
I just ran a solve for the case of 2 centers missing from 2 adjacent faces.
Technically, each of the sequences you found are two 3-cycles rather than two swaps, as is clear when I execute these sequence in GAP:
Code:
gap> U*F3*D2*B2*l3*B2*D2*F2*r3*F3*U3;
(6,38,11)(7,39,10)
gap> U*F3*l3*F2*D2*B2*r3*B2*D2*F3*U3;
(6,38,11)(7,39,10)
The fact that some pieces are indistinguishable give the appearance of simple swaps.

And, is there an algo for doing 2 simultaneous center swaps?
I am not totally clear what you want. In terms of swapping all 4 center pieces on one face with those of another face, there is r2 f2 b2 r2 f2 b2. This swaps among opposite faces, and is actually 4 swaps as one might expect (with no hidden swaps or other hidden cycles). For 2 adjacent faces my solver gives:
Code:
Enter: 5uffuuff5u/8l8l/5f2u2f2u5f/8r8r/8b8b/8d8d
distance  1   node count          0   solved state checks          0
distance  2   node count          0   solved state checks          0
distance  3   node count          0   solved state checks          0
distance  4   node count          0   solved state checks          0
distance  5   node count        546   solved state checks          0
distance  6   node count      12792   solved state checks        240
distance  7   node count     220407   solved state checks      12336
distance  8   node count    5646369   solved state checks    1237992
distance  9   node count   57603123   solved state checks    7497474
Found solution: [10]  l  U2 B2 D2 l  r  D2 B2 U2 r
Found solution: [10]  l  D2 B2 U2 l  r  U2 B2 D2 r
Found solution: [10]  l' F2 D2 B2 l' r' B2 D2 F2 r'
Found solution: [10]  l' B2 D2 F2 l' r' F2 D2 B2 r'
Found solution: [10]  r  F2 D2 B2 l  r  B2 D2 F2 l
Found solution: [10]  r  B2 D2 F2 l  r  F2 D2 B2 l
Found solution: [10]  r' U2 B2 D2 l' r' D2 B2 U2 l'
Found solution: [10]  r' D2 B2 U2 l' r' U2 B2 D2 l'
distance 10   node count  881587164   solved state checks  138793824
These are also 4 swaps and no other hidden cycles.

I also tried "swapping" individual center pieces among 4 faces, thinking I might get 2 swaps, but still ended up with double 3-cycles. (A couple solutions also changed the orientation of the cube.)
Code:
Enter: 5uf2u8u/8l2ld5l/5fu2f8f/8r8r/8b8b/8d2dl5d
distance  1   node count          0   solved state checks          0
distance  2   node count          0   solved state checks          0
distance  3   node count          0   solved state checks          0
distance  4   node count          0   solved state checks          0
distance  5   node count        177   solved state checks          0
distance  6   node count       8400   solved state checks       1782
distance  7   node count      62994   solved state checks       2403
distance  8   node count    2210466   solved state checks     493524
distance  9   node count   23569581   solved state checks    2312484
distance 10   node count  500716785   solved state checks   72125880
Found solution: [11]  U  u' L' f  r2 f  r2 f2 L  U' u
Found solution: [11]  U  d' F' l  b2 l  b2 l2 F  U' d
Found solution: [11]  U  d' F' l  b2 l  b2 l2 F  u  D'
Found solution: [11]  u' D  R' f  l2 f  l2 f2 R  U' d
Found solution: [11]  u' D  R' f  l2 f  l2 f2 R  u  D'
Found solution: [11]  u' L' U  f  r2 f  r2 f2 U' L  u
Found solution: [11]  u' R' D  f  l2 f  l2 f2 D' R  u
Found solution: [11]  D  d' B' l2 f2 l' f2 l' B  D' d
Found solution: [11]  d' l' D  l' f2 l' f2 l2 D' l  d
Found solution: [11]  d' r' B  l' d2 l' d2 l2 B' r  d
Found solution: [11]  d' F' U  l  b2 l  b2 l2 U' F  d
Found solution: [11]  d' B' D  l2 f2 l' f2 l' D' B  d
distance 11   node count 3033266855   solved state checks  594172323
 
Last edited:

unsolved

Member
Joined
Mar 2, 2014
Messages
566
Location
Doylestown, PA
Technically, each of the sequences you found are two 3-cycles rather than two swaps, as is clear when I execute these sequence in GAP

And what is GAP?

The fact that some pieces are indistinguishable give the appearance of simple swaps.

Ooooooh, I see. I thought the optimal algo for one center swap across adjacent faces was 8-plies, so I was surprised to see 2 being swapped in only 11 total.


I am not totally clear what you want.

Mostly I am just testing my code under the one of the lesser-known Hippocratic Oath sayings: "Don't make the patient worse." :) Just making sure the TFS databases I am recoding as matrix-case statement-for loop implementations have no errors in them, nor are there any "missing entries," and so on. I am just creating every position/orientation where the U face needs 2 centers to be solved, ditto for the F face.

In terms of swapping all 4 center pieces on one face with those of another face, there is r2 f2 b2 r2 f2 b2.

I can remember doing that back in 1984 :)

Code:
Found solution: [10]  l  U2 B2 D2 l  r  D2 B2 U2 r

I just did this on my cube here, but I thought your first "l" was just an ASCII pipe, so I applied U2 B2 D2 l r D2 B2 U2 r without the without the first "l", and was pleasantly surprised when I could (fortunately) just apply it at the end.
But that misapplied version of the algo swaps just 2 centers in that case.

Code:
Found solution: [11]  U  u' L' f  r2 f  r2 f2 L  U' u

Now that is cool! I'll have to set that up on a test run a little later.

And here's my "scare moment" of the day:

test4_bug.jpg


Solution [1] finds a 3-TFS solution @ depth 6.
Solution [2] finds a 2-TFS solution @ depth 7, which you expect. By definition, there must be one solution of "distance - 1" when you find a turns-from-solved database solution from the previous iteration.

But now look at Solution [3].

It's back in the 3-TFS database just one node away from the 2-FTS solution just encountered. And the next node is also a 3-TFS solution.

Naturally, I thought this meant I had a bug in my code....

But if you do the listed scramble at the top, you can see that all of the enumerated solutions are correct in the announcement of their turn-lengths.

:D

And here is some code that can be compiled to use the 2-TFS database. It should recognize every possible solution that is either 1 or 2 moves from being solved. Not very useful stand alone, but it can reduce the number of nodes you have to probe by a factor of 1026 since it finds solutions 2 plies sooner than a nominal search could.

Code:
// sample_4x4x4_program_for_4x4x4_paper.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"


#define MAX_DEPTH 24

#define UNSOLVED (-1)
#define ALREADY_SOLVED (0)
#define SOLVED_IN_1_MORE_MOVE (1)
#define SOLVED_IN_2_MORE_MOVES (2)

#define TOP_INDEX 1
#define FRONT_INDEX 2
#define RIGHT_INDEX 3
#define BOTTOM_INDEX 4
#define BACK_INDEX 5
#define LEFT_INDEX 6

#define CONSTANT_TOP 1
#define CONSTANT_FRONT 3
#define CONSTANT_RIGHT 5
#define CONSTANT_BOTTOM 7
#define CONSTANT_BACK 11
#define CONSTANT_LEFT 13

#define TOP_IS_SOLVED 16
#define FRONT_IS_SOLVED 48
#define RIGHT_IS_SOLVED 80
#define BOTTOM_IS_SOLVED 112
#define BACK_IS_SOLVED 176
#define LEFT_IS_SOLVED 208

typedef struct cube_4x4x4_arrangement
{
	unsigned char cube_top[16];
	unsigned char cube_bottom[16];
	unsigned char cube_front[16];
	unsigned char cube_back[16];
	unsigned char cube_right[16];
	unsigned char cube_left[16];
}
CUBE_4x4_ARRANGEMENT, *CUBE_4x4_ARRANGEMENT_PTR;

CUBE_4x4_ARRANGEMENT global_4x4x4_array_cube;

unsigned short GLOBAL_SEARCH_EXTENSIONS_ON = 1;
unsigned short GLOBAL_PROBE_TFS_1_DATABASE = 1;
unsigned short GLOBAL_PROBE_TFS_2_DATABASE = 1;

unsigned long long GLOBAL_TFS_1_DATABASE_PROBES;
unsigned long long GLOBAL_TFS_2_DATABASE_PROBES;

unsigned short GLOBAL_CUBE_SOLUTION[MAX_DEPTH] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};

unsigned long TFS_01_ARRAY_INDEX = 0;
unsigned short GLOBAL_TFS_01_DATABASE[864] = {1111, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 1551, 1551, 1551, 1551, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 2552, 2552, 2552, 2552, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 4554, 4554, 4554, 4554, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 5555, 4444, 4444, 4444, 4444, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 2222, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 5555, 3333, 3333, 3333, 6666, 4444, 4444, 4444, 4444, 5555, 5555, 5555, 2222, 6666, 6666, 6666, 3333, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 6666, 3333, 3333, 3333, 2222, 4444, 4444, 4444, 4444, 5555, 5555, 5555, 3333, 6666, 6666, 6666, 5555, 
1111, 1111, 1111, 1111, 2222, 2222, 3333, 2222, 3333, 3333, 5555, 3333, 4444, 4444, 4444, 4444, 5555, 5555, 6666, 5555, 6666, 6666, 2222, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 5555, 2222, 3333, 3333, 6666, 3333, 4444, 4444, 4444, 4444, 5555, 5555, 2222, 5555, 6666, 6666, 3333, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 6666, 2222, 3333, 3333, 2222, 3333, 4444, 4444, 4444, 4444, 5555, 5555, 3333, 5555, 6666, 6666, 5555, 6666, 
1111, 1111, 1111, 1111, 2222, 3333, 2222, 2222, 3333, 5555, 3333, 3333, 4444, 4444, 4444, 4444, 5555, 6666, 5555, 5555, 6666, 2222, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 5555, 2222, 2222, 3333, 6666, 3333, 3333, 4444, 4444, 4444, 4444, 5555, 2222, 5555, 5555, 6666, 3333, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 6666, 2222, 2222, 3333, 2222, 3333, 3333, 4444, 4444, 4444, 4444, 5555, 3333, 5555, 5555, 6666, 5555, 6666, 6666, 
1111, 1111, 1111, 1111, 3333, 2222, 2222, 2222, 5555, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 6666, 5555, 5555, 5555, 2222, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 5555, 2222, 2222, 2222, 6666, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 2222, 5555, 5555, 5555, 3333, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 6666, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 3333, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 
1111, 1111, 1111, 3333, 2222, 2222, 2222, 2222, 4334, 4334, 4334, 4334, 6666, 4444, 4444, 4444, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 4444, 2222, 2222, 2222, 2222, 6336, 6336, 6336, 6336, 1111, 4444, 4444, 4444, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 6666, 2222, 2222, 2222, 2222, 1331, 1331, 1331, 1331, 3333, 4444, 4444, 4444, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
1111, 1111, 3333, 1111, 2222, 2222, 2222, 2222, 3433, 3433, 3433, 3433, 4444, 6666, 4444, 4444, 5555, 5555, 5555, 5555, 6616, 6616, 6616, 6616, 
1111, 1111, 4444, 1111, 2222, 2222, 2222, 2222, 3633, 3633, 3633, 3633, 4444, 1111, 4444, 4444, 5555, 5555, 5555, 5555, 6636, 6636, 6636, 6636, 
1111, 1111, 6666, 1111, 2222, 2222, 2222, 2222, 3133, 3133, 3133, 3133, 4444, 3333, 4444, 4444, 5555, 5555, 5555, 5555, 6646, 6646, 6646, 6646, 
1111, 3333, 1111, 1111, 2222, 2222, 2222, 2222, 3343, 3343, 3343, 3343, 4444, 4444, 6666, 4444, 5555, 5555, 5555, 5555, 6166, 6166, 6166, 6166, 
1111, 4444, 1111, 1111, 2222, 2222, 2222, 2222, 3363, 3363, 3363, 3363, 4444, 4444, 1111, 4444, 5555, 5555, 5555, 5555, 6366, 6366, 6366, 6366, 
1111, 6666, 1111, 1111, 2222, 2222, 2222, 2222, 3313, 3313, 3313, 3313, 4444, 4444, 3333, 4444, 5555, 5555, 5555, 5555, 6466, 6466, 6466, 6466, 
1121, 1121, 1121, 1121, 2242, 2242, 2242, 2242, 3333, 3333, 3333, 3333, 4454, 4454, 4454, 4454, 5155, 5155, 5155, 5155, 6666, 6666, 6666, 6666, 
1141, 1141, 1141, 1141, 2252, 2252, 2252, 2252, 3333, 3333, 3333, 3333, 4414, 4414, 4414, 4414, 5255, 5255, 5255, 5255, 6666, 6666, 6666, 6666, 
1151, 1151, 1151, 1151, 2212, 2212, 2212, 2212, 3333, 3333, 3333, 3333, 4424, 4424, 4424, 4424, 5455, 5455, 5455, 5455, 6666, 6666, 6666, 6666, 
1211, 1211, 1211, 1211, 2422, 2422, 2422, 2422, 3333, 3333, 3333, 3333, 4544, 4544, 4544, 4544, 5515, 5515, 5515, 5515, 6666, 6666, 6666, 6666, 
1411, 1411, 1411, 1411, 2522, 2522, 2522, 2522, 3333, 3333, 3333, 3333, 4144, 4144, 4144, 4144, 5525, 5525, 5525, 5525, 6666, 6666, 6666, 6666, 
1511, 1511, 1511, 1511, 2122, 2122, 2122, 2122, 3333, 3333, 3333, 3333, 4244, 4244, 4244, 4244, 5545, 5545, 5545, 5545, 6666, 6666, 6666, 6666, 
2112, 2112, 2112, 2112, 4224, 4224, 4224, 4224, 3333, 3333, 3333, 3333, 5445, 5445, 5445, 5445, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
3333, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 6666, 5555, 5555, 5555, 5555, 1661, 1661, 1661, 1661, 
4114, 4114, 4114, 4114, 5225, 5225, 5225, 5225, 3333, 3333, 3333, 3333, 1441, 1441, 1441, 1441, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
4444, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 1111, 5555, 5555, 5555, 5555, 3663, 3663, 3663, 3663, 
5115, 5115, 5115, 5115, 1221, 1221, 1221, 1221, 3333, 3333, 3333, 3333, 2442, 2442, 2442, 2442, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
6666, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 3333, 5555, 5555, 5555, 5555, 4664, 4664, 4664, 4664};


unsigned long TFS_02_ARRAY_INDEX = 0;
unsigned short GLOBAL_TFS_02_DATABASE[24624] = {1111, 1111, 1111, 1111, 2222, 1551, 2222, 2222, 3333, 6666, 3333, 3333, 4444, 4444, 4444, 4444, 1551, 2222, 1551, 1551, 6666, 3333, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 1551, 2222, 3333, 3333, 6666, 3333, 4444, 4444, 4444, 4444, 1551, 1551, 2222, 1551, 6666, 6666, 3333, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 1551, 3333, 3333, 3333, 6666, 5445, 5445, 5445, 5445, 1551, 1551, 1551, 2222, 6666, 6666, 6666, 3333, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 2552, 3333, 3333, 3333, 6666, 1441, 1441, 1441, 1441, 2552, 2552, 2552, 2222, 6666, 6666, 6666, 3333, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 1551, 5555, 4444, 4444, 4444, 1551, 1551, 1551, 6666, 6666, 6666, 6666, 2222, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 2552, 1111, 4444, 4444, 4444, 2552, 2552, 2552, 6666, 6666, 6666, 6666, 2222, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 4554, 4554, 4554, 4664, 6666, 6666, 6666, 2222, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 4554, 2222, 4444, 4444, 4444, 4554, 4554, 4554, 6666, 6666, 6666, 6666, 2222, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 3333, 5335, 5335, 5335, 5335, 4444, 4444, 4444, 4444, 1551, 1551, 1551, 1661, 6666, 6666, 6666, 2222, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 3333, 5555, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 3553, 2552, 2552, 2662, 6666, 6666, 6666, 2222, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 4554, 3333, 3333, 3333, 6666, 2442, 2442, 2442, 2442, 4554, 4554, 4554, 2222, 6666, 6666, 6666, 3333, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 5555, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 4554, 4554, 4554, 4224, 6666, 6666, 6666, 3333, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 5555, 6336, 6336, 6336, 6336, 4444, 4444, 4444, 4444, 1551, 1551, 1551, 1221, 6666, 6666, 6666, 3333, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 5555, 6666, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 5555, 2552, 2552, 2222, 6666, 6666, 6666, 3333, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 6666, 2222, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 6556, 2552, 2552, 2332, 6666, 6666, 6666, 5555, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 6666, 2332, 2332, 2332, 2332, 4444, 4444, 4444, 4444, 1551, 1551, 1551, 1331, 6666, 6666, 6666, 5555, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 6666, 3333, 3333, 3333, 2222, 4444, 4444, 4444, 1111, 2552, 2552, 2552, 3333, 6666, 6666, 6666, 2552, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 6666, 3333, 3333, 3333, 2222, 4444, 4444, 4444, 2222, 4554, 4554, 4554, 3333, 6666, 6666, 6666, 4554, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 6666, 3333, 3333, 3333, 2222, 4444, 4444, 4444, 5555, 1551, 1551, 1551, 3333, 6666, 6666, 6666, 1551, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 6666, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 4554, 4554, 4554, 4334, 6666, 6666, 6666, 5555, 
1111, 1111, 1111, 1111, 2222, 2222, 2552, 2222, 3333, 3333, 6666, 3333, 4444, 4444, 4444, 4444, 2552, 2552, 2222, 2552, 6666, 6666, 3333, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 3333, 2222, 3333, 3333, 1551, 3333, 4444, 4444, 4444, 4444, 1551, 1551, 6666, 1551, 6666, 6666, 2222, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 3333, 2222, 3333, 3333, 2552, 3333, 4444, 4444, 4444, 4444, 2552, 2552, 6666, 2552, 6666, 6666, 2222, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 3333, 2222, 3333, 3333, 4554, 3333, 4444, 4444, 4444, 4444, 4554, 4554, 6666, 4554, 6666, 6666, 2222, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 3333, 2222, 3333, 5555, 3333, 3333, 4444, 4444, 4444, 4444, 2552, 3553, 2662, 2552, 6666, 6666, 2222, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 3333, 2222, 3353, 3353, 3353, 3353, 4444, 4444, 4444, 4444, 4554, 4554, 4664, 4554, 6666, 6666, 2222, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 3333, 2222, 3533, 3533, 3533, 3533, 4444, 4444, 4444, 4444, 1551, 1551, 1661, 1551, 6666, 6666, 2222, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 3333, 3333, 3333, 3333, 5555, 5555, 4444, 4444, 4444, 4444, 5555, 5555, 6666, 6666, 6666, 6666, 2222, 2222, 
1111, 1111, 1111, 1111, 2222, 2222, 3333, 5555, 3333, 3333, 5555, 6666, 4444, 4444, 4444, 4444, 5555, 5555, 6666, 2222, 6666, 6666, 2222, 3333, 
1111, 1111, 1111, 1111, 2222, 2222, 3333, 6666, 3333, 3333, 5555, 2222, 4444, 4444, 4444, 4444, 5555, 5555, 6666, 3333, 6666, 6666, 2222, 5555, 
1111, 1111, 1111, 1111, 2222, 2222, 4554, 2222, 3333, 3333, 6666, 3333, 4444, 4444, 4444, 4444, 4554, 4554, 2222, 4554, 6666, 6666, 3333, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 5555, 2222, 3333, 6666, 3333, 3333, 4444, 4444, 4444, 4444, 2552, 5555, 2222, 2552, 6666, 6666, 3333, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 5555, 2222, 3363, 3363, 3363, 3363, 4444, 4444, 4444, 4444, 4554, 4554, 4224, 4554, 6666, 6666, 3333, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 5555, 2222, 3633, 3633, 3633, 3633, 4444, 4444, 4444, 4444, 1551, 1551, 1221, 1551, 6666, 6666, 3333, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 5555, 3333, 3333, 3333, 6666, 5555, 4444, 4444, 4444, 4444, 5555, 5555, 2222, 6666, 6666, 6666, 3333, 2222, 
1111, 1111, 1111, 1111, 2222, 2222, 5555, 5555, 3333, 3333, 6666, 6666, 4444, 4444, 4444, 4444, 5555, 5555, 2222, 2222, 6666, 6666, 3333, 3333, 
1111, 1111, 1111, 1111, 2222, 2222, 5555, 6666, 3333, 3333, 6666, 2222, 4444, 4444, 4444, 4444, 5555, 5555, 2222, 3333, 6666, 6666, 3333, 5555, 
1111, 1111, 1111, 1111, 2222, 2222, 6666, 2222, 3233, 3233, 3233, 3233, 4444, 4444, 4444, 4444, 1551, 1551, 1331, 1551, 6666, 6666, 5555, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 6666, 2222, 3323, 3323, 3323, 3323, 4444, 4444, 4444, 4444, 4554, 4554, 4334, 4554, 6666, 6666, 5555, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 6666, 2222, 3333, 2222, 3333, 3333, 4444, 4444, 4444, 4444, 2552, 6556, 2332, 2552, 6666, 6666, 5555, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 6666, 2222, 3333, 3333, 2222, 3333, 4444, 4444, 4444, 4444, 1551, 1551, 3333, 1551, 6666, 6666, 1551, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 6666, 2222, 3333, 3333, 2222, 3333, 4444, 4444, 4444, 4444, 2552, 2552, 3333, 2552, 6666, 6666, 2552, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 6666, 2222, 3333, 3333, 2222, 3333, 4444, 4444, 4444, 4444, 4554, 4554, 3333, 4554, 6666, 6666, 4554, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 6666, 3333, 3333, 3333, 2222, 5555, 4444, 4444, 4444, 4444, 5555, 5555, 3333, 6666, 6666, 6666, 5555, 2222, 
1111, 1111, 1111, 1111, 2222, 2222, 6666, 5555, 3333, 3333, 2222, 6666, 4444, 4444, 4444, 4444, 5555, 5555, 3333, 2222, 6666, 6666, 5555, 3333, 
1111, 1111, 1111, 1111, 2222, 2222, 6666, 6666, 3333, 3333, 2222, 2222, 4444, 4444, 4444, 4444, 5555, 5555, 3333, 3333, 6666, 6666, 5555, 5555, 
1111, 1111, 1111, 1111, 2222, 2552, 2222, 2222, 3333, 6666, 3333, 3333, 4444, 4444, 4444, 4444, 2552, 2222, 2552, 2552, 6666, 3333, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 3333, 2222, 2222, 3333, 1551, 3333, 3333, 4444, 4444, 4444, 4444, 1551, 6666, 1551, 1551, 6666, 2222, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 3333, 2222, 2222, 3333, 2552, 3333, 3333, 4444, 4444, 4444, 4444, 2552, 6666, 2552, 2552, 6666, 2222, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 3333, 2222, 2222, 3333, 3333, 5555, 3333, 4444, 4444, 4444, 4444, 2552, 2662, 3553, 2552, 6666, 2222, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 3333, 2222, 2222, 3333, 4554, 3333, 3333, 4444, 4444, 4444, 4444, 4554, 6666, 4554, 4554, 6666, 2222, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 3333, 2222, 2222, 3353, 3353, 3353, 3353, 4444, 4444, 4444, 4444, 1551, 1661, 1551, 1551, 6666, 2222, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 3333, 2222, 2222, 3533, 3533, 3533, 3533, 4444, 4444, 4444, 4444, 4554, 4664, 4554, 4554, 6666, 2222, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 3333, 2222, 3333, 3333, 5555, 3333, 5555, 4444, 4444, 4444, 4444, 5555, 6666, 5555, 6666, 6666, 2222, 6666, 2222, 
1111, 1111, 1111, 1111, 2222, 3333, 2222, 5555, 3333, 5555, 3333, 6666, 4444, 4444, 4444, 4444, 5555, 6666, 5555, 2222, 6666, 2222, 6666, 3333, 
1111, 1111, 1111, 1111, 2222, 3333, 2222, 6666, 3333, 5555, 3333, 2222, 4444, 4444, 4444, 4444, 5555, 6666, 5555, 3333, 6666, 2222, 6666, 5555, 
1111, 1111, 1111, 1111, 2222, 3333, 3333, 2222, 3333, 5555, 5555, 3333, 4444, 4444, 4444, 4444, 5555, 6666, 6666, 5555, 6666, 2222, 2222, 6666, 
1111, 1111, 1111, 1111, 2222, 3333, 5555, 2222, 3333, 5555, 6666, 3333, 4444, 4444, 4444, 4444, 5555, 6666, 2222, 5555, 6666, 2222, 3333, 6666, 
1111, 1111, 1111, 1111, 2222, 3333, 6666, 2222, 3333, 5555, 2222, 3333, 4444, 4444, 4444, 4444, 5555, 6666, 3333, 5555, 6666, 2222, 5555, 6666, 
1111, 1111, 1111, 1111, 2222, 4554, 2222, 2222, 3333, 6666, 3333, 3333, 4444, 4444, 4444, 4444, 4554, 2222, 4554, 4554, 6666, 3333, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 5555, 2222, 2222, 3333, 3333, 6666, 3333, 4444, 4444, 4444, 4444, 2552, 2222, 5555, 2552, 6666, 3333, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 5555, 2222, 2222, 3363, 3363, 3363, 3363, 4444, 4444, 4444, 4444, 1551, 1221, 1551, 1551, 6666, 3333, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 5555, 2222, 2222, 3633, 3633, 3633, 3633, 4444, 4444, 4444, 4444, 4554, 4224, 4554, 4554, 6666, 3333, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 5555, 2222, 3333, 3333, 6666, 3333, 5555, 4444, 4444, 4444, 4444, 5555, 2222, 5555, 6666, 6666, 3333, 6666, 2222, 
1111, 1111, 1111, 1111, 2222, 5555, 2222, 5555, 3333, 6666, 3333, 6666, 4444, 4444, 4444, 4444, 5555, 2222, 5555, 2222, 6666, 3333, 6666, 3333, 
1111, 1111, 1111, 1111, 2222, 5555, 2222, 6666, 3333, 6666, 3333, 2222, 4444, 4444, 4444, 4444, 5555, 2222, 5555, 3333, 6666, 3333, 6666, 5555, 
1111, 1111, 1111, 1111, 2222, 5555, 3333, 2222, 3333, 6666, 5555, 3333, 4444, 4444, 4444, 4444, 5555, 2222, 6666, 5555, 6666, 3333, 2222, 6666, 
1111, 1111, 1111, 1111, 2222, 5555, 5555, 2222, 3333, 6666, 6666, 3333, 4444, 4444, 4444, 4444, 5555, 2222, 2222, 5555, 6666, 3333, 3333, 6666, 
1111, 1111, 1111, 1111, 2222, 5555, 6666, 2222, 3333, 6666, 2222, 3333, 4444, 4444, 4444, 4444, 5555, 2222, 3333, 5555, 6666, 3333, 5555, 6666, 
1111, 1111, 1111, 1111, 2222, 6666, 2222, 2222, 3233, 3233, 3233, 3233, 4444, 4444, 4444, 4444, 4554, 4334, 4554, 4554, 6666, 5555, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 6666, 2222, 2222, 3323, 3323, 3323, 3323, 4444, 4444, 4444, 4444, 1551, 1331, 1551, 1551, 6666, 5555, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 6666, 2222, 2222, 3333, 2222, 3333, 3333, 4444, 4444, 4444, 4444, 1551, 3333, 1551, 1551, 6666, 1551, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 6666, 2222, 2222, 3333, 2222, 3333, 3333, 4444, 4444, 4444, 4444, 2552, 3333, 2552, 2552, 6666, 2552, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 6666, 2222, 2222, 3333, 2222, 3333, 3333, 4444, 4444, 4444, 4444, 4554, 3333, 4554, 4554, 6666, 4554, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 6666, 2222, 2222, 3333, 3333, 2222, 3333, 4444, 4444, 4444, 4444, 2552, 2332, 6556, 2552, 6666, 5555, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 6666, 2222, 3333, 3333, 2222, 3333, 5555, 4444, 4444, 4444, 4444, 5555, 3333, 5555, 6666, 6666, 5555, 6666, 2222, 
1111, 1111, 1111, 1111, 2222, 6666, 2222, 5555, 3333, 2222, 3333, 6666, 4444, 4444, 4444, 4444, 5555, 3333, 5555, 2222, 6666, 5555, 6666, 3333, 
1111, 1111, 1111, 1111, 2222, 6666, 2222, 6666, 3333, 2222, 3333, 2222, 4444, 4444, 4444, 4444, 5555, 3333, 5555, 3333, 6666, 5555, 6666, 5555, 
1111, 1111, 1111, 1111, 2222, 6666, 3333, 2222, 3333, 2222, 5555, 3333, 4444, 4444, 4444, 4444, 5555, 3333, 6666, 5555, 6666, 5555, 2222, 6666, 
1111, 1111, 1111, 1111, 2222, 6666, 5555, 2222, 3333, 2222, 6666, 3333, 4444, 4444, 4444, 4444, 5555, 3333, 2222, 5555, 6666, 5555, 3333, 6666, 
1111, 1111, 1111, 1111, 2222, 6666, 6666, 2222, 3333, 2222, 2222, 3333, 4444, 4444, 4444, 4444, 5555, 3333, 3333, 5555, 6666, 5555, 5555, 6666, 
1111, 1111, 1111, 1111, 3333, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 1661, 1551, 1551, 1551, 2222, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 3333, 2222, 2222, 2222, 3333, 3333, 3333, 5555, 4444, 4444, 4444, 4444, 2662, 2552, 2552, 3553, 2222, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 3333, 2222, 2222, 2222, 5335, 5335, 5335, 5335, 4444, 4444, 4444, 4444, 4664, 4554, 4554, 4554, 2222, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 3333, 2222, 2222, 2222, 5555, 3333, 3333, 3333, 4444, 4444, 4444, 1111, 3663, 5555, 5555, 5555, 2222, 3663, 3663, 3663, 
1111, 1111, 1111, 1111, 3333, 2222, 2222, 2222, 5555, 3333, 3333, 3333, 4444, 4444, 4444, 3333, 4664, 5555, 5555, 5555, 2222, 4664, 4664, 4664, 
1111, 1111, 1111, 1111, 3333, 2222, 2222, 2222, 5555, 3333, 3333, 3333, 4444, 4444, 4444, 6666, 1661, 5555, 5555, 5555, 2222, 1661, 1661, 1661, 
1111, 1111, 1111, 1111, 3333, 2222, 2222, 3333, 5555, 3333, 3333, 5555, 4444, 4444, 4444, 4444, 6666, 5555, 5555, 6666, 2222, 6666, 6666, 2222, 
1111, 1111, 1111, 1111, 3333, 2222, 2222, 5555, 5555, 3333, 3333, 6666, 4444, 4444, 4444, 4444, 6666, 5555, 5555, 2222, 2222, 6666, 6666, 3333, 
1111, 1111, 1111, 1111, 3333, 2222, 2222, 6666, 5555, 3333, 3333, 2222, 4444, 4444, 4444, 4444, 6666, 5555, 5555, 3333, 2222, 6666, 6666, 5555, 
1111, 1111, 1111, 1111, 3333, 2222, 3333, 2222, 5555, 3333, 5555, 3333, 4444, 4444, 4444, 4444, 6666, 5555, 6666, 5555, 2222, 6666, 2222, 6666, 
1111, 1111, 1111, 1111, 3333, 2222, 5555, 2222, 5555, 3333, 6666, 3333, 4444, 4444, 4444, 4444, 6666, 5555, 2222, 5555, 2222, 6666, 3333, 6666, 
1111, 1111, 1111, 1111, 3333, 2222, 6666, 2222, 5555, 3333, 2222, 3333, 4444, 4444, 4444, 4444, 6666, 5555, 3333, 5555, 2222, 6666, 5555, 6666, 
1111, 1111, 1111, 1111, 3333, 3333, 2222, 2222, 5555, 5555, 3333, 3333, 4444, 4444, 4444, 4444, 6666, 6666, 5555, 5555, 2222, 2222, 6666, 6666, 
1111, 1111, 1111, 1111, 3333, 5555, 2222, 2222, 5555, 6666, 3333, 3333, 4444, 4444, 4444, 4444, 6666, 2222, 5555, 5555, 2222, 3333, 6666, 6666, 
1111, 1111, 1111, 1111, 3333, 6666, 2222, 2222, 5555, 2222, 3333, 3333, 4444, 4444, 4444, 4444, 6666, 3333, 5555, 5555, 2222, 5555, 6666, 6666, 
1111, 1111, 1111, 1111, 5555, 1221, 1221, 1221, 6666, 3333, 3333, 3333, 2442, 2442, 2442, 2442, 1221, 5555, 5555, 5555, 3333, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 5555, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 1221, 1551, 1551, 1551, 3333, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 5555, 2222, 2222, 2222, 3333, 3333, 3333, 6666, 4444, 4444, 4444, 4444, 2222, 2552, 2552, 5555, 3333, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 5555, 2222, 2222, 2222, 6336, 6336, 6336, 6336, 4444, 4444, 4444, 4444, 4224, 4554, 4554, 4554, 3333, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 5555, 2222, 2222, 3333, 6666, 3333, 3333, 5555, 4444, 4444, 4444, 4444, 2222, 5555, 5555, 6666, 3333, 6666, 6666, 2222, 
1111, 1111, 1111, 1111, 5555, 2222, 2222, 5555, 6666, 3333, 3333, 6666, 4444, 4444, 4444, 4444, 2222, 5555, 5555, 2222, 3333, 6666, 6666, 3333, 
1111, 1111, 1111, 1111, 5555, 2222, 2222, 6666, 6666, 3333, 3333, 2222, 4444, 4444, 4444, 4444, 2222, 5555, 5555, 3333, 3333, 6666, 6666, 5555, 
1111, 1111, 1111, 1111, 5555, 2222, 3333, 2222, 6666, 3333, 5555, 3333, 4444, 4444, 4444, 4444, 2222, 5555, 6666, 5555, 3333, 6666, 2222, 6666, 
1111, 1111, 1111, 1111, 5555, 2222, 5555, 2222, 6666, 3333, 6666, 3333, 4444, 4444, 4444, 4444, 2222, 5555, 2222, 5555, 3333, 6666, 3333, 6666, 
1111, 1111, 1111, 1111, 5555, 2222, 6666, 2222, 6666, 3333, 2222, 3333, 4444, 4444, 4444, 4444, 2222, 5555, 3333, 5555, 3333, 6666, 5555, 6666, 
1111, 1111, 1111, 1111, 5555, 3333, 2222, 2222, 6666, 5555, 3333, 3333, 4444, 4444, 4444, 4444, 2222, 6666, 5555, 5555, 3333, 2222, 6666, 6666, 
1111, 1111, 1111, 1111, 5555, 4224, 4224, 4224, 6666, 3333, 3333, 3333, 5445, 5445, 5445, 5445, 4224, 5555, 5555, 5555, 3333, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 5555, 5225, 5225, 5225, 6666, 3333, 3333, 3333, 1441, 1441, 1441, 1441, 5225, 5555, 5555, 5555, 3333, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 5555, 5555, 2222, 2222, 6666, 6666, 3333, 3333, 4444, 4444, 4444, 4444, 2222, 2222, 5555, 5555, 3333, 3333, 6666, 6666, 
1111, 1111, 1111, 1111, 5555, 6666, 2222, 2222, 6666, 2222, 3333, 3333, 4444, 4444, 4444, 4444, 2222, 3333, 5555, 5555, 3333, 5555, 6666, 6666, 
1111, 1111, 1111, 1111, 6666, 2222, 2222, 2222, 2222, 1331, 1331, 1331, 3333, 4444, 4444, 4444, 1331, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 6666, 2222, 2222, 2222, 2222, 4334, 4334, 4334, 6666, 4444, 4444, 4444, 4334, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 6666, 2222, 2222, 2222, 2222, 6336, 6336, 6336, 1111, 4444, 4444, 4444, 6336, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 6666, 2222, 2222, 2222, 2332, 2332, 2332, 2332, 4444, 4444, 4444, 4444, 4334, 4554, 4554, 4554, 5555, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 6666, 2222, 2222, 2222, 3333, 3333, 3333, 2222, 4444, 4444, 4444, 4444, 2332, 2552, 2552, 6556, 5555, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 6666, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 1331, 1551, 1551, 1551, 5555, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 6666, 2222, 2222, 3333, 2222, 3333, 3333, 5555, 4444, 4444, 4444, 4444, 3333, 5555, 5555, 6666, 5555, 6666, 6666, 2222, 
1111, 1111, 1111, 1111, 6666, 2222, 2222, 5555, 2222, 3333, 3333, 6666, 4444, 4444, 4444, 4444, 3333, 5555, 5555, 2222, 5555, 6666, 6666, 3333, 
1111, 1111, 1111, 1111, 6666, 2222, 2222, 6666, 2222, 3333, 3333, 2222, 4444, 4444, 4444, 4444, 3333, 5555, 5555, 3333, 5555, 6666, 6666, 5555, 
1111, 1111, 1111, 1111, 6666, 2222, 3333, 2222, 2222, 3333, 5555, 3333, 4444, 4444, 4444, 4444, 3333, 5555, 6666, 5555, 5555, 6666, 2222, 6666, 
1111, 1111, 1111, 1111, 6666, 2222, 5555, 2222, 2222, 3333, 6666, 3333, 4444, 4444, 4444, 4444, 3333, 5555, 2222, 5555, 5555, 6666, 3333, 6666, 
1111, 1111, 1111, 1111, 6666, 2222, 6666, 2222, 2222, 3333, 2222, 3333, 4444, 4444, 4444, 4444, 3333, 5555, 3333, 5555, 5555, 6666, 5555, 6666, 
1111, 1111, 1111, 1111, 6666, 3333, 2222, 2222, 2222, 5555, 3333, 3333, 4444, 4444, 4444, 4444, 3333, 6666, 5555, 5555, 5555, 2222, 6666, 6666, 
1111, 1111, 1111, 1111, 6666, 5555, 2222, 2222, 2222, 6666, 3333, 3333, 4444, 4444, 4444, 4444, 3333, 2222, 5555, 5555, 5555, 3333, 6666, 6666, 
1111, 1111, 1111, 1111, 6666, 6666, 2222, 2222, 2222, 2222, 3333, 3333, 4444, 4444, 4444, 4444, 3333, 3333, 5555, 5555, 5555, 5555, 6666, 6666, 
1111, 1111, 1111, 1441, 5225, 5225, 5225, 5225, 6336, 6336, 6336, 6336, 4114, 4444, 4444, 4444, 2552, 2552, 2552, 2552, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 2222, 3333, 2222, 2222, 2222, 1551, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 6666, 1551, 1551, 1551, 2222, 6666, 6666, 6666, 
1111, 1111, 1111, 2222, 6666, 4224, 4224, 4224, 4224, 3333, 3333, 3333, 5445, 5445, 5445, 5445, 3333, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 
1111, 1111, 1111, 2332, 6226, 6226, 6226, 6226, 4224, 4334, 4334, 4334, 5665, 4444, 4444, 4444, 3333, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 
1111, 1111, 1111, 2442, 1221, 1221, 1221, 1221, 6336, 6336, 6336, 6336, 5115, 4444, 4444, 4444, 4554, 4554, 4554, 4554, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 2662, 3223, 3223, 3223, 3223, 1331, 1331, 1331, 1551, 5335, 4444, 4444, 4444, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 2222, 
1111, 1111, 1111, 3233, 2622, 2622, 2622, 2622, 4334, 4224, 4334, 4334, 6566, 4444, 4444, 4444, 5555, 3333, 5555, 5555, 6666, 5555, 6666, 6666, 
1111, 1111, 1111, 3323, 2262, 2262, 2262, 2262, 4334, 4334, 4224, 4334, 6656, 4444, 4444, 4444, 5555, 5555, 3333, 5555, 6666, 6666, 5555, 6666, 
1111, 1111, 1111, 3333, 1111, 2222, 2222, 2222, 2332, 4334, 4334, 4334, 6666, 4444, 4444, 4444, 4554, 4554, 4554, 4554, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 3333, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 6666, 4444, 4444, 4444, 2552, 2552, 2552, 2552, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 3333, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 4444, 6666, 4444, 4444, 4444, 4554, 4554, 4554, 6556, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 3333, 2222, 2222, 2222, 2222, 4334, 4334, 4334, 4224, 6666, 4444, 4444, 4444, 5555, 5555, 5555, 3333, 6666, 6666, 6666, 5555, 
1111, 1111, 1111, 3333, 2222, 2222, 2222, 2222, 4334, 4334, 4334, 4554, 6666, 4444, 4444, 4444, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 2222, 
1111, 1111, 1111, 3333, 2222, 2222, 2222, 2222, 4334, 4334, 4334, 4664, 6666, 4444, 4444, 4444, 5555, 5555, 5555, 2222, 6666, 6666, 6666, 3333, 
1111, 1111, 1111, 3333, 2222, 2222, 2222, 2222, 4444, 3333, 3333, 3333, 6666, 4444, 4444, 4444, 3553, 1551, 1551, 1551, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 3333, 2222, 2222, 2222, 4334, 4334, 4334, 4334, 5555, 6446, 6446, 6446, 6446, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 2222, 
1111, 1111, 1111, 3333, 2222, 2222, 2222, 5555, 4334, 4334, 4334, 6666, 4444, 4444, 4444, 6666, 5555, 5555, 5555, 2222, 6666, 6666, 6666, 4334, 
1111, 1111, 1111, 3333, 2222, 2222, 2222, 6666, 4334, 4334, 4334, 2222, 4444, 4444, 4444, 4444, 5555, 5555, 5555, 4334, 6666, 6666, 6666, 5555, 
1111, 1111, 1111, 3333, 2222, 2222, 4334, 2222, 4334, 4334, 5555, 4334, 6666, 4444, 4444, 4444, 5555, 5555, 6666, 5555, 6666, 6666, 2222, 6666, 
1111, 1111, 1111, 3333, 2222, 2222, 5555, 2222, 4334, 4334, 6666, 4334, 6666, 4444, 4444, 4444, 5555, 5555, 2222, 5555, 6666, 6666, 4334, 6666, 
1111, 1111, 1111, 3333, 2222, 2222, 6666, 2222, 4334, 4334, 2222, 4334, 6666, 4444, 4444, 4444, 5555, 5555, 4334, 5555, 6666, 6666, 5555, 6666, 
1111, 1111, 1111, 3333, 2222, 4334, 2222, 2222, 4334, 5555, 4334, 4334, 6666, 4444, 4444, 4444, 5555, 6666, 5555, 5555, 6666, 2222, 6666, 6666, 
1111, 1111, 1111, 3333, 2222, 5555, 2222, 2222, 4334, 6666, 4334, 4334, 6666, 4444, 4444, 4444, 5555, 2222, 5555, 5555, 6666, 4334, 6666, 6666, 
1111, 1111, 1111, 3333, 2222, 6666, 2222, 2222, 4334, 2222, 4334, 4334, 6666, 4444, 4444, 4444, 5555, 4334, 5555, 5555, 6666, 5555, 6666, 6666, 
1111, 1111, 1111, 3333, 4444, 2222, 2222, 2222, 5335, 4334, 4334, 4334, 6666, 4444, 4444, 4444, 1551, 1551, 1551, 1551, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 3333, 5555, 2222, 2222, 2222, 1331, 4334, 4334, 4334, 6666, 4444, 4444, 4444, 2552, 2552, 2552, 2552, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 3333, 5555, 2222, 2222, 2222, 1661, 3333, 3333, 3333, 4444, 4444, 4444, 6666, 2222, 5555, 5555, 5555, 3333, 1661, 1661, 1661, 
1111, 1111, 1111, 3353, 2232, 2232, 2232, 2232, 4334, 4334, 4554, 4334, 6626, 4444, 4444, 4444, 5555, 5555, 6666, 5555, 6666, 6666, 2222, 6666, 
1111, 1111, 1111, 3363, 2252, 2252, 2252, 2252, 4334, 4334, 4664, 4334, 6636, 4444, 4444, 4444, 5555, 5555, 2222, 5555, 6666, 6666, 3333, 6666, 
1111, 1111, 1111, 3533, 2322, 2322, 2322, 2322, 4334, 4554, 4334, 4334, 6266, 4444, 4444, 4444, 5555, 6666, 5555, 5555, 6666, 2222, 6666, 6666, 
1111, 1111, 1111, 3633, 2522, 2522, 2522, 2522, 4334, 4664, 4334, 4334, 6366, 4444, 4444, 4444, 5555, 2222, 5555, 5555, 6666, 3333, 6666, 6666, 
1111, 1111, 1111, 3663, 5225, 5225, 5225, 5225, 1331, 1331, 1331, 1661, 6336, 4444, 4444, 4444, 5555, 5555, 5555, 2222, 6666, 6666, 6666, 3333, 
1111, 1111, 1111, 4444, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 1111, 4444, 4444, 4444, 2552, 2552, 2552, 2552, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 4444, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 6666, 1111, 4444, 4444, 4444, 4554, 4554, 4554, 1551, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 4444, 2222, 2222, 2222, 2222, 6666, 3333, 3333, 3333, 1111, 4444, 4444, 4444, 4554, 1551, 1551, 1551, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 4444, 2222, 2222, 2222, 3333, 6556, 6336, 6336, 2332, 1111, 4444, 4444, 4444, 6666, 5555, 5555, 5555, 2222, 6666, 6666, 6666, 
1111, 1111, 1111, 4444, 2222, 2222, 2222, 5555, 6336, 6336, 6336, 6666, 4444, 4444, 4444, 1111, 5555, 5555, 5555, 2222, 6666, 6666, 6666, 6336, 
1111, 1111, 1111, 4444, 2222, 2222, 2222, 5555, 6666, 6336, 6336, 3333, 1111, 4444, 4444, 4444, 2222, 5555, 5555, 5555, 3333, 6666, 6666, 6666, 
1111, 1111, 1111, 4444, 2222, 2222, 2222, 6336, 6336, 6336, 6336, 5555, 1441, 1441, 1441, 1441, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 2222, 
1111, 1111, 1111, 4444, 2222, 2222, 2222, 6666, 6226, 6336, 6336, 5335, 1111, 4444, 4444, 4444, 3333, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 
1111, 1111, 1111, 4444, 2222, 2222, 2222, 6666, 6336, 6336, 6336, 2222, 4444, 4444, 4444, 4444, 5555, 5555, 5555, 6336, 6666, 6666, 6666, 5555, 
1111, 1111, 1111, 4444, 2222, 2222, 3333, 2222, 6336, 6556, 2332, 6336, 1111, 4444, 4444, 4444, 5555, 6666, 5555, 5555, 6666, 2222, 6666, 6666, 
1111, 1111, 1111, 4444, 2222, 2222, 5555, 2222, 6336, 6336, 6666, 6336, 1111, 4444, 4444, 4444, 5555, 5555, 2222, 5555, 6666, 6666, 6336, 6666, 
1111, 1111, 1111, 4444, 2222, 2222, 5555, 2222, 6336, 6666, 3333, 6336, 1111, 4444, 4444, 4444, 5555, 2222, 5555, 5555, 6666, 3333, 6666, 6666, 
1111, 1111, 1111, 4444, 2222, 2222, 6336, 2222, 6336, 6336, 5555, 6336, 1111, 4444, 4444, 4444, 5555, 5555, 6666, 5555, 6666, 6666, 2222, 6666, 
1111, 1111, 1111, 4444, 2222, 2222, 6666, 2222, 6336, 6226, 5335, 6336, 1111, 4444, 4444, 4444, 5555, 3333, 5555, 5555, 6666, 5555, 6666, 6666, 
1111, 1111, 1111, 4444, 2222, 2222, 6666, 2222, 6336, 6336, 2222, 6336, 1111, 4444, 4444, 4444, 5555, 5555, 6336, 5555, 6666, 6666, 5555, 6666, 
1111, 1111, 1111, 4444, 2222, 3333, 2222, 2222, 6336, 2332, 6556, 6336, 1111, 4444, 4444, 4444, 5555, 5555, 6666, 5555, 6666, 6666, 2222, 6666, 
1111, 1111, 1111, 4444, 2222, 5555, 2222, 2222, 6336, 3333, 6666, 6336, 1111, 4444, 4444, 4444, 5555, 5555, 2222, 5555, 6666, 6666, 3333, 6666, 
1111, 1111, 1111, 4444, 2222, 5555, 2222, 2222, 6336, 6666, 6336, 6336, 1111, 4444, 4444, 4444, 5555, 2222, 5555, 5555, 6666, 6336, 6666, 6666, 
1111, 1111, 1111, 4444, 2222, 6336, 2222, 2222, 6336, 5555, 6336, 6336, 1111, 4444, 4444, 4444, 5555, 6666, 5555, 5555, 6666, 2222, 6666, 6666, 
1111, 1111, 1111, 4444, 2222, 6666, 2222, 2222, 6336, 2222, 6336, 6336, 1111, 4444, 4444, 4444, 5555, 6336, 5555, 5555, 6666, 5555, 6666, 6666, 
1111, 1111, 1111, 4444, 2222, 6666, 2222, 2222, 6336, 5335, 6226, 6336, 1111, 4444, 4444, 4444, 5555, 5555, 3333, 5555, 6666, 6666, 5555, 6666, 
1111, 1111, 1111, 4444, 3333, 2222, 2222, 2222, 2332, 6336, 6336, 6556, 1111, 4444, 4444, 4444, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 2222, 
1111, 1111, 1111, 4444, 3333, 2222, 2222, 2222, 2552, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 6666, 2552, 2552, 2552, 2222, 6666, 6666, 6666, 
1111, 1111, 1111, 4444, 5555, 2222, 2222, 2222, 3333, 6336, 6336, 6666, 1111, 4444, 4444, 4444, 5555, 5555, 5555, 2222, 6666, 6666, 6666, 3333, 
1111, 1111, 1111, 4444, 5555, 2222, 2222, 2222, 3663, 3333, 3333, 3333, 4444, 4444, 4444, 1111, 2222, 5555, 5555, 5555, 3333, 3663, 3663, 3663, 
1111, 1111, 1111, 4444, 6666, 2222, 2222, 2222, 5335, 6336, 6336, 6226, 1111, 4444, 4444, 4444, 5555, 5555, 5555, 3333, 6666, 6666, 6666, 5555, 
1111, 1111, 1111, 4444, 6666, 5225, 5225, 5225, 5225, 3333, 3333, 3333, 1441, 1441, 1441, 1441, 3333, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 
1111, 1111, 1111, 5335, 3223, 3223, 3223, 3223, 4554, 4334, 4334, 4334, 2662, 4444, 4444, 4444, 6666, 5555, 5555, 5555, 2222, 6666, 6666, 6666, 
1111, 1111, 1111, 5445, 4224, 4224, 4224, 4224, 6336, 6336, 6336, 6336, 2112, 4444, 4444, 4444, 1551, 1551, 1551, 1551, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 5555, 3333, 2222, 2222, 2222, 4554, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 6666, 4554, 4554, 4554, 2222, 6666, 6666, 6666, 
1111, 1111, 1111, 5555, 6666, 1221, 1221, 1221, 1221, 3333, 3333, 3333, 2442, 2442, 2442, 2442, 3333, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 
1111, 1111, 1111, 5665, 6226, 6226, 6226, 6226, 1331, 1331, 1331, 1221, 2332, 4444, 4444, 4444, 5555, 5555, 5555, 3333, 6666, 6666, 6666, 5555, 
1111, 1111, 1111, 6266, 2322, 2322, 2322, 2322, 1331, 1331, 1551, 1331, 3533, 4444, 4444, 4444, 5555, 5555, 6666, 5555, 6666, 6666, 2222, 6666, 
1111, 1111, 1111, 6336, 5225, 5225, 5225, 5225, 4664, 4334, 4334, 4334, 3663, 4444, 4444, 4444, 2222, 5555, 5555, 5555, 3333, 6666, 6666, 6666, 
1111, 1111, 1111, 6366, 2522, 2522, 2522, 2522, 1331, 1331, 1661, 1331, 3633, 4444, 4444, 4444, 5555, 5555, 2222, 5555, 6666, 6666, 3333, 6666, 
1111, 1111, 1111, 6566, 2622, 2622, 2622, 2622, 1331, 1331, 1221, 1331, 3233, 4444, 4444, 4444, 5555, 5555, 3333, 5555, 6666, 6666, 5555, 6666, 
1111, 1111, 1111, 6626, 2232, 2232, 2232, 2232, 1331, 1551, 1331, 1331, 3353, 4444, 4444, 4444, 5555, 6666, 5555, 5555, 6666, 2222, 6666, 6666, 
1111, 1111, 1111, 6636, 2252, 2252, 2252, 2252, 1331, 1661, 1331, 1331, 3363, 4444, 4444, 4444, 5555, 2222, 5555, 5555, 6666, 3333, 6666, 6666, 
1111, 1111, 1111, 6656, 2262, 2262, 2262, 2262, 1331, 1221, 1331, 1331, 3323, 4444, 4444, 4444, 5555, 3333, 5555, 5555, 6666, 5555, 6666, 6666, 
1111, 1111, 1111, 6666, 2222, 1331, 2222, 2222, 1331, 5555, 1331, 1331, 3333, 4444, 4444, 4444, 5555, 6666, 5555, 5555, 6666, 2222, 6666, 6666, 
1111, 1111, 1111, 6666, 2222, 2222, 1331, 2222, 1331, 1331, 5555, 1331, 3333, 4444, 4444, 4444, 5555, 5555, 6666, 5555, 6666, 6666, 2222, 6666, 
1111, 1111, 1111, 6666, 2222, 2222, 2222, 1111, 1331, 1331, 1331, 5335, 3333, 4444, 4444, 4444, 4554, 4554, 4554, 4554, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 6666, 2222, 2222, 2222, 1331, 1331, 1331, 1331, 5555, 3443, 3443, 3443, 3443, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 2222, 
1111, 1111, 1111, 6666, 2222, 2222, 2222, 2222, 1111, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 6556, 1551, 1551, 1551, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 6666, 2222, 2222, 2222, 2222, 1221, 1331, 1331, 1331, 3333, 4444, 4444, 4444, 3333, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 
1111, 1111, 1111, 6666, 2222, 2222, 2222, 2222, 1551, 1331, 1331, 1331, 3333, 4444, 4444, 4444, 6666, 5555, 5555, 5555, 2222, 6666, 6666, 6666, 
1111, 1111, 1111, 6666, 2222, 2222, 2222, 2222, 1661, 1331, 1331, 1331, 3333, 4444, 4444, 4444, 2222, 5555, 5555, 5555, 3333, 6666, 6666, 6666, 
1111, 1111, 1111, 6666, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 1111, 3333, 4444, 4444, 4444, 4554, 4554, 4554, 3553, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 6666, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 2552, 2552, 2552, 2552, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 6666, 2222, 2222, 2222, 4444, 1331, 1331, 1331, 2332, 3333, 4444, 4444, 4444, 1551, 1551, 1551, 1551, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 6666, 2222, 2222, 2222, 5555, 1331, 1331, 1331, 4334, 3333, 4444, 4444, 4444, 2552, 2552, 2552, 2552, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 6666, 2222, 2222, 2222, 5555, 1331, 1331, 1331, 6666, 4444, 4444, 4444, 3333, 5555, 5555, 5555, 2222, 6666, 6666, 6666, 1331, 
1111, 1111, 1111, 6666, 2222, 2222, 2222, 6666, 1331, 1331, 1331, 2222, 4444, 4444, 4444, 4444, 5555, 5555, 5555, 1331, 6666, 6666, 6666, 5555, 
1111, 1111, 1111, 6666, 2222, 2222, 5555, 2222, 1331, 1331, 6666, 1331, 3333, 4444, 4444, 4444, 5555, 5555, 2222, 5555, 6666, 6666, 1331, 6666, 
1111, 1111, 1111, 6666, 2222, 2222, 6666, 2222, 1331, 1331, 2222, 1331, 3333, 4444, 4444, 4444, 5555, 5555, 1331, 5555, 6666, 6666, 5555, 6666, 
1111, 1111, 1111, 6666, 2222, 5555, 2222, 2222, 1331, 6666, 1331, 1331, 3333, 4444, 4444, 4444, 5555, 2222, 5555, 5555, 6666, 1331, 6666, 6666, 
1111, 1111, 1111, 6666, 2222, 6666, 2222, 2222, 1331, 2222, 1331, 1331, 3333, 4444, 4444, 4444, 5555, 1331, 5555, 5555, 6666, 5555, 6666, 6666, 
1111, 1111, 1111, 6666, 5555, 2222, 2222, 2222, 4664, 3333, 3333, 3333, 4444, 4444, 4444, 3333, 2222, 5555, 5555, 5555, 3333, 4664, 4664, 4664, 
1111, 1111, 1441, 1111, 2222, 2222, 2222, 2222, 3633, 3633, 3633, 3633, 4444, 4114, 4444, 4444, 2552, 2552, 2552, 2552, 6636, 6636, 6636, 6636, 
1111, 1111, 2222, 1111, 3333, 2242, 2242, 2242, 5155, 3333, 3333, 3333, 4454, 4454, 4454, 4454, 6666, 5155, 5155, 5155, 2242, 6666, 6666, 6666, 
1111, 1111, 2222, 1111, 6666, 2422, 2422, 2422, 2422, 3333, 3333, 3333, 4544, 4544, 4544, 4544, 3333, 5515, 5515, 5515, 5515, 6666, 6666, 6666, 
1111, 1111, 2332, 1111, 6666, 2222, 2222, 2222, 2422, 3433, 3433, 3433, 4444, 5665, 4444, 4444, 3333, 5555, 5555, 5555, 5515, 6616, 6616, 6616, 
1111, 1111, 2442, 1111, 2222, 2222, 2222, 2222, 3633, 3633, 3633, 3633, 4444, 5115, 4444, 4444, 4554, 4554, 4554, 4554, 6636, 6636, 6636, 6636, 
1111, 1111, 2662, 1111, 2222, 2222, 2222, 3333, 3133, 3133, 3133, 5155, 4444, 5335, 4444, 4444, 5555, 5555, 5555, 6666, 6646, 6646, 6646, 2242, 
1111, 1111, 3233, 1111, 2222, 6666, 2222, 2222, 3433, 2422, 3433, 3433, 4444, 6566, 4444, 4444, 5555, 3333, 5555, 5555, 6616, 5515, 6616, 6616, 
1111, 1111, 3323, 1111, 2222, 2222, 6666, 2222, 3433, 3433, 2422, 3433, 4444, 6656, 4444, 4444, 5555, 5555, 3333, 5555, 6616, 6616, 5515, 6616, 
1111, 1111, 3333, 1111, 2222, 2222, 2222, 2222, 3133, 3433, 3433, 3433, 4444, 6666, 4444, 4444, 2552, 2552, 2552, 2552, 6646, 6616, 6616, 6616, 
1111, 1111, 3333, 1111, 2222, 2222, 2222, 2222, 3233, 3433, 3433, 3433, 4444, 6666, 4444, 4444, 4554, 4554, 4554, 4554, 6656, 6616, 6616, 6616, 
1111, 1111, 3333, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 4444, 3333, 4444, 6666, 4444, 4444, 4554, 4554, 6556, 4554, 6616, 6616, 6616, 6616, 
1111, 1111, 3333, 1111, 2222, 2222, 2222, 2222, 3333, 4444, 3333, 3333, 4444, 6666, 4444, 4444, 1551, 3553, 1551, 1551, 6616, 6616, 6616, 6616, 
1111, 1111, 3333, 1111, 2222, 2222, 2222, 2222, 3343, 3343, 3343, 3343, 4444, 6666, 4444, 4444, 2552, 2552, 2552, 2552, 6616, 6616, 6616, 6616, 
1111, 1111, 3333, 1111, 2222, 2222, 2222, 2222, 3533, 3433, 3433, 3433, 4444, 6666, 4444, 4444, 1551, 1551, 1551, 1551, 6626, 6616, 6616, 6616, 
1111, 1111, 3333, 1111, 2222, 2222, 2222, 3333, 3433, 3433, 3433, 5455, 4444, 6666, 4444, 4444, 5555, 5555, 5555, 6666, 6616, 6616, 6616, 2212, 
1111, 1111, 3333, 1111, 2222, 2222, 2222, 3433, 3433, 3433, 3433, 5555, 4644, 4644, 4644, 4644, 5555, 5555, 5555, 6616, 6616, 6616, 6616, 2222, 
1111, 1111, 3333, 1111, 2222, 2222, 2222, 5555, 3433, 3433, 3433, 6466, 4444, 6666, 4444, 4444, 5555, 5555, 5555, 2222, 6616, 6616, 6616, 3313, 
1111, 1111, 3333, 1111, 2222, 2222, 2222, 5555, 3433, 3433, 3433, 6616, 4444, 4444, 6666, 4444, 5555, 5555, 5555, 2222, 6616, 6616, 6616, 3433, 
1111, 1111, 3333, 1111, 2222, 2222, 2222, 6616, 3433, 3433, 3433, 2222, 4464, 4464, 4464, 4464, 5555, 5555, 5555, 3433, 6616, 6616, 6616, 5555, 
1111, 1111, 3333, 1111, 2222, 2222, 2222, 6666, 3433, 3433, 3433, 2422, 4444, 6666, 4444, 4444, 5555, 5555, 5555, 3333, 6616, 6616, 6616, 5515, 
1111, 1111, 3333, 1111, 2222, 2222, 3433, 2222, 3433, 3433, 5555, 3433, 4444, 6666, 4444, 4444, 5555, 5555, 6616, 5555, 6616, 6616, 2222, 6616, 
1111, 1111, 3333, 1111, 2222, 2222, 5555, 2222, 3433, 3433, 6616, 3433, 4444, 6666, 4444, 4444, 5555, 5555, 2222, 5555, 6616, 6616, 3433, 6616, 
1111, 1111, 3333, 1111, 2222, 2222, 6616, 2222, 3433, 3433, 2222, 3433, 4444, 6666, 4444, 4444, 5555, 5555, 3433, 5555, 6616, 6616, 5555, 6616, 
1111, 1111, 3333, 1111, 2222, 3433, 2222, 2222, 3433, 5555, 3433, 3433, 4444, 6666, 4444, 4444, 5555, 6616, 5555, 5555, 6616, 2222, 6616, 6616, 
1111, 1111, 3333, 1111, 2222, 5555, 2222, 2222, 3433, 6616, 3433, 3433, 4444, 6666, 4444, 4444, 5555, 2222, 5555, 5555, 6616, 3433, 6616, 6616, 
1111, 1111, 3333, 1111, 2222, 6616, 2222, 2222, 3433, 2222, 3433, 3433, 4444, 6666, 4444, 4444, 5555, 3433, 5555, 5555, 6616, 5555, 6616, 6616, 
1111, 1111, 3333, 1111, 5555, 2222, 2222, 2222, 6166, 3343, 3343, 3343, 4444, 4444, 6666, 4444, 2222, 5555, 5555, 5555, 3343, 6166, 6166, 6166, 
1111, 1111, 3333, 3333, 2222, 2222, 2222, 2222, 4434, 4434, 4434, 4434, 6666, 6666, 4444, 4444, 5555, 5555, 5555, 5555, 6616, 6616, 6616, 6616, 
1111, 1111, 3333, 4444, 2222, 2222, 2222, 2222, 6436, 6436, 6436, 6436, 1111, 6666, 4444, 4444, 5555, 5555, 5555, 5555, 6616, 6616, 6616, 6616, 
1111, 1111, 3333, 6666, 2222, 2222, 2222, 2222, 1431, 1431, 1431, 1431, 3333, 6666, 4444, 4444, 5555, 5555, 5555, 5555, 6616, 6616, 6616, 6616, 
1111, 1111, 3353, 1111, 2222, 2222, 3333, 2222, 3433, 3433, 5455, 3433, 4444, 6626, 4444, 4444, 5555, 5555, 6666, 5555, 6616, 6616, 2212, 6616, 
1111, 1111, 3363, 1111, 2222, 2222, 5555, 2222, 3433, 3433, 6466, 3433, 4444, 6636, 4444, 4444, 5555, 5555, 2222, 5555, 6616, 6616, 3313, 6616, 
1111, 1111, 3533, 1111, 2222, 3333, 2222, 2222, 3433, 5455, 3433, 3433, 4444, 6266, 4444, 4444, 5555, 6666, 5555, 5555, 6616, 2212, 6616, 6616, 
1111, 1111, 3633, 1111, 2222, 5555, 2222, 2222, 3433, 6466, 3433, 3433, 4444, 6366, 4444, 4444, 5555, 2222, 5555, 5555, 6616, 3313, 6616, 6616, 
1111, 1111, 3663, 1111, 2222, 2222, 2222, 5555, 3133, 3133, 3133, 6166, 4444, 6336, 4444, 4444, 5555, 5555, 5555, 2222, 6646, 6646, 6646, 3343, 
1111, 1111, 4444, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 6666, 3333, 4444, 1111, 4444, 4444, 4554, 4554, 1551, 4554, 6636, 6636, 6636, 6636, 
1111, 1111, 4444, 1111, 2222, 2222, 2222, 2222, 3333, 6666, 3333, 3333, 4444, 1111, 4444, 4444, 1551, 4554, 1551, 1551, 6636, 6636, 6636, 6636, 
1111, 1111, 4444, 1111, 2222, 2222, 2222, 2222, 3363, 3363, 3363, 3363, 4444, 1111, 4444, 4444, 2552, 2552, 2552, 2552, 6636, 6636, 6636, 6636, 
1111, 1111, 4444, 1111, 2222, 2222, 2222, 3333, 3233, 3633, 3633, 5655, 4444, 1111, 4444, 4444, 5555, 5555, 5555, 6666, 6656, 6636, 6636, 2232, 
1111, 1111, 4444, 1111, 2222, 2222, 2222, 3633, 3633, 3633, 3633, 5555, 4144, 4144, 4144, 4144, 5555, 5555, 5555, 6636, 6636, 6636, 6636, 2222, 
1111, 1111, 4444, 1111, 2222, 2222, 2222, 5555, 3333, 3633, 3633, 6666, 4444, 1111, 4444, 4444, 5555, 5555, 5555, 2222, 6666, 6636, 6636, 3333, 
1111, 1111, 4444, 1111, 2222, 2222, 2222, 5555, 3633, 3633, 3633, 6636, 4444, 4444, 1111, 4444, 5555, 5555, 5555, 2222, 6636, 6636, 6636, 3633, 
1111, 1111, 4444, 1111, 2222, 2222, 2222, 6636, 3633, 3633, 3633, 2222, 4414, 4414, 4414, 4414, 5555, 5555, 5555, 3633, 6636, 6636, 6636, 5555, 
1111, 1111, 4444, 1111, 2222, 2222, 2222, 6666, 3533, 3633, 3633, 2622, 4444, 1111, 4444, 4444, 5555, 5555, 5555, 3333, 6626, 6636, 6636, 5535, 
1111, 1111, 4444, 1111, 2222, 2222, 3333, 2222, 3633, 3233, 5655, 3633, 4444, 1111, 4444, 4444, 5555, 5555, 6666, 5555, 6636, 6656, 2232, 6636, 
1111, 1111, 4444, 1111, 2222, 2222, 3633, 2222, 3633, 3633, 5555, 3633, 4444, 1111, 4444, 4444, 5555, 5555, 6636, 5555, 6636, 6636, 2222, 6636, 
1111, 1111, 4444, 1111, 2222, 2222, 5555, 2222, 3633, 3333, 6666, 3633, 4444, 1111, 4444, 4444, 5555, 5555, 2222, 5555, 6636, 6666, 3333, 6636, 
1111, 1111, 4444, 1111, 2222, 2222, 5555, 2222, 3633, 3633, 6636, 3633, 4444, 1111, 4444, 4444, 5555, 5555, 2222, 5555, 6636, 6636, 3633, 6636, 
1111, 1111, 4444, 1111, 2222, 2222, 6636, 2222, 3633, 3633, 2222, 3633, 4444, 1111, 4444, 4444, 5555, 5555, 3633, 5555, 6636, 6636, 5555, 6636, 
1111, 1111, 4444, 1111, 2222, 2222, 6666, 2222, 3633, 3533, 2622, 3633, 4444, 1111, 4444, 4444, 5555, 5555, 3333, 5555, 6636, 6626, 5535, 6636, 
1111, 1111, 4444, 1111, 2222, 3333, 2222, 2222, 3633, 5655, 3233, 3633, 4444, 1111, 4444, 4444, 5555, 6666, 5555, 5555, 6636, 2232, 6656, 6636, 
1111, 1111, 4444, 1111, 2222, 3633, 2222, 2222, 3633, 5555, 3633, 3633, 4444, 1111, 4444, 4444, 5555, 6636, 5555, 5555, 6636, 2222, 6636, 6636, 
1111, 1111, 4444, 1111, 2222, 5555, 2222, 2222, 3633, 6636, 3633, 3633, 4444, 1111, 4444, 4444, 5555, 2222, 5555, 5555, 6636, 3633, 6636, 6636, 
1111, 1111, 4444, 1111, 2222, 5555, 2222, 2222, 3633, 6666, 3333, 3633, 4444, 1111, 4444, 4444, 5555, 2222, 5555, 5555, 6636, 3333, 6666, 6636, 
1111, 1111, 4444, 1111, 2222, 6636, 2222, 2222, 3633, 2222, 3633, 3633, 4444, 1111, 4444, 4444, 5555, 3633, 5555, 5555, 6636, 5555, 6636, 6636, 
1111, 1111, 4444, 1111, 2222, 6666, 2222, 2222, 3633, 2622, 3533, 3633, 4444, 1111, 4444, 4444, 5555, 3333, 5555, 5555, 6636, 5535, 6626, 6636, 
1111, 1111, 4444, 1111, 3333, 2222, 2222, 2222, 5655, 3633, 3633, 3233, 4444, 1111, 4444, 4444, 6666, 5555, 5555, 5555, 2232, 6636, 6636, 6656, 
1111, 1111, 4444, 1111, 3333, 2252, 2252, 2252, 5255, 3333, 3333, 3333, 4414, 4414, 4414, 4414, 6666, 5255, 5255, 5255, 2252, 6666, 6666, 6666, 
1111, 1111, 4444, 1111, 5555, 2222, 2222, 2222, 6366, 3363, 3363, 3363, 4444, 4444, 1111, 4444, 2222, 5555, 5555, 5555, 3363, 6366, 6366, 6366, 
1111, 1111, 4444, 1111, 5555, 2222, 2222, 2222, 6666, 3633, 3633, 3333, 4444, 1111, 4444, 4444, 2222, 5555, 5555, 5555, 3333, 6636, 6636, 6666, 
1111, 1111, 4444, 1111, 6666, 2222, 2222, 2222, 2622, 3633, 3633, 3533, 4444, 1111, 4444, 4444, 3333, 5555, 5555, 5555, 5535, 6636, 6636, 6626, 
1111, 1111, 4444, 1111, 6666, 2522, 2522, 2522, 2522, 3333, 3333, 3333, 4144, 4144, 4144, 4144, 3333, 5525, 5525, 5525, 5525, 6666, 6666, 6666, 
1111, 1111, 4444, 3333, 2222, 2222, 2222, 2222, 4634, 4634, 4634, 4634, 6666, 1111, 4444, 4444, 5555, 5555, 5555, 5555, 6636, 6636, 6636, 6636, 
1111, 1111, 4444, 4444, 2222, 2222, 2222, 2222, 6636, 6636, 6636, 6636, 1111, 1111, 4444, 4444, 5555, 5555, 5555, 5555, 6636, 6636, 6636, 6636, 
1111, 1111, 4444, 6666, 2222, 2222, 2222, 2222, 1631, 1631, 1631, 1631, 3333, 1111, 4444, 4444, 5555, 5555, 5555, 5555, 6636, 6636, 6636, 6636, 
1111, 1111, 5335, 1111, 3333, 2222, 2222, 2222, 5455, 3433, 3433, 3433, 4444, 2662, 4444, 4444, 6666, 5555, 5555, 5555, 2212, 6616, 6616, 6616, 
1111, 1111, 5445, 1111, 2222, 2222, 2222, 2222, 3633, 3633, 3633, 3633, 4444, 2112, 4444, 4444, 1551, 1551, 1551, 1551, 6636, 6636, 6636, 6636, 
1111, 1111, 5555, 1111, 3333, 2212, 2212, 2212, 5455, 3333, 3333, 3333, 4424, 4424, 4424, 4424, 6666, 5455, 5455, 5455, 2212, 6666, 6666, 6666, 
1111, 1111, 5555, 1111, 6666, 2122, 2122, 2122, 2122, 3333, 3333, 3333, 4244, 4244, 4244, 4244, 3333, 5545, 5545, 5545, 5545, 6666, 6666, 6666, 
1111, 1111, 5665, 1111, 2222, 2222, 2222, 6666, 3133, 3133, 3133, 2122, 4444, 2332, 4444, 4444, 5555, 5555, 5555, 3333, 6646, 6646, 6646, 5545, 
1111, 1111, 6266, 1111, 2222, 2222, 3333, 2222, 3133, 3133, 5155, 3133, 4444, 3533, 4444, 4444, 5555, 5555, 6666, 5555, 6646, 6646, 2242, 6646, 
1111, 1111, 6336, 1111, 5555, 2222, 2222, 2222, 6466, 3433, 3433, 3433, 4444, 3663, 4444, 4444, 2222, 5555, 5555, 5555, 3313, 6616, 6616, 6616, 
1111, 1111, 6366, 1111, 2222, 2222, 5555, 2222, 3133, 3133, 6166, 3133, 4444, 3633, 4444, 4444, 5555, 5555, 2222, 5555, 6646, 6646, 3343, 6646, 
1111, 1111, 6566, 1111, 2222, 2222, 6666, 2222, 3133, 3133, 2122, 3133, 4444, 3233, 4444, 4444, 5555, 5555, 3333, 5555, 6646, 6646, 5545, 6646, 
1111, 1111, 6626, 1111, 2222, 3333, 2222, 2222, 3133, 5155, 3133, 3133, 4444, 3353, 4444, 4444, 5555, 6666, 5555, 5555, 6646, 2242, 6646, 6646, 
1111, 1111, 6636, 1111, 2222, 5555, 2222, 2222, 3133, 6166, 3133, 3133, 4444, 3363, 4444, 4444, 5555, 2222, 5555, 5555, 6646, 3343, 6646, 6646, 
1111, 1111, 6656, 1111, 2222, 6666, 2222, 2222, 3133, 2122, 3133, 3133, 4444, 3323, 4444, 4444, 5555, 3333, 5555, 5555, 6646, 5545, 6646, 6646, 
1111, 1111, 6666, 1111, 2222, 2222, 2222, 2222, 3133, 3133, 3133, 3233, 4444, 3333, 4444, 4444, 1551, 1551, 1551, 1551, 6646, 6646, 6646, 6656, 
1111, 1111, 6666, 1111, 2222, 2222, 2222, 2222, 3133, 3133, 3133, 3433, 4444, 3333, 4444, 4444, 2552, 2552, 2552, 2552, 6646, 6646, 6646, 6616, 
1111, 1111, 6666, 1111, 2222, 2222, 2222, 2222, 3133, 3133, 3133, 3533, 4444, 3333, 4444, 4444, 4554, 4554, 4554, 4554, 6646, 6646, 6646, 6626, 
1111, 1111, 6666, 1111, 2222, 2222, 2222, 2222, 3313, 3313, 3313, 3313, 4444, 3333, 4444, 4444, 2552, 2552, 2552, 2552, 6646, 6646, 6646, 6646, 
1111, 1111, 6666, 1111, 2222, 2222, 2222, 2222, 3333, 1111, 3333, 3333, 4444, 3333, 4444, 4444, 1551, 6556, 1551, 1551, 6646, 6646, 6646, 6646, 
1111, 1111, 6666, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 1111, 3333, 4444, 3333, 4444, 4444, 4554, 4554, 3553, 4554, 6646, 6646, 6646, 6646, 
1111, 1111, 6666, 1111, 2222, 2222, 2222, 3133, 3133, 3133, 3133, 5555, 4344, 4344, 4344, 4344, 5555, 5555, 5555, 6646, 6646, 6646, 6646, 2222, 
1111, 1111, 6666, 1111, 2222, 2222, 2222, 5555, 3133, 3133, 3133, 6646, 4444, 4444, 3333, 4444, 5555, 5555, 5555, 2222, 6646, 6646, 6646, 3133, 
1111, 1111, 6666, 1111, 2222, 2222, 2222, 6646, 3133, 3133, 3133, 2222, 4434, 4434, 4434, 4434, 5555, 5555, 5555, 3133, 6646, 6646, 6646, 5555, 
1111, 1111, 6666, 1111, 2222, 2222, 3133, 2222, 3133, 3133, 5555, 3133, 4444, 3333, 4444, 4444, 5555, 5555, 6646, 5555, 6646, 6646, 2222, 6646, 
1111, 1111, 6666, 1111, 2222, 2222, 5555, 2222, 3133, 3133, 6646, 3133, 4444, 3333, 4444, 4444, 5555, 5555, 2222, 5555, 6646, 6646, 3133, 6646, 
1111, 1111, 6666, 1111, 2222, 2222, 6646, 2222, 3133, 3133, 2222, 3133, 4444, 3333, 4444, 4444, 5555, 5555, 3133, 5555, 6646, 6646, 5555, 6646, 
1111, 1111, 6666, 1111, 2222, 3133, 2222, 2222, 3133, 5555, 3133, 3133, 4444, 3333, 4444, 4444, 5555, 6646, 5555, 5555, 6646, 2222, 6646, 6646, 
1111, 1111, 6666, 1111, 2222, 5555, 2222, 2222, 3133, 6646, 3133, 3133, 4444, 3333, 4444, 4444, 5555, 2222, 5555, 5555, 6646, 3133, 6646, 6646, 
1111, 1111, 6666, 1111, 2222, 6646, 2222, 2222, 3133, 2222, 3133, 3133, 4444, 3333, 4444, 4444, 5555, 3133, 5555, 5555, 6646, 5555, 6646, 6646, 
1111, 1111, 6666, 1111, 3333, 2222, 2222, 2222, 5155, 3133, 3133, 3133, 4444, 3333, 4444, 4444, 6666, 5555, 5555, 5555, 2242, 6646, 6646, 6646, 
1111, 1111, 6666, 1111, 5555, 2222, 2222, 2222, 6166, 3133, 3133, 3133, 4444, 3333, 4444, 4444, 2222, 5555, 5555, 5555, 3343, 6646, 6646, 6646, 
1111, 1111, 6666, 1111, 5555, 2222, 2222, 2222, 6466, 3313, 3313, 3313, 4444, 4444, 3333, 4444, 2222, 5555, 5555, 5555, 3313, 6466, 6466, 6466, 
1111, 1111, 6666, 1111, 6666, 2222, 2222, 2222, 2122, 3133, 3133, 3133, 4444, 3333, 4444, 4444, 3333, 5555, 5555, 5555, 5545, 6646, 6646, 6646, 
1111, 1111, 6666, 3333, 2222, 2222, 2222, 2222, 4134, 4134, 4134, 4134, 6666, 3333, 4444, 4444, 5555, 5555, 5555, 5555, 6646, 6646, 6646, 6646, 
1111, 1111, 6666, 4444, 2222, 2222, 2222, 2222, 6136, 6136, 6136, 6136, 1111, 3333, 4444, 4444, 5555, 5555, 5555, 5555, 6646, 6646, 6646, 6646, 
1111, 1111, 6666, 6666, 2222, 2222, 2222, 2222, 1131, 1131, 1131, 1131, 3333, 3333, 4444, 4444, 5555, 5555, 5555, 5555, 6646, 6646, 6646, 6646, 
1111, 1141, 1141, 4444, 2252, 2252, 2252, 2252, 6336, 6336, 6336, 6336, 1111, 4414, 4414, 4444, 5255, 5255, 5255, 5255, 6666, 6666, 6666, 6666, 
1111, 1411, 1411, 4444, 2522, 2522, 2522, 2522, 6336, 6336, 6336, 6336, 1111, 4144, 4144, 4444, 5525, 5525, 5525, 5525, 6666, 6666, 6666, 6666, 
1111, 1441, 1111, 1111, 2222, 2222, 2222, 2222, 3363, 3363, 3363, 3363, 4444, 4444, 4114, 4444, 2552, 2552, 2552, 2552, 6366, 6366, 6366, 6366, 
1111, 2222, 1111, 1111, 3333, 2422, 2422, 2422, 5515, 3333, 3333, 3333, 4544, 4544, 4544, 4544, 6666, 5515, 5515, 5515, 2422, 6666, 6666, 6666, 
1111, 2222, 1111, 1111, 6666, 2242, 2242, 2242, 2242, 3333, 3333, 3333, 4454, 4454, 4454, 4454, 3333, 5155, 5155, 5155, 5155, 6666, 6666, 6666, 
1111, 2332, 1111, 1111, 6666, 2222, 2222, 2222, 2242, 3343, 3343, 3343, 4444, 4444, 5665, 4444, 3333, 5555, 5555, 5555, 5155, 6166, 6166, 6166, 
1111, 2442, 1111, 1111, 2222, 2222, 2222, 2222, 3363, 3363, 3363, 3363, 4444, 4444, 5115, 4444, 4554, 4554, 4554, 4554, 6366, 6366, 6366, 6366, 
1111, 2662, 1111, 1111, 2222, 2222, 2222, 3333, 3313, 3313, 3313, 5515, 4444, 4444, 5335, 4444, 5555, 5555, 5555, 6666, 6466, 6466, 6466, 2422, 
1111, 3233, 1111, 1111, 2222, 6666, 2222, 2222, 3343, 2242, 3343, 3343, 4444, 4444, 6566, 4444, 5555, 3333, 5555, 5555, 6166, 5155, 6166, 6166, 
1111, 3323, 1111, 1111, 2222, 2222, 6666, 2222, 3343, 3343, 2242, 3343, 4444, 4444, 6656, 4444, 5555, 5555, 3333, 5555, 6166, 6166, 5155, 6166, 
1111, 3333, 1111, 1111, 2222, 2222, 2222, 2222, 3313, 3343, 3343, 3343, 4444, 4444, 6666, 4444, 2552, 2552, 2552, 2552, 6466, 6166, 6166, 6166, 
1111, 3333, 1111, 1111, 2222, 2222, 2222, 2222, 3323, 3343, 3343, 3343, 4444, 4444, 6666, 4444, 4554, 4554, 4554, 4554, 6566, 6166, 6166, 6166, 
1111, 3333, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 4444, 3333, 4444, 4444, 6666, 4444, 1551, 1551, 3553, 1551, 6166, 6166, 6166, 6166, 
1111, 3333, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 4444, 3333, 3333, 4444, 4444, 6666, 4444, 4554, 6556, 4554, 4554, 6166, 6166, 6166, 6166, 
1111, 3333, 1111, 1111, 2222, 2222, 2222, 2222, 3353, 3343, 3343, 3343, 4444, 4444, 6666, 4444, 1551, 1551, 1551, 1551, 6266, 6166, 6166, 6166, 
1111, 3333, 1111, 1111, 2222, 2222, 2222, 2222, 3433, 3433, 3433, 3433, 4444, 4444, 6666, 4444, 2552, 2552, 2552, 2552, 6166, 6166, 6166, 6166, 
1111, 3333, 1111, 1111, 2222, 2222, 2222, 3333, 3343, 3343, 3343, 5545, 4444, 4444, 6666, 4444, 5555, 5555, 5555, 6666, 6166, 6166, 6166, 2122, 
1111, 3333, 1111, 1111, 2222, 2222, 2222, 3343, 3343, 3343, 3343, 5555, 4464, 4464, 4464, 4464, 5555, 5555, 5555, 6166, 6166, 6166, 6166, 2222, 
1111, 3333, 1111, 1111, 2222, 2222, 2222, 5555, 3343, 3343, 3343, 6166, 4444, 6666, 4444, 4444, 5555, 5555, 5555, 2222, 6166, 6166, 6166, 3343, 
1111, 3333, 1111, 1111, 2222, 2222, 2222, 5555, 3343, 3343, 3343, 6646, 4444, 4444, 6666, 4444, 5555, 5555, 5555, 2222, 6166, 6166, 6166, 3133, 
1111, 3333, 1111, 1111, 2222, 2222, 2222, 6166, 3343, 3343, 3343, 2222, 4644, 4644, 4644, 4644, 5555, 5555, 5555, 3343, 6166, 6166, 6166, 5555, 
1111, 3333, 1111, 1111, 2222, 2222, 2222, 6666, 3343, 3343, 3343, 2242, 4444, 4444, 6666, 4444, 5555, 5555, 5555, 3333, 6166, 6166, 6166, 5155, 
1111, 3333, 1111, 1111, 2222, 2222, 3343, 2222, 3343, 3343, 5555, 3343, 4444, 4444, 6666, 4444, 5555, 5555, 6166, 5555, 6166, 6166, 2222, 6166, 
1111, 3333, 1111, 1111, 2222, 2222, 5555, 2222, 3343, 3343, 6166, 3343, 4444, 4444, 6666, 4444, 5555, 5555, 2222, 5555, 6166, 6166, 3343, 6166, 
1111, 3333, 1111, 1111, 2222, 2222, 6166, 2222, 3343, 3343, 2222, 3343, 4444, 4444, 6666, 4444, 5555, 5555, 3343, 5555, 6166, 6166, 5555, 6166, 
1111, 3333, 1111, 1111, 2222, 3343, 2222, 2222, 3343, 5555, 3343, 3343, 4444, 4444, 6666, 4444, 5555, 6166, 5555, 5555, 6166, 2222, 6166, 6166, 
1111, 3333, 1111, 1111, 2222, 5555, 2222, 2222, 3343, 6166, 3343, 3343, 4444, 4444, 6666, 4444, 5555, 2222, 5555, 5555, 6166, 3343, 6166, 6166, 
1111, 3333, 1111, 1111, 2222, 6166, 2222, 2222, 3343, 2222, 3343, 3343, 4444, 4444, 6666, 4444, 5555, 3343, 5555, 5555, 6166, 5555, 6166, 6166, 
1111, 3333, 1111, 1111, 5555, 2222, 2222, 2222, 6616, 3433, 3433, 3433, 4444, 6666, 4444, 4444, 2222, 5555, 5555, 5555, 3433, 6616, 6616, 6616, 
1111, 3333, 1111, 3333, 2222, 2222, 2222, 2222, 4344, 4344, 4344, 4344, 6666, 4444, 6666, 4444, 5555, 5555, 5555, 5555, 6166, 6166, 6166, 6166, 
1111, 3333, 1111, 4444, 2222, 2222, 2222, 2222, 6346, 6346, 6346, 6346, 1111, 4444, 6666, 4444, 5555, 5555, 5555, 5555, 6166, 6166, 6166, 6166, 
1111, 3333, 1111, 6666, 2222, 2222, 2222, 2222, 1341, 1341, 1341, 1341, 3333, 4444, 6666, 4444, 5555, 5555, 5555, 5555, 6166, 6166, 6166, 6166, 
1111, 3333, 3333, 1111, 2222, 2222, 2222, 2222, 3443, 3443, 3443, 3443, 4444, 6666, 6666, 4444, 5555, 5555, 5555, 5555, 6116, 6116, 6116, 6116, 
1111, 3333, 4444, 1111, 2222, 2222, 2222, 2222, 3643, 3643, 3643, 3643, 4444, 1111, 6666, 4444, 5555, 5555, 5555, 5555, 6136, 6136, 6136, 6136, 
1111, 3333, 6666, 1111, 2222, 2222, 2222, 2222, 3143, 3143, 3143, 3143, 4444, 3333, 6666, 4444, 5555, 5555, 5555, 5555, 6146, 6146, 6146, 6146, 
1111, 3353, 1111, 1111, 2222, 2222, 3333, 2222, 3343, 3343, 5545, 3343, 4444, 4444, 6626, 4444, 5555, 5555, 6666, 5555, 6166, 6166, 2122, 6166, 
1111, 3363, 1111, 1111, 2222, 2222, 5555, 2222, 3343, 3343, 6646, 3343, 4444, 4444, 6636, 4444, 5555, 5555, 2222, 5555, 6166, 6166, 3133, 6166, 
1111, 3533, 1111, 1111, 2222, 3333, 2222, 2222, 3343, 5545, 3343, 3343, 4444, 4444, 6266, 4444, 5555, 6666, 5555, 5555, 6166, 2122, 6166, 6166, 
1111, 3633, 1111, 1111, 2222, 5555, 2222, 2222, 3343, 6646, 3343, 3343, 4444, 4444, 6366, 4444, 5555, 2222, 5555, 5555, 6166, 3133, 6166, 6166, 
1111, 3663, 1111, 1111, 2222, 2222, 2222, 5555, 3313, 3313, 3313, 6616, 4444, 4444, 6336, 4444, 5555, 5555, 5555, 2222, 6466, 6466, 6466, 3433, 
1111, 4114, 4114, 4444, 5225, 5225, 5225, 5225, 6336, 6336, 6336, 6336, 1111, 1441, 1441, 4444, 5555, 5555, 5555, 5555, 3663, 3663, 3663, 3663, 
1111, 4444, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 6666, 3333, 4444, 4444, 1111, 4444, 1551, 1551, 4554, 1551, 6366, 6366, 6366, 6366, 
1111, 4444, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 6666, 3333, 3333, 4444, 4444, 1111, 4444, 4554, 1551, 4554, 4554, 6366, 6366, 6366, 6366, 
1111, 4444, 1111, 1111, 2222, 2222, 2222, 2222, 3633, 3633, 3633, 3633, 4444, 4444, 1111, 4444, 2552, 2552, 2552, 2552, 6366, 6366, 6366, 6366, 
1111, 4444, 1111, 1111, 2222, 2222, 2222, 3333, 3323, 3363, 3363, 5565, 4444, 4444, 1111, 4444, 5555, 5555, 5555, 6666, 6566, 6366, 6366, 2322, 
1111, 4444, 1111, 1111, 2222, 2222, 2222, 3363, 3363, 3363, 3363, 5555, 4414, 4414, 4414, 4414, 5555, 5555, 5555, 6366, 6366, 6366, 6366, 2222, 
1111, 4444, 1111, 1111, 2222, 2222, 2222, 5555, 3333, 3363, 3363, 6666, 4444, 4444, 1111, 4444, 5555, 5555, 5555, 2222, 6666, 6366, 6366, 3333, 
1111, 4444, 1111, 1111, 2222, 2222, 2222, 5555, 3363, 3363, 3363, 6366, 4444, 1111, 4444, 4444, 5555, 5555, 5555, 2222, 6366, 6366, 6366, 3363, 
1111, 4444, 1111, 1111, 2222, 2222, 2222, 6366, 3363, 3363, 3363, 2222, 4144, 4144, 4144, 4144, 5555, 5555, 5555, 3363, 6366, 6366, 6366, 5555, 
1111, 4444, 1111, 1111, 2222, 2222, 2222, 6666, 3353, 3363, 3363, 2262, 4444, 4444, 1111, 4444, 5555, 5555, 5555, 3333, 6266, 6366, 6366, 5355, 
1111, 4444, 1111, 1111, 2222, 2222, 3333, 2222, 3363, 3323, 5565, 3363, 4444, 4444, 1111, 4444, 5555, 5555, 6666, 5555, 6366, 6566, 2322, 6366, 
1111, 4444, 1111, 1111, 2222, 2222, 3363, 2222, 3363, 3363, 5555, 3363, 4444, 4444, 1111, 4444, 5555, 5555, 6366, 5555, 6366, 6366, 2222, 6366, 
1111, 4444, 1111, 1111, 2222, 2222, 5555, 2222, 3363, 3333, 6666, 3363, 4444, 4444, 1111, 4444, 5555, 5555, 2222, 5555, 6366, 6666, 3333, 6366, 
1111, 4444, 1111, 1111, 2222, 2222, 5555, 2222, 3363, 3363, 6366, 3363, 4444, 4444, 1111, 4444, 5555, 5555, 2222, 5555, 6366, 6366, 3363, 6366, 
1111, 4444, 1111, 1111, 2222, 2222, 6366, 2222, 3363, 3363, 2222, 3363, 4444, 4444, 1111, 4444, 5555, 5555, 3363, 5555, 6366, 6366, 5555, 6366, 
1111, 4444, 1111, 1111, 2222, 2222, 6666, 2222, 3363, 3353, 2262, 3363, 4444, 4444, 1111, 4444, 5555, 5555, 3333, 5555, 6366, 6266, 5355, 6366, 
1111, 4444, 1111, 1111, 2222, 3333, 2222, 2222, 3363, 5565, 3323, 3363, 4444, 4444, 1111, 4444, 5555, 6666, 5555, 5555, 6366, 2322, 6566, 6366, 
1111, 4444, 1111, 1111, 2222, 3363, 2222, 2222, 3363, 5555, 3363, 3363, 4444, 4444, 1111, 4444, 5555, 6366, 5555, 5555, 6366, 2222, 6366, 6366, 
1111, 4444, 1111, 1111, 2222, 5555, 2222, 2222, 3363, 6366, 3363, 3363, 4444, 4444, 1111, 4444, 5555, 2222, 5555, 5555, 6366, 3363, 6366, 6366, 
1111, 4444, 1111, 1111, 2222, 5555, 2222, 2222, 3363, 6666, 3333, 3363, 4444, 4444, 1111, 4444, 5555, 2222, 5555, 5555, 6366, 3333, 6666, 6366, 
1111, 4444, 1111, 1111, 2222, 6366, 2222, 2222, 3363, 2222, 3363, 3363, 4444, 4444, 1111, 4444, 5555, 3363, 5555, 5555, 6366, 5555, 6366, 6366, 
1111, 4444, 1111, 1111, 2222, 6666, 2222, 2222, 3363, 2262, 3353, 3363, 4444, 4444, 1111, 4444, 5555, 3333, 5555, 5555, 6366, 5355, 6266, 6366, 
1111, 4444, 1111, 1111, 3333, 2222, 2222, 2222, 5565, 3363, 3363, 3323, 4444, 4444, 1111, 4444, 6666, 5555, 5555, 5555, 2322, 6366, 6366, 6566, 
1111, 4444, 1111, 1111, 3333, 2522, 2522, 2522, 5525, 3333, 3333, 3333, 4144, 4144, 4144, 4144, 6666, 5525, 5525, 5525, 2522, 6666, 6666, 6666, 
1111, 4444, 1111, 1111, 5555, 2222, 2222, 2222, 6636, 3633, 3633, 3633, 4444, 1111, 4444, 4444, 2222, 5555, 5555, 5555, 3633, 6636, 6636, 6636, 
1111, 4444, 1111, 1111, 5555, 2222, 2222, 2222, 6666, 3363, 3363, 3333, 4444, 4444, 1111, 4444, 2222, 5555, 5555, 5555, 3333, 6366, 6366, 6666, 
1111, 4444, 1111, 1111, 6666, 2222, 2222, 2222, 2262, 3363, 3363, 3353, 4444, 4444, 1111, 4444, 3333, 5555, 5555, 5555, 5355, 6366, 6366, 6266, 
1111, 4444, 1111, 1111, 6666, 2252, 2252, 2252, 2252, 3333, 3333, 3333, 4414, 4414, 4414, 4414, 3333, 5255, 5255, 5255, 5255, 6666, 6666, 6666, 
1111, 4444, 1111, 3333, 2222, 2222, 2222, 2222, 4364, 4364, 4364, 4364, 6666, 4444, 1111, 4444, 5555, 5555, 5555, 5555, 6366, 6366, 6366, 6366, 
1111, 4444, 1111, 4444, 2222, 2222, 2222, 2222, 6366, 6366, 6366, 6366, 1111, 4444, 1111, 4444, 5555, 5555, 5555, 5555, 6366, 6366, 6366, 6366, 
1111, 4444, 1111, 6666, 2222, 2222, 2222, 2222, 1361, 1361, 1361, 1361, 3333, 4444, 1111, 4444, 5555, 5555, 5555, 5555, 6366, 6366, 6366, 6366, 
1111, 4444, 3333, 1111, 2222, 2222, 2222, 2222, 3463, 3463, 3463, 3463, 4444, 6666, 1111, 4444, 5555, 5555, 5555, 5555, 6316, 6316, 6316, 6316, 
1111, 4444, 4444, 1111, 2222, 2222, 2222, 2222, 3663, 3663, 3663, 3663, 4444, 1111, 1111, 4444, 5555, 5555, 5555, 5555, 6336, 6336, 6336, 6336, 
1111, 4444, 6666, 1111, 2222, 2222, 2222, 2222, 3163, 3163, 3163, 3163, 4444, 3333, 1111, 4444, 5555, 5555, 5555, 5555, 6346, 6346, 6346, 6346, 
1111, 5335, 1111, 1111, 3333, 2222, 2222, 2222, 5545, 3343, 3343, 3343, 4444, 4444, 2662, 4444, 6666, 5555, 5555, 5555, 2122, 6166, 6166, 6166, 
1111, 5445, 1111, 1111, 2222, 2222, 2222, 2222, 3363, 3363, 3363, 3363, 4444, 4444, 2112, 4444, 1551, 1551, 1551, 1551, 6366, 6366, 6366, 6366, 
1111, 5555, 1111, 1111, 3333, 2122, 2122, 2122, 5545, 3333, 3333, 3333, 4244, 4244, 4244, 4244, 6666, 5545, 5545, 5545, 2122, 6666, 6666, 6666, 
1111, 5555, 1111, 1111, 6666, 2212, 2212, 2212, 2212, 3333, 3333, 3333, 4424, 4424, 4424, 4424, 3333, 5455, 5455, 5455, 5455, 6666, 6666, 6666, 
1111, 5665, 1111, 1111, 2222, 2222, 2222, 6666, 3313, 3313, 3313, 2212, 4444, 4444, 2332, 4444, 5555, 5555, 5555, 3333, 6466, 6466, 6466, 5455, 
1111, 6266, 1111, 1111, 2222, 2222, 3333, 2222, 3313, 3313, 5515, 3313, 4444, 4444, 3533, 4444, 5555, 5555, 6666, 5555, 6466, 6466, 2422, 6466, 
1111, 6336, 1111, 1111, 5555, 2222, 2222, 2222, 6646, 3343, 3343, 3343, 4444, 4444, 3663, 4444, 2222, 5555, 5555, 5555, 3133, 6166, 6166, 6166, 
1111, 6366, 1111, 1111, 2222, 2222, 5555, 2222, 3313, 3313, 6616, 3313, 4444, 4444, 3633, 4444, 5555, 5555, 2222, 5555, 6466, 6466, 3433, 6466, 
1111, 6566, 1111, 1111, 2222, 2222, 6666, 2222, 3313, 3313, 2212, 3313, 4444, 4444, 3233, 4444, 5555, 5555, 3333, 5555, 6466, 6466, 5455, 6466, 
1111, 6626, 1111, 1111, 2222, 3333, 2222, 2222, 3313, 5515, 3313, 3313, 4444, 4444, 3353, 4444, 5555, 6666, 5555, 5555, 6466, 2422, 6466, 6466, 
1111, 6636, 1111, 1111, 2222, 5555, 2222, 2222, 3313, 6616, 3313, 3313, 4444, 4444, 3363, 4444, 5555, 2222, 5555, 5555, 6466, 3433, 6466, 6466, 
1111, 6656, 1111, 1111, 2222, 6666, 2222, 2222, 3313, 2212, 3313, 3313, 4444, 4444, 3323, 4444, 5555, 3333, 5555, 5555, 6466, 5455, 6466, 6466, 
1111, 6666, 1111, 1111, 2222, 2222, 2222, 2222, 3133, 3133, 3133, 3133, 4444, 4444, 3333, 4444, 2552, 2552, 2552, 2552, 6466, 6466, 6466, 6466, 
1111, 6666, 1111, 1111, 2222, 2222, 2222, 2222, 3313, 3313, 3313, 3323, 4444, 4444, 3333, 4444, 1551, 1551, 1551, 1551, 6466, 6466, 6466, 6566, 
1111, 6666, 1111, 1111, 2222, 2222, 2222, 2222, 3313, 3313, 3313, 3343, 4444, 4444, 3333, 4444, 2552, 2552, 2552, 2552, 6466, 6466, 6466, 6166, 
1111, 6666, 1111, 1111, 2222, 2222, 2222, 2222, 3313, 3313, 3313, 3353, 4444, 4444, 3333, 4444, 4554, 4554, 4554, 4554, 6466, 6466, 6466, 6266, 
1111, 6666, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 1111, 3333, 3333, 4444, 4444, 3333, 4444, 4554, 3553, 4554, 4554, 6466, 6466, 6466, 6466, 
1111, 6666, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 1111, 3333, 4444, 4444, 3333, 4444, 1551, 1551, 6556, 1551, 6466, 6466, 6466, 6466, 
1111, 6666, 1111, 1111, 2222, 2222, 2222, 3313, 3313, 3313, 3313, 5555, 4434, 4434, 4434, 4434, 5555, 5555, 5555, 6466, 6466, 6466, 6466, 2222, 
1111, 6666, 1111, 1111, 2222, 2222, 2222, 5555, 3313, 3313, 3313, 6466, 4444, 3333, 4444, 4444, 5555, 5555, 5555, 2222, 6466, 6466, 6466, 3313, 
1111, 6666, 1111, 1111, 2222, 2222, 2222, 6466, 3313, 3313, 3313, 2222, 4344, 4344, 4344, 4344, 5555, 5555, 5555, 3313, 6466, 6466, 6466, 5555, 
1111, 6666, 1111, 1111, 2222, 2222, 3313, 2222, 3313, 3313, 5555, 3313, 4444, 4444, 3333, 4444, 5555, 5555, 6466, 5555, 6466, 6466, 2222, 6466, 
1111, 6666, 1111, 1111, 2222, 2222, 5555, 2222, 3313, 3313, 6466, 3313, 4444, 4444, 3333, 4444, 5555, 5555, 2222, 5555, 6466, 6466, 3313, 6466, 
1111, 6666, 1111, 1111, 2222, 2222, 6466, 2222, 3313, 3313, 2222, 3313, 4444, 4444, 3333, 4444, 5555, 5555, 3313, 5555, 6466, 6466, 5555, 6466, 
1111, 6666, 1111, 1111, 2222, 3313, 2222, 2222, 3313, 5555, 3313, 3313, 4444, 4444, 3333, 4444, 5555, 6466, 5555, 5555, 6466, 2222, 6466, 6466, 
1111, 6666, 1111, 1111, 2222, 5555, 2222, 2222, 3313, 6466, 3313, 3313, 4444, 4444, 3333, 4444, 5555, 2222, 5555, 5555, 6466, 3313, 6466, 6466, 
1111, 6666, 1111, 1111, 2222, 6466, 2222, 2222, 3313, 2222, 3313, 3313, 4444, 4444, 3333, 4444, 5555, 3313, 5555, 5555, 6466, 5555, 6466, 6466, 
1111, 6666, 1111, 1111, 3333, 2222, 2222, 2222, 5515, 3313, 3313, 3313, 4444, 4444, 3333, 4444, 6666, 5555, 5555, 5555, 2422, 6466, 6466, 6466, 
1111, 6666, 1111, 1111, 5555, 2222, 2222, 2222, 6616, 3313, 3313, 3313, 4444, 4444, 3333, 4444, 2222, 5555, 5555, 5555, 3433, 6466, 6466, 6466, 
1111, 6666, 1111, 1111, 5555, 2222, 2222, 2222, 6646, 3133, 3133, 3133, 4444, 3333, 4444, 4444, 2222, 5555, 5555, 5555, 3133, 6646, 6646, 6646, 
1111, 6666, 1111, 1111, 6666, 2222, 2222, 2222, 2212, 3313, 3313, 3313, 4444, 4444, 3333, 4444, 3333, 5555, 5555, 5555, 5455, 6466, 6466, 6466, 
1111, 6666, 1111, 3333, 2222, 2222, 2222, 2222, 4314, 4314, 4314, 4314, 6666, 4444, 3333, 4444, 5555, 5555, 5555, 5555, 6466, 6466, 6466, 6466, 
1111, 6666, 1111, 4444, 2222, 2222, 2222, 2222, 6316, 6316, 6316, 6316, 1111, 4444, 3333, 4444, 5555, 5555, 5555, 5555, 6466, 6466, 6466, 6466, 
1111, 6666, 1111, 6666, 2222, 2222, 2222, 2222, 1311, 1311, 1311, 1311, 3333, 4444, 3333, 4444, 5555, 5555, 5555, 5555, 6466, 6466, 6466, 6466, 
1111, 6666, 3333, 1111, 2222, 2222, 2222, 2222, 3413, 3413, 3413, 3413, 4444, 6666, 3333, 4444, 5555, 5555, 5555, 5555, 6416, 6416, 6416, 6416, 
1111, 6666, 4444, 1111, 2222, 2222, 2222, 2222, 3613, 3613, 3613, 3613, 4444, 1111, 3333, 4444, 5555, 5555, 5555, 5555, 6436, 6436, 6436, 6436, 
1111, 6666, 6666, 1111, 2222, 2222, 2222, 2222, 3113, 3113, 3113, 3113, 4444, 3333, 3333, 4444, 5555, 5555, 5555, 5555, 6446, 6446, 6446, 6446, 
1121, 1121, 1121, 1121, 2242, 2242, 2242, 2242, 3333, 3333, 3333, 3333, 4454, 4454, 4454, 4454, 1151, 1151, 1151, 1151, 6666, 6666, 6666, 6666, 
1121, 1121, 1121, 1121, 2242, 2242, 2242, 2242, 3333, 3333, 3333, 3333, 4454, 4454, 4454, 4454, 2152, 2152, 2152, 2152, 6666, 6666, 6666, 6666, 
1121, 1121, 1121, 1121, 2242, 2242, 2242, 2242, 3333, 3333, 3333, 3333, 4454, 4454, 4454, 4454, 4154, 4154, 4154, 4154, 6666, 6666, 6666, 6666, 
1121, 1121, 1121, 1121, 2242, 2242, 2242, 3333, 3333, 3333, 3333, 5155, 4444, 5555, 4444, 4444, 5155, 5155, 5155, 6666, 6666, 6666, 6666, 2242, 
1121, 1121, 1121, 1121, 2242, 2242, 2242, 5155, 3333, 3333, 3333, 6666, 4544, 4544, 4544, 4544, 5155, 5155, 5155, 2242, 6666, 6666, 6666, 3333, 
1121, 1121, 1121, 1121, 2242, 2242, 2242, 6666, 3333, 3333, 3333, 2242, 4444, 4444, 5555, 4444, 5155, 5155, 5155, 3333, 6666, 6666, 6666, 5155, 
1121, 1121, 1121, 1121, 2242, 2242, 3333, 2242, 3333, 3333, 5155, 3333, 4454, 4454, 4454, 4454, 5155, 5155, 6666, 5155, 6666, 6666, 2242, 6666, 
1121, 1121, 1121, 1121, 2242, 2242, 5155, 2242, 3333, 3333, 6666, 3333, 4454, 4454, 4454, 4454, 5155, 5155, 2242, 5155, 6666, 6666, 3333, 6666, 
1121, 1121, 1121, 1121, 2242, 2242, 6666, 2242, 3333, 3333, 2242, 3333, 4454, 4454, 4454, 4454, 5155, 5155, 3333, 5155, 6666, 6666, 5155, 6666, 
1121, 1121, 1121, 1121, 2242, 3333, 2242, 2242, 3333, 5155, 3333, 3333, 4454, 4454, 4454, 4454, 5155, 6666, 5155, 5155, 6666, 2242, 6666, 6666, 
1121, 1121, 1121, 1121, 2242, 5155, 2242, 2242, 3333, 6666, 3333, 3333, 4454, 4454, 4454, 4454, 5155, 2242, 5155, 5155, 6666, 3333, 6666, 6666, 
1121, 1121, 1121, 1121, 2242, 6666, 2242, 2242, 3333, 2242, 3333, 3333, 4454, 4454, 4454, 4454, 5155, 3333, 5155, 5155, 6666, 5155, 6666, 6666, 
1121, 1121, 1121, 1121, 5515, 2422, 2422, 2422, 6666, 3333, 3333, 3333, 4544, 4544, 4544, 4544, 2422, 5515, 5515, 5515, 3333, 6666, 6666, 6666, 
1121, 1121, 1121, 1131, 2242, 2242, 2242, 3343, 3333, 3333, 3333, 5555, 4464, 4454, 4454, 4454, 5155, 5155, 5155, 6166, 6666, 6666, 6666, 2222, 
1121, 1121, 1121, 1151, 2242, 2242, 2242, 5545, 3333, 3333, 3333, 6666, 4424, 4454, 4454, 4454, 5155, 5155, 5155, 2122, 6666, 6666, 6666, 3333, 
1121, 1121, 1121, 1161, 2242, 2242, 2242, 6646, 3333, 3333, 3333, 2222, 4434, 4454, 4454, 4454, 5155, 5155, 5155, 3133, 6666, 6666, 6666, 5555, 
1121, 1121, 1121, 3323, 2262, 2242, 2242, 2242, 4334, 4334, 4334, 4334, 6656, 4454, 4454, 4454, 5355, 5155, 5155, 5155, 6666, 6666, 6666, 6666, 
1121, 1121, 1121, 3333, 2222, 4444, 2222, 2222, 4334, 5335, 4334, 4334, 6666, 4454, 4454, 4454, 5155, 5155, 5155, 5155, 6666, 6666, 6666, 6666, 
1121, 1121, 1121, 4424, 2212, 2242, 2242, 2242, 6336, 6336, 6336, 6336, 1151, 4454, 4454, 4454, 5455, 5155, 5155, 5155, 6666, 6666, 6666, 6666, 
1121, 1121, 1121, 4544, 2422, 2422, 2422, 2422, 6336, 6336, 6336, 6336, 1211, 4454, 4454, 4454, 5155, 5155, 5155, 5155, 6666, 6666, 6666, 6666, 
1121, 1121, 1121, 6626, 2232, 2242, 2242, 2242, 1331, 1331, 1331, 1331, 3353, 4454, 4454, 4454, 5655, 5155, 5155, 5155, 6666, 6666, 6666, 6666, 
1121, 1121, 1121, 6666, 2222, 2222, 4444, 2222, 1331, 1331, 2332, 1331, 3333, 4454, 4454, 4454, 5155, 5155, 5155, 5155, 6666, 6666, 6666, 6666, 
1121, 1121, 1131, 1121, 2242, 2242, 3343, 2242, 3333, 3333, 5555, 3333, 4454, 4464, 4454, 4454, 5155, 5155, 6166, 5155, 6666, 6666, 2222, 6666, 
1121, 1121, 1151, 1121, 2242, 2242, 5545, 2242, 3333, 3333, 6666, 3333, 4454, 4424, 4454, 4454, 5155, 5155, 2122, 5155, 6666, 6666, 3333, 6666, 
1121, 1121, 1161, 1121, 2242, 2242, 6646, 2242, 3333, 3333, 2222, 3333, 4454, 4434, 4454, 4454, 5155, 5155, 3133, 5155, 6666, 6666, 5555, 6666, 
1121, 1121, 3323, 1121, 2242, 2262, 2242, 2242, 3433, 3433, 3433, 3433, 4454, 6656, 4454, 4454, 5155, 5355, 5155, 5155, 6616, 6616, 6616, 6616, 
1121, 1121, 3333, 1121, 2242, 2242, 2242, 2242, 3433, 3533, 3433, 3433, 4454, 6666, 4454, 4454, 5155, 5155, 5155, 5155, 6616, 6626, 6616, 6616, 
1121, 1121, 4424, 1121, 2242, 2212, 2242, 2242, 3633, 3633, 3633, 3633, 4454, 1151, 4454, 4454, 5155, 5455, 5155, 5155, 6636, 6636, 6636, 6636, 
1121, 1121, 4544, 1121, 2242, 2242, 2242, 2242, 3633, 3633, 3633, 3633, 4454, 1211, 4454, 4454, 5155, 5155, 5155, 5155, 6636, 6636, 6636, 6636, 
1121, 1121, 6626, 1121, 2242, 2232, 2242, 2242, 3133, 3133, 3133, 3133, 4454, 3353, 4454, 4454, 5155, 5655, 5155, 5155, 6646, 6646, 6646, 6646, 
1121, 1121, 6666, 1121, 2242, 2242, 2242, 2242, 3133, 3133, 3233, 3133, 4454, 3333, 4454, 4454, 5155, 5155, 5155, 5155, 6646, 6646, 6656, 6646, 
1121, 1131, 1121, 1121, 2242, 3343, 2242, 2242, 3333, 5555, 3333, 3333, 4454, 4454, 4464, 4454, 5155, 6166, 5155, 5155, 6666, 2222, 6666, 6666, 
1121, 1151, 1121, 1121, 2242, 5545, 2242, 2242, 3333, 6666, 3333, 3333, 4454, 4454, 4424, 4454, 5155, 2122, 5155, 5155, 6666, 3333, 6666, 6666, 
1121, 1151, 1151, 1151, 2212, 2212, 2212, 5515, 3333, 3333, 3333, 6666, 4424, 4424, 4424, 4454, 5455, 5455, 5455, 2422, 6666, 6666, 6666, 3333, 
1121, 1161, 1121, 1121, 2242, 6646, 2242, 2242, 3333, 2222, 3333, 3333, 4454, 4454, 4434, 4454, 5155, 3133, 5155, 5155, 6666, 5555, 6666, 6666, 
1121, 3323, 1121, 1121, 2242, 2242, 2262, 2242, 3343, 3343, 3343, 3343, 4454, 4454, 6656, 4454, 5155, 5155, 5355, 5155, 6166, 6166, 6166, 6166, 
1121, 3333, 1121, 1121, 2242, 2242, 2242, 2242, 3343, 3353, 3343, 3343, 4454, 4454, 6666, 4454, 5155, 5155, 5155, 5155, 6166, 6266, 6166, 6166, 
1121, 4424, 1121, 1121, 2242, 2242, 2212, 2242, 3363, 3363, 3363, 3363, 4454, 4454, 1151, 4454, 5155, 5155, 5455, 5155, 6366, 6366, 6366, 6366, 
1121, 4544, 1121, 1121, 2242, 2242, 2242, 2242, 3363, 3363, 3363, 3363, 4454, 4454, 1211, 4454, 5155, 5155, 5155, 5155, 6366, 6366, 6366, 6366, 
1121, 6626, 1121, 1121, 2242, 2242, 2232, 2242, 3313, 3313, 3313, 3313, 4454, 4454, 3353, 4454, 5155, 5155, 5655, 5155, 6466, 6466, 6466, 6466, 
1121, 6666, 1121, 1121, 2242, 2242, 2242, 2242, 3313, 3313, 3323, 3313, 4454, 4454, 3333, 4454, 5155, 5155, 5155, 5155, 6466, 6466, 6566, 6466, 
1131, 1121, 1121, 1121, 3343, 2242, 2242, 2242, 5555, 3333, 3333, 3333, 4454, 4454, 4454, 4464, 6166, 5155, 5155, 5155, 2222, 6666, 6666, 6666, 
1131, 1131, 1131, 1131, 3343, 2222, 2222, 2222, 5555, 3343, 3343, 3343, 4444, 4444, 6666, 4444, 6166, 5555, 5555, 5555, 2222, 6166, 6166, 6166, 
1131, 1131, 1131, 1131, 6616, 2222, 2222, 2222, 2222, 3433, 3433, 3433, 4444, 6666, 4444, 4444, 3433, 5555, 5555, 5555, 5555, 6616, 6616, 6616, 
1131, 1141, 1141, 6646, 2252, 2252, 2252, 2252, 1331, 1331, 1331, 1331, 3313, 4414, 4414, 4464, 5255, 5255, 5255, 5255, 6666, 6666, 6666, 6666, 
1131, 1151, 1151, 1151, 2212, 2212, 2212, 6616, 3333, 3333, 3333, 2222, 4424, 4424, 4424, 4464, 5455, 5455, 5455, 3433, 6666, 6666, 6666, 5555, 
1141, 1111, 4444, 1141, 2252, 2252, 2252, 2252, 3633, 3633, 3633, 3633, 4414, 1111, 4444, 4414, 5255, 5255, 5255, 5255, 6636, 6636, 6636, 6636, 
1141, 1131, 6646, 1141, 2252, 2252, 2252, 2252, 3133, 3133, 3133, 3133, 4414, 3313, 4464, 4414, 5255, 5255, 5255, 5255, 6646, 6646, 6646, 6646, 
1141, 1141, 1141, 1141, 2222, 2252, 2252, 5555, 3333, 3333, 3333, 6666, 4414, 4414, 4414, 4414, 5555, 5255, 5255, 2222, 6666, 6666, 6666, 3333, 
1141, 1141, 1141, 1141, 2232, 2252, 2252, 6656, 3333, 3333, 3333, 2222, 4414, 4414, 4414, 4414, 5655, 5255, 5255, 3233, 6666, 6666, 6666, 5555, 
1141, 1141, 1141, 1141, 2252, 2222, 5555, 2252, 3333, 3333, 6666, 3333, 4414, 4414, 4414, 4414, 5255, 5555, 2222, 5255, 6666, 6666, 3333, 6666, 
1141, 1141, 1141, 1141, 2252, 2232, 6656, 2252, 3333, 3333, 2222, 3333, 4414, 4414, 4414, 4414, 5255, 5655, 3233, 5255, 6666, 6666, 5555, 6666, 
1141, 1141, 1141, 1141, 2252, 2252, 2252, 2252, 3333, 3333, 3333, 3333, 4414, 4414, 4414, 4414, 1251, 1251, 1251, 1251, 6666, 6666, 6666, 6666, 
1141, 1141, 1141, 1141, 2252, 2252, 2252, 2252, 3333, 3333, 3333, 3333, 4414, 4414, 4414, 4414, 2252, 2252, 2252, 2252, 6666, 6666, 6666, 6666, 
1141, 1141, 1141, 1141, 2252, 2252, 2252, 2252, 3333, 3333, 3333, 3333, 4414, 4414, 4414, 4414, 4254, 4254, 4254, 4254, 6666, 6666, 6666, 6666, 
1141, 1141, 1141, 1141, 2252, 2252, 2252, 3333, 3333, 3333, 3333, 5255, 4444, 1111, 4444, 4444, 5255, 5255, 5255, 6666, 6666, 6666, 6666, 2252, 
1141, 1141, 1141, 1141, 2252, 2252, 2252, 5255, 3333, 3333, 3333, 6666, 4144, 4144, 4144, 4144, 5255, 5255, 5255, 2252, 6666, 6666, 6666, 3333, 
1141, 1141, 1141, 1141, 2252, 2252, 2252, 6666, 3333, 3333, 3333, 2252, 4444, 4444, 1111, 4444, 5255, 5255, 5255, 3333, 6666, 6666, 6666, 5255, 
1141, 1141, 1141, 1141, 2252, 2252, 3333, 2252, 3333, 3333, 5255, 3333, 4414, 4414, 4414, 4414, 5255, 5255, 6666, 5255, 6666, 6666, 2252, 6666, 
1141, 1141, 1141, 1141, 2252, 2252, 5255, 2252, 3333, 3333, 6666, 3333, 4414, 4414, 4414, 4414, 5255, 5255, 2252, 5255, 6666, 6666, 3333, 6666, 
1141, 1141, 1141, 1141, 2252, 2252, 6666, 2252, 3333, 3333, 2252, 3333, 4414, 4414, 4414, 4414, 5255, 5255, 3333, 5255, 6666, 6666, 5255, 6666, 
1141, 1141, 1141, 1141, 2252, 2262, 3353, 2252, 3333, 3333, 5555, 3333, 4414, 4414, 4414, 4414, 5255, 5355, 6266, 5255, 6666, 6666, 2222, 6666, 
1141, 1141, 1141, 1141, 2252, 3333, 2252, 2252, 3333, 5255, 3333, 3333, 4414, 4414, 4414, 4414, 5255, 6666, 5255, 5255, 6666, 2252, 6666, 6666, 
1141, 1141, 1141, 1141, 2252, 3353, 2262, 2252, 3333, 5555, 3333, 3333, 4414, 4414, 4414, 4414, 5255, 6266, 5355, 5255, 6666, 2222, 6666, 6666, 
1141, 1141, 1141, 1141, 2252, 5255, 2252, 2252, 3333, 6666, 3333, 3333, 4414, 4414, 4414, 4414, 5255, 2252, 5255, 5255, 6666, 3333, 6666, 6666, 
1141, 1141, 1141, 1141, 2252, 5555, 2222, 2252, 3333, 6666, 3333, 3333, 4414, 4414, 4414, 4414, 5255, 2222, 5555, 5255, 6666, 3333, 6666, 6666, 
1141, 1141, 1141, 1141, 2252, 6656, 2232, 2252, 3333, 2222, 3333, 3333, 4414, 4414, 4414, 4414, 5255, 3233, 5655, 5255, 6666, 5555, 6666, 6666, 
1141, 1141, 1141, 1141, 2252, 6666, 2252, 2252, 3333, 2252, 3333, 3333, 4414, 4414, 4414, 4414, 5255, 3333, 5255, 5255, 6666, 5255, 6666, 6666, 
1141, 1141, 1141, 1141, 2262, 2252, 2252, 3353, 3333, 3333, 3333, 5555, 4414, 4414, 4414, 4414, 5355, 5255, 5255, 6266, 6666, 6666, 6666, 2222, 
1141, 1141, 1141, 1141, 3353, 2252, 2252, 2262, 5555, 3333, 3333, 3333, 4414, 4414, 4414, 4414, 6266, 5255, 5255, 5355, 2222, 6666, 6666, 6666, 
1141, 1141, 1141, 1141, 3363, 2222, 2222, 2222, 5555, 3363, 3363, 3363, 4444, 4444, 1111, 4444, 6366, 5555, 5555, 5555, 2222, 6366, 6366, 6366, 
1141, 1141, 1141, 1141, 5525, 2522, 2522, 2522, 6666, 3333, 3333, 3333, 4144, 4144, 4144, 4144, 2522, 5525, 5525, 5525, 3333, 6666, 6666, 6666, 
1141, 1141, 1141, 1141, 5555, 2252, 2252, 2222, 6666, 3333, 3333, 3333, 4414, 4414, 4414, 4414, 2222, 5255, 5255, 5555, 3333, 6666, 6666, 6666, 
1141, 1141, 1141, 1141, 6636, 2222, 2222, 2222, 2222, 3633, 3633, 3633, 4444, 1111, 4444, 4444, 3633, 5555, 5555, 5555, 5555, 6636, 6636, 6636, 
1141, 1141, 1141, 1141, 6656, 2252, 2252, 2232, 2222, 3333, 3333, 3333, 4414, 4414, 4414, 4414, 3233, 5255, 5255, 5655, 5555, 6666, 6666, 6666, 
1141, 1141, 1141, 3333, 2222, 5555, 2222, 2222, 4334, 1331, 4334, 4334, 6666, 4414, 4414, 4414, 5255, 5255, 5255, 5255, 6666, 6666, 6666, 6666, 
1141, 1141, 1141, 4144, 2522, 2522, 2522, 2522, 6336, 6336, 6336, 6336, 1411, 4414, 4414, 4414, 5255, 5255, 5255, 5255, 6666, 6666, 6666, 6666, 
1141, 1141, 1141, 6666, 2222, 2222, 5555, 2222, 1331, 1331, 4334, 1331, 3333, 4414, 4414, 4414, 5255, 5255, 5255, 5255, 6666, 6666, 6666, 6666, 
1141, 1141, 3333, 1141, 2252, 2252, 2252, 2252, 3433, 3133, 3433, 3433, 4414, 6666, 4414, 4414, 5255, 5255, 5255, 5255, 6616, 6646, 6616, 6616, 
1141, 1141, 4144, 1141, 2252, 2252, 2252, 2252, 3633, 3633, 3633, 3633, 4414, 1411, 4414, 4414, 5255, 5255, 5255, 5255, 6636, 6636, 6636, 6636, 
1141, 1141, 6666, 1141, 2252, 2252, 2252, 2252, 3133, 3133, 3433, 3133, 4414, 3333, 4414, 4414, 5255, 5255, 5255, 5255, 6646, 6646, 6616, 6646, 
1141, 1161, 3343, 1141, 2252, 2252, 2252, 2252, 3433, 3433, 3433, 3433, 4414, 6616, 4434, 4414, 5255, 5255, 5255, 5255, 6616, 6616, 6616, 6616, 
1141, 3333, 1141, 1141, 2252, 2252, 2252, 2252, 3343, 3313, 3343, 3343, 4414, 4414, 6666, 4414, 5255, 5255, 5255, 5255, 6166, 6466, 6166, 6166, 
1141, 3343, 1161, 1141, 2252, 2252, 2252, 2252, 3343, 3343, 3343, 3343, 4414, 4434, 6616, 4414, 5255, 5255, 5255, 5255, 6166, 6166, 6166, 6166, 
1141, 4144, 1141, 1141, 2252, 2252, 2252, 2252, 3363, 3363, 3363, 3363, 4414, 4414, 1411, 4414, 5255, 5255, 5255, 5255, 6366, 6366, 6366, 6366, 
1141, 4444, 1111, 1141, 2252, 2252, 2252, 2252, 3363, 3363, 3363, 3363, 4414, 4444, 1111, 4414, 5255, 5255, 5255, 5255, 6366, 6366, 6366, 6366, 
1141, 6646, 1131, 1141, 2252, 2252, 2252, 2252, 3313, 3313, 3313, 3313, 4414, 4464, 3313, 4414, 5255, 5255, 5255, 5255, 6466, 6466, 6466, 6466, 
1141, 6666, 1141, 1141, 2252, 2252, 2252, 2252, 3313, 3313, 3343, 3313, 4414, 4414, 3333, 4414, 5255, 5255, 5255, 5255, 6466, 6466, 6166, 6466, 
1151, 1121, 1121, 1121, 5545, 2242, 2242, 2242, 6666, 3333, 3333, 3333, 4454, 4454, 4454, 4424, 2122, 5155, 5155, 5155, 3333, 6666, 6666, 6666, 
1151, 1121, 1151, 1151, 2212, 2212, 5515, 2212, 3333, 3333, 6666, 3333, 4424, 4424, 4454, 4424, 5455, 5455, 2422, 5455, 6666, 6666, 3333, 6666, 
1151, 1131, 1151, 1151, 2212, 2212, 6616, 2212, 3333, 3333, 2222, 3333, 4424, 4424, 4464, 4424, 5455, 5455, 3433, 5455, 6666, 6666, 5555, 6666, 
1151, 1151, 1121, 1151, 2212, 5515, 2212, 2212, 3333, 6666, 3333, 3333, 4424, 4454, 4424, 4424, 5455, 2422, 5455, 5455, 6666, 3333, 6666, 6666, 
1151, 1151, 1131, 1151, 2212, 6616, 2212, 2212, 3333, 2222, 3333, 3333, 4424, 4464, 4424, 4424, 5455, 3433, 5455, 5455, 6666, 5555, 6666, 6666, 
1151, 1151, 1151, 1121, 5515, 2212, 2212, 2212, 6666, 3333, 3333, 3333, 4454, 4424, 4424, 4424, 2422, 5455, 5455, 5455, 3333, 6666, 6666, 6666, 
1151, 1151, 1151, 1131, 6616, 2212, 2212, 2212, 2222, 3333, 3333, 3333, 4464, 4424, 4424, 4424, 3433, 5455, 5455, 5455, 5555, 6666, 6666, 6666, 
1151, 1151, 1151, 1151, 2212, 2212, 2212, 2212, 3333, 3333, 3333, 3333, 4424, 4424, 4424, 4424, 1451, 1451, 1451, 1451, 6666, 6666, 6666, 6666, 
1151, 1151, 1151, 1151, 2212, 2212, 2212, 2212, 3333, 3333, 3333, 3333, 4424, 4424, 4424, 4424, 2452, 2452, 2452, 2452, 6666, 6666, 6666, 6666, 
1151, 1151, 1151, 1151, 2212, 2212, 2212, 2212, 3333, 3333, 3333, 3333, 4424, 4424, 4424, 4424, 4454, 4454, 4454, 4454, 6666, 6666, 6666, 6666, 
1151, 1151, 1151, 1151, 2212, 2212, 2212, 3333, 3333, 3333, 3333, 5455, 4444, 2222, 4444, 4444, 5455, 5455, 5455, 6666, 6666, 6666, 6666, 2212, 
1151, 1151, 1151, 1151, 2212, 2212, 2212, 5455, 3333, 3333, 3333, 6666, 4244, 4244, 4244, 4244, 5455, 5455, 5455, 2212, 6666, 6666, 6666, 3333, 
1151, 1151, 1151, 1151, 2212, 2212, 2212, 6666, 3333, 3333, 3333, 2212, 4444, 4444, 2222, 4444, 5455, 5455, 5455, 3333, 6666, 6666, 6666, 5455, 
1151, 1151, 1151, 1151, 2212, 2212, 3333, 2212, 3333, 3333, 5455, 3333, 4424, 4424, 4424, 4424, 5455, 5455, 6666, 5455, 6666, 6666, 2212, 6666, 
1151, 1151, 1151, 1151, 2212, 2212, 5455, 2212, 3333, 3333, 6666, 3333, 4424, 4424, 4424, 4424, 5455, 5455, 2212, 5455, 6666, 6666, 3333, 6666, 
1151, 1151, 1151, 1151, 2212, 2212, 6666, 2212, 3333, 3333, 2212, 3333, 4424, 4424, 4424, 4424, 5455, 5455, 3333, 5455, 6666, 6666, 5455, 6666, 
1151, 1151, 1151, 1151, 2212, 3333, 2212, 2212, 3333, 5455, 3333, 3333, 4424, 4424, 4424, 4424, 5455, 6666, 5455, 5455, 6666, 2212, 6666, 6666, 
1151, 1151, 1151, 1151, 2212, 5455, 2212, 2212, 3333, 6666, 3333, 3333, 4424, 4424, 4424, 4424, 5455, 2212, 5455, 5455, 6666, 3333, 6666, 6666, 
1151, 1151, 1151, 1151, 2212, 6666, 2212, 2212, 3333, 2212, 3333, 3333, 4424, 4424, 4424, 4424, 5455, 3333, 5455, 5455, 6666, 5455, 6666, 6666, 
1151, 1151, 1151, 1151, 5545, 2122, 2122, 2122, 6666, 3333, 3333, 3333, 4244, 4244, 4244, 4244, 2122, 5545, 5545, 5545, 3333, 6666, 6666, 6666, 
1151, 1151, 1151, 1161, 3313, 2212, 2212, 2212, 5555, 3333, 3333, 3333, 4434, 4424, 4424, 4424, 6466, 5455, 5455, 5455, 2222, 6666, 6666, 6666, 
1151, 1151, 1151, 3333, 2222, 1111, 2222, 2222, 4334, 2332, 4334, 4334, 6666, 4424, 4424, 4424, 5455, 5455, 5455, 5455, 6666, 6666, 6666, 6666, 
1151, 1151, 1151, 3353, 2212, 2212, 2212, 2232, 4334, 4334, 4334, 4334, 6626, 4424, 4424, 4424, 5455, 5455, 5455, 5655, 6666, 6666, 6666, 6666, 
1151, 1151, 1151, 4244, 2122, 2122, 2122, 2122, 6336, 6336, 6336, 6336, 1511, 4424, 4424, 4424, 5455, 5455, 5455, 5455, 6666, 6666, 6666, 6666, 
1151, 1151, 1151, 4454, 2212, 2212, 2212, 2242, 6336, 6336, 6336, 6336, 1121, 4424, 4424, 4424, 5455, 5455, 5455, 5155, 6666, 6666, 6666, 6666, 
1151, 1151, 1151, 6656, 2212, 2212, 2212, 2262, 1331, 1331, 1331, 1331, 3323, 4424, 4424, 4424, 5455, 5455, 5455, 5355, 6666, 6666, 6666, 6666, 
1151, 1151, 1151, 6666, 2222, 2222, 1111, 2222, 1331, 1331, 5335, 1331, 3333, 4424, 4424, 4424, 5455, 5455, 5455, 5455, 6666, 6666, 6666, 6666, 
1151, 1151, 1161, 1151, 2212, 3313, 2212, 2212, 3333, 5555, 3333, 3333, 4424, 4434, 4424, 4424, 5455, 6466, 5455, 5455, 6666, 2222, 6666, 6666, 
1151, 1151, 3333, 1151, 2212, 2212, 2212, 2212, 3433, 3233, 3433, 3433, 4424, 6666, 4424, 4424, 5455, 5455, 5455, 5455, 6616, 6656, 6616, 6616, 
1151, 1151, 3353, 1151, 2212, 2212, 2232, 2212, 3433, 3433, 3433, 3433, 4424, 6626, 4424, 4424, 5455, 5455, 5655, 5455, 6616, 6616, 6616, 6616, 
1151, 1151, 4244, 1151, 2212, 2212, 2212, 2212, 3633, 3633, 3633, 3633, 4424, 1511, 4424, 4424, 5455, 5455, 5455, 5455, 6636, 6636, 6636, 6636, 
1151, 1151, 4454, 1151, 2212, 2212, 2242, 2212, 3633, 3633, 3633, 3633, 4424, 1121, 4424, 4424, 5455, 5455, 5155, 5455, 6636, 6636, 6636, 6636, 
1151, 1151, 6656, 1151, 2212, 2212, 2262, 2212, 3133, 3133, 3133, 3133, 4424, 3323, 4424, 4424, 5455, 5455, 5355, 5455, 6646, 6646, 6646, 6646, 
1151, 1151, 6666, 1151, 2212, 2212, 2212, 2212, 3133, 3133, 3533, 3133, 4424, 3333, 4424, 4424, 5455, 5455, 5455, 5455, 6646, 6646, 6626, 6646, 
1151, 1161, 1151, 1151, 2212, 2212, 3313, 2212, 3333, 3333, 5555, 3333, 4424, 4424, 4434, 4424, 5455, 5455, 6466, 5455, 6666, 6666, 2222, 6666, 
1151, 3333, 1151, 1151, 2212, 2212, 2212, 2212, 3343, 3323, 3343, 3343, 4424, 4424, 6666, 4424, 5455, 5455, 5455, 5455, 6166, 6566, 6166, 6166, 
1151, 3353, 1151, 1151, 2212, 2232, 2212, 2212, 3343, 3343, 3343, 3343, 4424, 4424, 6626, 4424, 5455, 5655, 5455, 5455, 6166, 6166, 6166, 6166, 
1151, 4244, 1151, 1151, 2212, 2212, 2212, 2212, 3363, 3363, 3363, 3363, 4424, 4424, 1511, 4424, 5455, 5455, 5455, 5455, 6366, 6366, 6366, 6366, 
1151, 4454, 1151, 1151, 2212, 2242, 2212, 2212, 3363, 3363, 3363, 3363, 4424, 4424, 1121, 4424, 5455, 5155, 5455, 5455, 6366, 6366, 6366, 6366, 
1151, 6656, 1151, 1151, 2212, 2262, 2212, 2212, 3313, 3313, 3313, 3313, 4424, 4424, 3323, 4424, 5455, 5355, 5455, 5455, 6466, 6466, 6466, 6466, 
1151, 6666, 1151, 1151, 2212, 2212, 2212, 2212, 3313, 3313, 3353, 3313, 4424, 4424, 3333, 4424, 5455, 5455, 5455, 5455, 6466, 6466, 6266, 6466, 
1161, 1121, 1121, 1121, 6646, 2242, 2242, 2242, 2222, 3333, 3333, 3333, 4454, 4454, 4454, 4434, 3133, 5155, 5155, 5155, 5555, 6666, 6666, 6666, 
1161, 1141, 1141, 3343, 2252, 2252, 2252, 2252, 4334, 4334, 4334, 4334, 6616, 4414, 4414, 4434, 5255, 5255, 5255, 5255, 6666, 6666, 6666, 6666, 
1161, 1151, 1151, 1151, 2212, 2212, 2212, 3313, 3333, 3333, 3333, 5555, 4424, 4424, 4424, 4434, 5455, 5455, 5455, 6466, 6666, 6666, 6666, 2222, 
1161, 1161, 1161, 1161, 3313, 2222, 2222, 2222, 5555, 3313, 3313, 3313, 4444, 4444, 3333, 4444, 6466, 5555, 5555, 5555, 2222, 6466, 6466, 6466, 
1161, 1161, 1161, 1161, 6646, 2222, 2222, 2222, 2222, 3133, 3133, 3133, 4444, 3333, 4444, 4444, 3133, 5555, 5555, 5555, 5555, 6646, 6646, 6646, 
1211, 1211, 1211, 1211, 2422, 2422, 2422, 2422, 3333, 3333, 3333, 3333, 4544, 4544, 4544, 4544, 1511, 1511, 1511, 1511, 6666, 6666, 6666, 6666, 
1211, 1211, 1211, 1211, 2422, 2422, 2422, 2422, 3333, 3333, 3333, 3333, 4544, 4544, 4544, 4544, 2512, 2512, 2512, 2512, 6666, 6666, 6666, 6666, 
1211, 1211, 1211, 1211, 2422, 2422, 2422, 2422, 3333, 3333, 3333, 3333, 4544, 4544, 4544, 4544, 4514, 4514, 4514, 4514, 6666, 6666, 6666, 6666, 
1211, 1211, 1211, 1211, 2422, 2422, 2422, 3333, 3333, 3333, 3333, 5515, 4444, 4444, 5555, 4444, 5515, 5515, 5515, 6666, 6666, 6666, 6666, 2422, 
1211, 1211, 1211, 1211, 2422, 2422, 2422, 5515, 3333, 3333, 3333, 6666, 4454, 4454, 4454, 4454, 5515, 5515, 5515, 2422, 6666, 6666, 6666, 3333, 
1211, 1211, 1211, 1211, 2422, 2422, 2422, 6666, 3333, 3333, 3333, 2422, 4444, 5555, 4444, 4444, 5515, 5515, 5515, 3333, 6666, 6666, 6666, 5515, 
1211, 1211, 1211, 1211, 2422, 2422, 3333, 2422, 3333, 3333, 5515, 3333, 4544, 4544, 4544, 4544, 5515, 5515, 6666, 5515, 6666, 6666, 2422, 6666, 
1211, 1211, 1211, 1211, 2422, 2422, 5515, 2422, 3333, 3333, 6666, 3333, 4544, 4544, 4544, 4544, 5515, 5515, 2422, 5515, 6666, 6666, 3333, 6666, 
1211, 1211, 1211, 1211, 2422, 2422, 6666, 2422, 3333, 3333, 2422, 3333, 4544, 4544, 4544, 4544, 5515, 5515, 3333, 5515, 6666, 6666, 5515, 6666, 
1211, 1211, 1211, 1211, 2422, 3333, 2422, 2422, 3333, 5515, 3333, 3333, 4544, 4544, 4544, 4544, 5515, 6666, 5515, 5515, 6666, 2422, 6666, 6666, 
1211, 1211, 1211, 1211, 2422, 5515, 2422, 2422, 3333, 6666, 3333, 3333, 4544, 4544, 4544, 4544, 5515, 2422, 5515, 5515, 6666, 3333, 6666, 6666, 
1211, 1211, 1211, 1211, 2422, 6666, 2422, 2422, 3333, 2422, 3333, 3333, 4544, 4544, 4544, 4544, 5515, 3333, 5515, 5515, 6666, 5515, 6666, 6666, 
1211, 1211, 1211, 1211, 5155, 2242, 2242, 2242, 6666, 3333, 3333, 3333, 4454, 4454, 4454, 4454, 2242, 5155, 5155, 5155, 3333, 6666, 6666, 6666, 
1211, 1211, 1211, 1311, 2422, 2422, 2422, 3433, 3333, 3333, 3333, 5555, 4644, 4544, 4544, 4544, 5515, 5515, 5515, 6616, 6666, 6666, 6666, 2222, 
1211, 1211, 1211, 1511, 2422, 2422, 2422, 5455, 3333, 3333, 3333, 6666, 4244, 4544, 4544, 4544, 5515, 5515, 5515, 2212, 6666, 6666, 6666, 3333, 
1211, 1211, 1211, 1611, 2422, 2422, 2422, 6466, 3333, 3333, 3333, 2222, 4344, 4544, 4544, 4544, 5515, 5515, 5515, 3313, 6666, 6666, 6666, 5555, 
1211, 1211, 1211, 3233, 2622, 2422, 2422, 2422, 4334, 4334, 4334, 4334, 6566, 4544, 4544, 4544, 5535, 5515, 5515, 5515, 6666, 6666, 6666, 6666, 
1211, 1211, 1211, 3333, 2222, 2222, 4444, 2222, 4334, 4334, 5335, 4334, 6666, 4544, 4544, 4544, 5515, 5515, 5515, 5515, 6666, 6666, 6666, 6666, 
1211, 1211, 1211, 4244, 2122, 2422, 2422, 2422, 6336, 6336, 6336, 6336, 1511, 4544, 4544, 4544, 5545, 5515, 5515, 5515, 6666, 6666, 6666, 6666, 
1211, 1211, 1211, 4454, 2242, 2242, 2242, 2242, 6336, 6336, 6336, 6336, 1121, 4544, 4544, 4544, 5515, 5515, 5515, 5515, 6666, 6666, 6666, 6666, 
1211, 1211, 1211, 6266, 2322, 2422, 2422, 2422, 1331, 1331, 1331, 1331, 3533, 4544, 4544, 4544, 5565, 5515, 5515, 5515, 6666, 6666, 6666, 6666, 
1211, 1211, 1211, 6666, 2222, 4444, 2222, 2222, 1331, 2332, 1331, 1331, 3333, 4544, 4544, 4544, 5515, 5515, 5515, 5515, 6666, 6666, 6666, 6666, 
1211, 1211, 1311, 1211, 2422, 2422, 3433, 2422, 3333, 3333, 5555, 3333, 4544, 4644, 4544, 4544, 5515, 5515, 6616, 5515, 6666, 6666, 2222, 6666, 
1211, 1211, 1511, 1211, 2422, 2422, 5455, 2422, 3333, 3333, 6666, 3333, 4544, 4244, 4544, 4544, 5515, 5515, 2212, 5515, 6666, 6666, 3333, 6666, 
1211, 1211, 1611, 1211, 2422, 2422, 6466, 2422, 3333, 3333, 2222, 3333, 4544, 4344, 4544, 4544, 5515, 5515, 3313, 5515, 6666, 6666, 5555, 6666, 
1211, 1211, 3233, 1211, 2422, 2622, 2422, 2422, 3433, 3433, 3433, 3433, 4544, 6566, 4544, 4544, 5515, 5535, 5515, 5515, 6616, 6616, 6616, 6616, 
1211, 1211, 3333, 1211, 2422, 2422, 2422, 2422, 3433, 3433, 3533, 3433, 4544, 6666, 4544, 4544, 5515, 5515, 5515, 5515, 6616, 6616, 6626, 6616, 
1211, 1211, 4244, 1211, 2422, 2122, 2422, 2422, 3633, 3633, 3633, 3633, 4544, 1511, 4544, 4544, 5515, 5545, 5515, 5515, 6636, 6636, 6636, 6636, 
1211, 1211, 4454, 1211, 2422, 2422, 2422, 2422, 3633, 3633, 3633, 3633, 4544, 1121, 4544, 4544, 5515, 5515, 5515, 5515, 6636, 6636, 6636, 6636, 
1211, 1211, 6266, 1211, 2422, 2322, 2422, 2422, 3133, 3133, 3133, 3133, 4544, 3533, 4544, 4544, 5515, 5565, 5515, 5515, 6646, 6646, 6646, 6646, 
1211, 1211, 6666, 1211, 2422, 2422, 2422, 2422, 3133, 3233, 3133, 3133, 4544, 3333, 4544, 4544, 5515, 5515, 5515, 5515, 6646, 6656, 6646, 6646, 
1211, 1311, 1211, 1211, 2422, 3433, 2422, 2422, 3333, 5555, 3333, 3333, 4544, 4544, 4644, 4544, 5515, 6616, 5515, 5515, 6666, 2222, 6666, 6666, 
1211, 1511, 1211, 1211, 2422, 5455, 2422, 2422, 3333, 6666, 3333, 3333, 4544, 4544, 4244, 4544, 5515, 2212, 5515, 5515, 6666, 3333, 6666, 6666, 
1211, 1511, 1511, 1511, 2122, 2122, 2122, 5155, 3333, 3333, 3333, 6666, 4244, 4244, 4244, 4544, 5545, 5545, 5545, 2242, 6666, 6666, 6666, 3333, 
1211, 1611, 1211, 1211, 2422, 6466, 2422, 2422, 3333, 2222, 3333, 3333, 4544, 4544, 4344, 4544, 5515, 3313, 5515, 5515, 6666, 5555, 6666, 6666, 
1211, 3233, 1211, 1211, 2422, 2422, 2622, 2422, 3343, 3343, 3343, 3343, 4544, 4544, 6566, 4544, 5515, 5515, 5535, 5515, 6166, 6166, 6166, 6166, 
1211, 3333, 1211, 1211, 2422, 2422, 2422, 2422, 3343, 3343, 3353, 3343, 4544, 4544, 6666, 4544, 5515, 5515, 5515, 5515, 6166, 6166, 6266, 6166, 
1211, 4244, 1211, 1211, 2422, 2422, 2122, 2422, 3363, 3363, 3363, 3363, 4544, 4544, 1511, 4544, 5515, 5515, 5545, 5515, 6366, 6366, 6366, 6366, 
1211, 4454, 1211, 1211, 2422, 2422, 2422, 2422, 3363, 3363, 3363, 3363, 4544, 4544, 1121, 4544, 5515, 5515, 5515, 5515, 6366, 6366, 6366, 6366, 
1211, 6266, 1211, 1211, 2422, 2422, 2322, 2422, 3313, 3313, 3313, 3313, 4544, 4544, 3533, 4544, 5515, 5515, 5565, 5515, 6466, 6466, 6466, 6466, 
1211, 6666, 1211, 1211, 2422, 2422, 2422, 2422, 3313, 3323, 3313, 3313, 4544, 4544, 3333, 4544, 5515, 5515, 5515, 5515, 6466, 6566, 6466, 6466, 
1221, 1221, 1221, 1221, 2442, 2442, 2442, 2442, 3333, 3333, 3333, 3333, 4554, 4554, 4554, 4554, 5115, 5115, 5115, 5115, 6666, 6666, 6666, 6666, 
1241, 1241, 1241, 1241, 2452, 2452, 2452, 2452, 3333, 3333, 3333, 3333, 4514, 4514, 4514, 4514, 5215, 5215, 5215, 5215, 6666, 6666, 6666, 6666, 
1251, 1251, 1251, 1251, 2412, 2412, 2412, 2412, 3333, 3333, 3333, 3333, 4524, 4524, 4524, 4524, 5415, 5415, 5415, 5415, 6666, 6666, 6666, 6666, 
1311, 1211, 1211, 1211, 3433, 2422, 2422, 2422, 5555, 3333, 3333, 3333, 4544, 4544, 4544, 4644, 6616, 5515, 5515, 5515, 2222, 6666, 6666, 6666, 
1311, 1311, 1311, 1311, 3433, 2222, 2222, 2222, 5555, 3433, 3433, 3433, 4444, 6666, 4444, 4444, 6616, 5555, 5555, 5555, 2222, 6616, 6616, 6616, 
1311, 1311, 1311, 1311, 6166, 2222, 2222, 2222, 2222, 3343, 3343, 3343, 4444, 4444, 6666, 4444, 3343, 5555, 5555, 5555, 5555, 6166, 6166, 6166, 
1311, 1411, 1411, 6466, 2522, 2522, 2522, 2522, 1331, 1331, 1331, 1331, 3133, 4144, 4144, 4644, 5525, 5525, 5525, 5525, 6666, 6666, 6666, 6666, 
1311, 1511, 1511, 1511, 2122, 2122, 2122, 6166, 3333, 3333, 3333, 2222, 4244, 4244, 4244, 4644, 5545, 5545, 5545, 3343, 6666, 6666, 6666, 5555, 
1411, 1111, 4444, 1411, 2522, 2522, 2522, 2522, 3633, 3633, 3633, 3633, 4144, 1111, 4444, 4144, 5525, 5525, 5525, 5525, 6636, 6636, 6636, 6636, 
1411, 1311, 6466, 1411, 2522, 2522, 2522, 2522, 3133, 3133, 3133, 3133, 4144, 3133, 4644, 4144, 5525, 5525, 5525, 5525, 6646, 6646, 6646, 6646, 
1411, 1411, 1411, 1411, 2222, 2522, 2522, 5555, 3333, 3333, 3333, 6666, 4144, 4144, 4144, 4144, 5555, 5525, 5525, 2222, 6666, 6666, 6666, 3333, 
1411, 1411, 1411, 1411, 2322, 2522, 2522, 6566, 3333, 3333, 3333, 2222, 4144, 4144, 4144, 4144, 5565, 5525, 5525, 3323, 6666, 6666, 6666, 5555, 
1411, 1411, 1411, 1411, 2522, 2222, 5555, 2522, 3333, 3333, 6666, 3333, 4144, 4144, 4144, 4144, 5525, 5555, 2222, 5525, 6666, 6666, 3333, 6666, 
1411, 1411, 1411, 1411, 2522, 2322, 6566, 2522, 3333, 3333, 2222, 3333, 4144, 4144, 4144, 4144, 5525, 5565, 3323, 5525, 6666, 6666, 5555, 6666, 
1411, 1411, 1411, 1411, 2522, 2522, 2522, 2522, 3333, 3333, 3333, 3333, 4144, 4144, 4144, 4144, 1521, 1521, 1521, 1521, 6666, 6666, 6666, 6666, 
1411, 1411, 1411, 1411, 2522, 2522, 2522, 2522, 3333, 3333, 3333, 3333, 4144, 4144, 4144, 4144, 2522, 2522, 2522, 2522, 6666, 6666, 6666, 6666, 
1411, 1411, 1411, 1411, 2522, 2522, 2522, 2522, 3333, 3333, 3333, 3333, 4144, 4144, 4144, 4144, 4524, 4524, 4524, 4524, 6666, 6666, 6666, 6666, 
1411, 1411, 1411, 1411, 2522, 2522, 2522, 3333, 3333, 3333, 3333, 5525, 4444, 4444, 1111, 4444, 5525, 5525, 5525, 6666, 6666, 6666, 6666, 2522, 
1411, 1411, 1411, 1411, 2522, 2522, 2522, 5525, 3333, 3333, 3333, 6666, 4414, 4414, 4414, 4414, 5525, 5525, 5525, 2522, 6666, 6666, 6666, 3333, 
1411, 1411, 1411, 1411, 2522, 2522, 2522, 6666, 3333, 3333, 3333, 2522, 4444, 1111, 4444, 4444, 5525, 5525, 5525, 3333, 6666, 6666, 6666, 5525, 
1411, 1411, 1411, 1411, 2522, 2522, 3333, 2522, 3333, 3333, 5525, 3333, 4144, 4144, 4144, 4144, 5525, 5525, 6666, 5525, 6666, 6666, 2522, 6666, 
1411, 1411, 1411, 1411, 2522, 2522, 5525, 2522, 3333, 3333, 6666, 3333, 4144, 4144, 4144, 4144, 5525, 5525, 2522, 5525, 6666, 6666, 3333, 6666, 
1411, 1411, 1411, 1411, 2522, 2522, 6666, 2522, 3333, 3333, 2522, 3333, 4144, 4144, 4144, 4144, 5525, 5525, 3333, 5525, 6666, 6666, 5525, 6666, 
1411, 1411, 1411, 1411, 2522, 2622, 3533, 2522, 3333, 3333, 5555, 3333, 4144, 4144, 4144, 4144, 5525, 5535, 6626, 5525, 6666, 6666, 2222, 6666, 
1411, 1411, 1411, 1411, 2522, 3333, 2522, 2522, 3333, 5525, 3333, 3333, 4144, 4144, 4144, 4144, 5525, 6666, 5525, 5525, 6666, 2522, 6666, 6666, 
1411, 1411, 1411, 1411, 2522, 3533, 2622, 2522, 3333, 5555, 3333, 3333, 4144, 4144, 4144, 4144, 5525, 6626, 5535, 5525, 6666, 2222, 6666, 6666, 
1411, 1411, 1411, 1411, 2522, 5525, 2522, 2522, 3333, 6666, 3333, 3333, 4144, 4144, 4144, 4144, 5525, 2522, 5525, 5525, 6666, 3333, 6666, 6666, 
1411, 1411, 1411, 1411, 2522, 5555, 2222, 2522, 3333, 6666, 3333, 3333, 4144, 4144, 4144, 4144, 5525, 2222, 5555, 5525, 6666, 3333, 6666, 6666, 
1411, 1411, 1411, 1411, 2522, 6566, 2322, 2522, 3333, 2222, 3333, 3333, 4144, 4144, 4144, 4144, 5525, 3323, 5565, 5525, 6666, 5555, 6666, 6666, 
1411, 1411, 1411, 1411, 2522, 6666, 2522, 2522, 3333, 2522, 3333, 3333, 4144, 4144, 4144, 4144, 5525, 3333, 5525, 5525, 6666, 5525, 6666, 6666, 
1411, 1411, 1411, 1411, 2622, 2522, 2522, 3533, 3333, 3333, 3333, 5555, 4144, 4144, 4144, 4144, 5535, 5525, 5525, 6626, 6666, 6666, 6666, 2222, 
1411, 1411, 1411, 1411, 3533, 2522, 2522, 2622, 5555, 3333, 3333, 3333, 4144, 4144, 4144, 4144, 6626, 5525, 5525, 5535, 2222, 6666, 6666, 6666, 
1411, 1411, 1411, 1411, 3633, 2222, 2222, 2222, 5555, 3633, 3633, 3633, 4444, 1111, 4444, 4444, 6636, 5555, 5555, 5555, 2222, 6636, 6636, 6636, 
1411, 1411, 1411, 1411, 5255, 2252, 2252, 2252, 6666, 3333, 3333, 3333, 4414, 4414, 4414, 4414, 2252, 5255, 5255, 5255, 3333, 6666, 6666, 6666, 
1411, 1411, 1411, 1411, 5555, 2522, 2522, 2222, 6666, 3333, 3333, 3333, 4144, 4144, 4144, 4144, 2222, 5525, 5525, 5555, 3333, 6666, 6666, 6666, 
1411, 1411, 1411, 1411, 6366, 2222, 2222, 2222, 2222, 3363, 3363, 3363, 4444, 4444, 1111, 4444, 3363, 5555, 5555, 5555, 5555, 6366, 6366, 6366, 
1411, 1411, 1411, 1411, 6566, 2522, 2522, 2322, 2222, 3333, 3333, 3333, 4144, 4144, 4144, 4144, 3323, 5525, 5525, 5565, 5555, 6666, 6666, 6666, 
1411, 1411, 1411, 3333, 2222, 2222, 5555, 2222, 4334, 4334, 1331, 4334, 6666, 4144, 4144, 4144, 5525, 5525, 5525, 5525, 6666, 6666, 6666, 6666, 
1411, 1411, 1411, 4414, 2252, 2252, 2252, 2252, 6336, 6336, 6336, 6336, 1141, 4144, 4144, 4144, 5525, 5525, 5525, 5525, 6666, 6666, 6666, 6666, 
1411, 1411, 1411, 6666, 2222, 5555, 2222, 2222, 1331, 4334, 1331, 1331, 3333, 4144, 4144, 4144, 5525, 5525, 5525, 5525, 6666, 6666, 6666, 6666, 
1411, 1411, 3333, 1411, 2522, 2522, 2522, 2522, 3433, 3433, 3133, 3433, 4144, 6666, 4144, 4144, 5525, 5525, 5525, 5525, 6616, 6616, 6646, 6616, 
1411, 1411, 4414, 1411, 2522, 2522, 2522, 2522, 3633, 3633, 3633, 3633, 4144, 1141, 4144, 4144, 5525, 5525, 5525, 5525, 6636, 6636, 6636, 6636, 
1411, 1411, 6666, 1411, 2522, 2522, 2522, 2522, 3133, 3433, 3133, 3133, 4144, 3333, 4144, 4144, 5525, 5525, 5525, 5525, 6646, 6616, 6646, 6646, 
1411, 1611, 3433, 1411, 2522, 2522, 2522, 2522, 3433, 3433, 3433, 3433, 4144, 6166, 4344, 4144, 5525, 5525, 5525, 5525, 6616, 6616, 6616, 6616, 
1411, 3333, 1411, 1411, 2522, 2522, 2522, 2522, 3343, 3343, 3313, 3343, 4144, 4144, 6666, 4144, 5525, 5525, 5525, 5525, 6166, 6166, 6466, 6166, 
1411, 3433, 1611, 1411, 2522, 2522, 2522, 2522, 3343, 3343, 3343, 3343, 4144, 4344, 6166, 4144, 5525, 5525, 5525, 5525, 6166, 6166, 6166, 6166, 
1411, 4414, 1411, 1411, 2522, 2522, 2522, 2522, 3363, 3363, 3363, 3363, 4144, 4144, 1141, 4144, 5525, 5525, 5525, 5525, 6366, 6366, 6366, 6366, 
1411, 4444, 1111, 1411, 2522, 2522, 2522, 2522, 3363, 3363, 3363, 3363, 4144, 4444, 1111, 4144, 5525, 5525, 5525, 5525, 6366, 6366, 6366, 6366, 
1411, 6466, 1311, 1411, 2522, 2522, 2522, 2522, 3313, 3313, 3313, 3313, 4144, 4644, 3133, 4144, 5525, 5525, 5525, 5525, 6466, 6466, 6466, 6466, 
1411, 6666, 1411, 1411, 2522, 2522, 2522, 2522, 3313, 3343, 3313, 3313, 4144, 4144, 3333, 4144, 5525, 5525, 5525, 5525, 6466, 6166, 6466, 6466, 
1421, 1421, 1421, 1421, 2542, 2542, 2542, 2542, 3333, 3333, 3333, 3333, 4154, 4154, 4154, 4154, 5125, 5125, 5125, 5125, 6666, 6666, 6666, 6666, 
1441, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 4114, 5555, 5555, 5555, 5555, 3663, 3663, 3663, 3663, 
1441, 1441, 1441, 1441, 2552, 2552, 2552, 2552, 3333, 3333, 3333, 3333, 4114, 4114, 4114, 4114, 5225, 5225, 5225, 5225, 6666, 6666, 6666, 6666, 
1451, 1451, 1451, 1451, 2512, 2512, 2512, 2512, 3333, 3333, 3333, 3333, 4124, 4124, 4124, 4124, 5425, 5425, 5425, 5425, 6666, 6666, 6666, 6666, 
1511, 1211, 1211, 1211, 5455, 2422, 2422, 2422, 6666, 3333, 3333, 3333, 4544, 4544, 4544, 4244, 2212, 5515, 5515, 5515, 3333, 6666, 6666, 6666, 
1511, 1211, 1511, 1511, 2122, 2122, 5155, 2122, 3333, 3333, 6666, 3333, 4244, 4244, 4544, 4244, 5545, 5545, 2242, 5545, 6666, 6666, 3333, 6666, 
1511, 1311, 1511, 1511, 2122, 2122, 6166, 2122, 3333, 3333, 2222, 3333, 4244, 4244, 4644, 4244, 5545, 5545, 3343, 5545, 6666, 6666, 5555, 6666, 
1511, 1511, 1211, 1511, 2122, 5155, 2122, 2122, 3333, 6666, 3333, 3333, 4244, 4544, 4244, 4244, 5545, 2242, 5545, 5545, 6666, 3333, 6666, 6666, 
1511, 1511, 1311, 1511, 2122, 6166, 2122, 2122, 3333, 2222, 3333, 3333, 4244, 4644, 4244, 4244, 5545, 3343, 5545, 5545, 6666, 5555, 6666, 6666, 
1511, 1511, 1511, 1211, 5155, 2122, 2122, 2122, 6666, 3333, 3333, 3333, 4544, 4244, 4244, 4244, 2242, 5545, 5545, 5545, 3333, 6666, 6666, 6666, 
1511, 1511, 1511, 1311, 6166, 2122, 2122, 2122, 2222, 3333, 3333, 3333, 4644, 4244, 4244, 4244, 3343, 5545, 5545, 5545, 5555, 6666, 6666, 6666, 
1511, 1511, 1511, 1511, 2122, 2122, 2122, 2122, 3333, 3333, 3333, 3333, 4244, 4244, 4244, 4244, 1541, 1541, 1541, 1541, 6666, 6666, 6666, 6666, 
1511, 1511, 1511, 1511, 2122, 2122, 2122, 2122, 3333, 3333, 3333, 3333, 4244, 4244, 4244, 4244, 2542, 2542, 2542, 2542, 6666, 6666, 6666, 6666, 
1511, 1511, 1511, 1511, 2122, 2122, 2122, 2122, 3333, 3333, 3333, 3333, 4244, 4244, 4244, 4244, 4544, 4544, 4544, 4544, 6666, 6666, 6666, 6666, 
1511, 1511, 1511, 1511, 2122, 2122, 2122, 3333, 3333, 3333, 3333, 5545, 4444, 4444, 2222, 4444, 5545, 5545, 5545, 6666, 6666, 6666, 6666, 2122, 
1511, 1511, 1511, 1511, 2122, 2122, 2122, 5545, 3333, 3333, 3333, 6666, 4424, 4424, 4424, 4424, 5545, 5545, 5545, 2122, 6666, 6666, 6666, 3333, 
1511, 1511, 1511, 1511, 2122, 2122, 2122, 6666, 3333, 3333, 3333, 2122, 4444, 2222, 4444, 4444, 5545, 5545, 5545, 3333, 6666, 6666, 6666, 5545, 
1511, 1511, 1511, 1511, 2122, 2122, 3333, 2122, 3333, 3333, 5545, 3333, 4244, 4244, 4244, 4244, 5545, 5545, 6666, 5545, 6666, 6666, 2122, 6666, 
1511, 1511, 1511, 1511, 2122, 2122, 5545, 2122, 3333, 3333, 6666, 3333, 4244, 4244, 4244, 4244, 5545, 5545, 2122, 5545, 6666, 6666, 3333, 6666, 
1511, 1511, 1511, 1511, 2122, 2122, 6666, 2122, 3333, 3333, 2122, 3333, 4244, 4244, 4244, 4244, 5545, 5545, 3333, 5545, 6666, 6666, 5545, 6666, 
1511, 1511, 1511, 1511, 2122, 3333, 2122, 2122, 3333, 5545, 3333, 3333, 4244, 4244, 4244, 4244, 5545, 6666, 5545, 5545, 6666, 2122, 6666, 6666, 
1511, 1511, 1511, 1511, 2122, 5545, 2122, 2122, 3333, 6666, 3333, 3333, 4244, 4244, 4244, 4244, 5545, 2122, 5545, 5545, 6666, 3333, 6666, 6666, 
1511, 1511, 1511, 1511, 2122, 6666, 2122, 2122, 3333, 2122, 3333, 3333, 4244, 4244, 4244, 4244, 5545, 3333, 5545, 5545, 6666, 5545, 6666, 6666, 
1511, 1511, 1511, 1511, 5455, 2212, 2212, 2212, 6666, 3333, 3333, 3333, 4424, 4424, 4424, 4424, 2212, 5455, 5455, 5455, 3333, 6666, 6666, 6666, 
1511, 1511, 1511, 1611, 3133, 2122, 2122, 2122, 5555, 3333, 3333, 3333, 4344, 4244, 4244, 4244, 6646, 5545, 5545, 5545, 2222, 6666, 6666, 6666, 
1511, 1511, 1511, 3333, 2222, 2222, 1111, 2222, 4334, 4334, 2332, 4334, 6666, 4244, 4244, 4244, 5545, 5545, 5545, 5545, 6666, 6666, 6666, 6666, 
1511, 1511, 1511, 3533, 2122, 2122, 2122, 2322, 4334, 4334, 4334, 4334, 6266, 4244, 4244, 4244, 5545, 5545, 5545, 5565, 6666, 6666, 6666, 6666, 
1511, 1511, 1511, 4424, 2212, 2212, 2212, 2212, 6336, 6336, 6336, 6336, 1151, 4244, 4244, 4244, 5545, 5545, 5545, 5545, 6666, 6666, 6666, 6666, 
1511, 1511, 1511, 4544, 2122, 2122, 2122, 2422, 6336, 6336, 6336, 6336, 1211, 4244, 4244, 4244, 5545, 5545, 5545, 5515, 6666, 6666, 6666, 6666, 
1511, 1511, 1511, 6566, 2122, 2122, 2122, 2622, 1331, 1331, 1331, 1331, 3233, 4244, 4244, 4244, 5545, 5545, 5545, 5535, 6666, 6666, 6666, 6666, 
1511, 1511, 1511, 6666, 2222, 1111, 2222, 2222, 1331, 5335, 1331, 1331, 3333, 4244, 4244, 4244, 5545, 5545, 5545, 5545, 6666, 6666, 6666, 6666, 
1511, 1511, 1611, 1511, 2122, 3133, 2122, 2122, 3333, 5555, 3333, 3333, 4244, 4344, 4244, 4244, 5545, 6646, 5545, 5545, 6666, 2222, 6666, 6666, 
1511, 1511, 3333, 1511, 2122, 2122, 2122, 2122, 3433, 3433, 3233, 3433, 4244, 6666, 4244, 4244, 5545, 5545, 5545, 5545, 6616, 6616, 6656, 6616, 
1511, 1511, 3533, 1511, 2122, 2122, 2322, 2122, 3433, 3433, 3433, 3433, 4244, 6266, 4244, 4244, 5545, 5545, 5565, 5545, 6616, 6616, 6616, 6616, 
1511, 1511, 4424, 1511, 2122, 2122, 2122, 2122, 3633, 3633, 3633, 3633, 4244, 1151, 4244, 4244, 5545, 5545, 5545, 5545, 6636, 6636, 6636, 6636, 
1511, 1511, 4544, 1511, 2122, 2122, 2422, 2122, 3633, 3633, 3633, 3633, 4244, 1211, 4244, 4244, 5545, 5545, 5515, 5545, 6636, 6636, 6636, 6636, 
1511, 1511, 6566, 1511, 2122, 2122, 2622, 2122, 3133, 3133, 3133, 3133, 4244, 3233, 4244, 4244, 5545, 5545, 5535, 5545, 6646, 6646, 6646, 6646, 
1511, 1511, 6666, 1511, 2122, 2122, 2122, 2122, 3133, 3533, 3133, 3133, 4244, 3333, 4244, 4244, 5545, 5545, 5545, 5545, 6646, 6626, 6646, 6646, 
1511, 1611, 1511, 1511, 2122, 2122, 3133, 2122, 3333, 3333, 5555, 3333, 4244, 4244, 4344, 4244, 5545, 5545, 6646, 5545, 6666, 6666, 2222, 6666, 
1511, 3333, 1511, 1511, 2122, 2122, 2122, 2122, 3343, 3343, 3323, 3343, 4244, 4244, 6666, 4244, 5545, 5545, 5545, 5545, 6166, 6166, 6566, 6166, 
1511, 3533, 1511, 1511, 2122, 2322, 2122, 2122, 3343, 3343, 3343, 3343, 4244, 4244, 6266, 4244, 5545, 5565, 5545, 5545, 6166, 6166, 6166, 6166, 
1511, 4424, 1511, 1511, 2122, 2122, 2122, 2122, 3363, 3363, 3363, 3363, 4244, 4244, 1151, 4244, 5545, 5545, 5545, 5545, 6366, 6366, 6366, 6366, 
1511, 4544, 1511, 1511, 2122, 2422, 2122, 2122, 3363, 3363, 3363, 3363, 4244, 4244, 1211, 4244, 5545, 5515, 5545, 5545, 6366, 6366, 6366, 6366, 
1511, 6566, 1511, 1511, 2122, 2622, 2122, 2122, 3313, 3313, 3313, 3313, 4244, 4244, 3233, 4244, 5545, 5535, 5545, 5545, 6466, 6466, 6466, 6466, 
1511, 6666, 1511, 1511, 2122, 2122, 2122, 2122, 3313, 3353, 3313, 3313, 4244, 4244, 3333, 4244, 5545, 5545, 5545, 5545, 6466, 6266, 6466, 6466, 
1521, 1521, 1521, 1521, 2142, 2142, 2142, 2142, 3333, 3333, 3333, 3333, 4254, 4254, 4254, 4254, 5145, 5145, 5145, 5145, 6666, 6666, 6666, 6666, 
1541, 1541, 1541, 1541, 2152, 2152, 2152, 2152, 3333, 3333, 3333, 3333, 4214, 4214, 4214, 4214, 5245, 5245, 5245, 5245, 6666, 6666, 6666, 6666, 
1551, 1551, 1551, 1551, 2112, 2112, 2112, 2112, 3333, 3333, 3333, 3333, 4224, 4224, 4224, 4224, 5445, 5445, 5445, 5445, 6666, 6666, 6666, 6666, 
1611, 1211, 1211, 1211, 6466, 2422, 2422, 2422, 2222, 3333, 3333, 3333, 4544, 4544, 4544, 4344, 3313, 5515, 5515, 5515, 5555, 6666, 6666, 6666, 
1611, 1411, 1411, 3433, 2522, 2522, 2522, 2522, 4334, 4334, 4334, 4334, 6166, 4144, 4144, 4344, 5525, 5525, 5525, 5525, 6666, 6666, 6666, 6666, 
1611, 1511, 1511, 1511, 2122, 2122, 2122, 3133, 3333, 3333, 3333, 5555, 4244, 4244, 4244, 4344, 5545, 5545, 5545, 6646, 6666, 6666, 6666, 2222, 
1611, 1611, 1611, 1611, 3133, 2222, 2222, 2222, 5555, 3133, 3133, 3133, 4444, 3333, 4444, 4444, 6646, 5555, 5555, 5555, 2222, 6646, 6646, 6646, 
1611, 1611, 1611, 1611, 6466, 2222, 2222, 2222, 2222, 3313, 3313, 3313, 4444, 4444, 3333, 4444, 3313, 5555, 5555, 5555, 5555, 6466, 6466, 6466, 
2112, 2112, 2112, 2112, 1551, 2222, 2222, 2222, 6666, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 2222, 1551, 1551, 1551, 3333, 6666, 6666, 6666, 
2112, 2112, 2112, 2112, 4224, 3333, 4224, 4224, 3333, 5555, 3333, 3333, 5445, 5445, 5445, 5445, 5555, 6666, 5555, 5555, 6666, 4224, 6666, 6666, 
2112, 2112, 2112, 2112, 4224, 4224, 3333, 4224, 3333, 3333, 5555, 3333, 5445, 5445, 5445, 5445, 5555, 5555, 6666, 5555, 6666, 6666, 4224, 6666, 
2112, 2112, 2112, 2112, 4224, 4224, 4224, 3333, 3333, 3333, 3333, 5555, 4444, 4444, 4444, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 4224, 
2112, 2112, 2112, 2112, 4224, 4224, 4224, 4224, 3333, 3333, 3333, 3333, 5445, 5445, 5445, 5445, 1551, 1551, 1551, 1551, 6666, 6666, 6666, 6666, 
2112, 2112, 2112, 2112, 4224, 4224, 4224, 4224, 3333, 3333, 3333, 3333, 5445, 5445, 5445, 5445, 2552, 2552, 2552, 2552, 6666, 6666, 6666, 6666, 
2112, 2112, 2112, 2112, 4224, 4224, 4224, 4224, 3333, 3333, 3333, 3333, 5445, 5445, 5445, 5445, 4554, 4554, 4554, 4554, 6666, 6666, 6666, 6666, 
2112, 2112, 2112, 2112, 4224, 4224, 4224, 5555, 3333, 3333, 3333, 6666, 4444, 4444, 4444, 4444, 5555, 5555, 5555, 4224, 6666, 6666, 6666, 3333, 
2112, 2112, 2112, 2112, 4224, 4224, 4224, 6666, 3333, 3333, 3333, 4224, 5555, 4444, 4444, 4444, 5555, 5555, 5555, 3333, 6666, 6666, 6666, 5555, 
2112, 2112, 2112, 2112, 4224, 4224, 5555, 4224, 3333, 3333, 6666, 3333, 5445, 5445, 5445, 5445, 5555, 5555, 4224, 5555, 6666, 6666, 3333, 6666, 
2112, 2112, 2112, 2112, 4224, 4224, 6666, 4224, 3333, 3333, 4224, 3333, 5445, 5445, 5445, 5445, 5555, 5555, 3333, 5555, 6666, 6666, 5555, 6666, 
2112, 2112, 2112, 2112, 4224, 5555, 4224, 4224, 3333, 6666, 3333, 3333, 5445, 5445, 5445, 5445, 5555, 4224, 5555, 5555, 6666, 3333, 6666, 6666, 
2112, 2112, 2112, 2112, 4224, 6666, 4224, 4224, 3333, 4224, 3333, 3333, 5445, 5445, 5445, 5445, 5555, 3333, 5555, 5555, 6666, 5555, 6666, 6666, 
2112, 2112, 2112, 2332, 6226, 4224, 4224, 4224, 4334, 4334, 4334, 4334, 5665, 5445, 5445, 5445, 5555, 5555, 5555, 5555, 1111, 6666, 6666, 6666, 
2112, 2112, 2112, 2442, 1221, 4224, 4224, 4224, 6336, 6336, 6336, 6336, 5115, 5445, 5445, 5445, 5555, 5555, 5555, 5555, 3333, 6666, 6666, 6666, 
2112, 2112, 2112, 2662, 3223, 4224, 4224, 4224, 1331, 1331, 1331, 1331, 5335, 5445, 5445, 5445, 5555, 5555, 5555, 5555, 4444, 6666, 6666, 6666, 
2112, 2112, 2112, 3113, 4224, 4224, 4224, 4334, 3333, 3333, 3333, 5555, 6446, 5445, 5445, 5445, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 6666, 
2112, 2112, 2112, 3333, 2222, 2222, 2222, 4444, 4334, 4334, 4334, 5335, 6666, 5445, 5445, 5445, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
2112, 2112, 2112, 4444, 2222, 2222, 2222, 2222, 6336, 6336, 6336, 6336, 1111, 5445, 5445, 5445, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
2112, 2112, 2112, 5115, 4224, 4224, 4224, 4554, 3333, 3333, 3333, 6666, 2442, 5445, 5445, 5445, 5555, 5555, 5555, 2222, 6666, 6666, 6666, 6666, 
2112, 2112, 2112, 6116, 4224, 4224, 4224, 4664, 3333, 3333, 3333, 2222, 3443, 5445, 5445, 5445, 5555, 5555, 5555, 3333, 6666, 6666, 6666, 6666, 
2112, 2112, 2112, 6666, 4444, 2222, 2222, 2222, 2332, 1331, 1331, 1331, 3333, 5445, 5445, 5445, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
2112, 2112, 2332, 2112, 4224, 6226, 4224, 4224, 3433, 3433, 3433, 3433, 5445, 5665, 5445, 5445, 5555, 5555, 5555, 5555, 6666, 1111, 6666, 6666, 
2112, 2112, 2442, 2112, 4224, 1221, 4224, 4224, 3633, 3633, 3633, 3633, 5445, 5115, 5445, 5445, 5555, 5555, 5555, 5555, 6666, 3333, 6666, 6666, 
2112, 2112, 2662, 2112, 4224, 3223, 4224, 4224, 3133, 3133, 3133, 3133, 5445, 5335, 5445, 5445, 5555, 5555, 5555, 5555, 6666, 4444, 6666, 6666, 
2112, 2112, 3113, 2112, 4224, 4224, 4334, 4224, 3333, 3333, 5555, 3333, 5445, 6446, 5445, 5445, 5555, 5555, 6666, 5555, 6626, 6626, 6626, 6626, 
2112, 2112, 3333, 2112, 4224, 4224, 4224, 4224, 3433, 3433, 3433, 3533, 5445, 6666, 5445, 5445, 5555, 5555, 5555, 5555, 6616, 6616, 6616, 6626, 
2112, 2112, 4444, 2112, 4224, 4224, 4224, 4224, 3633, 3633, 3633, 3633, 5445, 1111, 5445, 5445, 5555, 5555, 5555, 5555, 6636, 6636, 6636, 6636, 
2112, 2112, 5115, 2112, 4224, 4224, 4554, 4224, 3333, 3333, 6666, 3333, 5445, 2442, 5445, 5445, 5555, 5555, 2222, 5555, 6636, 6636, 6636, 6636, 
2112, 2112, 6116, 2112, 4224, 4224, 4664, 4224, 3333, 3333, 2222, 3333, 5445, 3443, 5445, 5445, 5555, 5555, 3333, 5555, 6656, 6656, 6656, 6656, 
2112, 2112, 6666, 2112, 4224, 4224, 4224, 4224, 3233, 3133, 3133, 3133, 5445, 3333, 5445, 5445, 5555, 5555, 5555, 5555, 6656, 6646, 6646, 6646, 
2112, 2332, 2112, 2112, 4224, 4224, 6226, 4224, 3343, 3343, 3343, 3343, 5445, 5445, 5665, 5445, 5555, 5555, 5555, 5555, 6666, 6666, 1111, 6666, 
2112, 2442, 2112, 2112, 4224, 4224, 1221, 4224, 3363, 3363, 3363, 3363, 5445, 5445, 5115, 5445, 5555, 5555, 5555, 5555, 6666, 6666, 3333, 6666, 
2112, 2662, 2112, 2112, 4224, 4224, 3223, 4224, 3313, 3313, 3313, 3313, 5445, 5445, 5335, 5445, 5555, 5555, 5555, 5555, 6666, 6666, 4444, 6666, 
2112, 3113, 2112, 2112, 4224, 4334, 4224, 4224, 3333, 5555, 3333, 3333, 5445, 5445, 6446, 5445, 5555, 6666, 5555, 5555, 6266, 6266, 6266, 6266, 
2112, 3333, 2112, 2112, 4224, 4224, 4224, 4224, 3343, 3343, 3343, 3353, 5445, 5445, 6666, 5445, 5555, 5555, 5555, 5555, 6166, 6166, 6166, 6266, 
2112, 4444, 2112, 2112, 4224, 4224, 4224, 4224, 3363, 3363, 3363, 3363, 5445, 5445, 1111, 5445, 5555, 5555, 5555, 5555, 6366, 6366, 6366, 6366, 
2112, 5115, 2112, 2112, 4224, 4554, 4224, 4224, 3333, 6666, 3333, 3333, 5445, 5445, 2442, 5445, 5555, 2222, 5555, 5555, 6366, 6366, 6366, 6366, 
2112, 5115, 5115, 5115, 1221, 1221, 1221, 1551, 3333, 3333, 3333, 6666, 2442, 2442, 2442, 5445, 5555, 5555, 5555, 2222, 3663, 3663, 3663, 3663, 
2112, 6116, 2112, 2112, 4224, 4664, 4224, 4224, 3333, 2222, 3333, 3333, 5445, 5445, 3443, 5445, 5555, 3333, 5555, 5555, 6566, 6566, 6566, 6566, 
2112, 6666, 2112, 2112, 4224, 4224, 4224, 4224, 3323, 3313, 3313, 3313, 5445, 5445, 3333, 5445, 5555, 5555, 5555, 5555, 6566, 6466, 6466, 6466, 
2122, 2122, 2122, 2122, 4244, 4244, 4244, 4244, 3333, 3333, 3333, 3333, 5455, 5455, 5455, 5455, 5155, 5155, 5155, 5155, 6666, 6666, 6666, 6666, 
2142, 2142, 2142, 2142, 4254, 4254, 4254, 4254, 3333, 3333, 3333, 3333, 5415, 5415, 5415, 5415, 5255, 5255, 5255, 5255, 6666, 6666, 6666, 6666, 
2152, 2152, 2152, 2152, 4214, 4214, 4214, 4214, 3333, 3333, 3333, 3333, 5425, 5425, 5425, 5425, 5455, 5455, 5455, 5455, 6666, 6666, 6666, 6666, 
2212, 2212, 2212, 2212, 4424, 4424, 4424, 4424, 3333, 3333, 3333, 3333, 5545, 5545, 5545, 5545, 5515, 5515, 5515, 5515, 6666, 6666, 6666, 6666, 
2222, 1111, 1111, 1111, 3333, 4224, 4224, 4224, 5555, 3333, 3333, 3333, 5445, 5445, 5445, 5445, 6666, 5555, 5555, 5555, 4224, 6666, 6666, 6666, 
2222, 1111, 1111, 1111, 6666, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 3333, 1551, 1551, 1551, 1551, 6666, 6666, 6666, 
2332, 1111, 1111, 1111, 6666, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 4444, 4444, 4444, 5665, 5555, 5555, 5555, 5555, 1551, 1661, 1661, 1661, 
2332, 2112, 2112, 2112, 4224, 4224, 4224, 6226, 3333, 3333, 3333, 3333, 5445, 5445, 5445, 5665, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 1111, 
2412, 2412, 2412, 2412, 4524, 4524, 4524, 4524, 3333, 3333, 3333, 3333, 5145, 5145, 5145, 5145, 5525, 5525, 5525, 5525, 6666, 6666, 6666, 6666, 
2442, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 5115, 5555, 5555, 5555, 5555, 3663, 3663, 3663, 3663, 
2442, 2112, 2112, 2112, 4224, 4224, 4224, 1221, 3333, 3333, 3333, 3333, 5445, 5445, 5445, 5115, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 3333, 
2512, 2512, 2512, 2512, 4124, 4124, 4124, 4124, 3333, 3333, 3333, 3333, 5245, 5245, 5245, 5245, 5545, 5545, 5545, 5545, 6666, 6666, 6666, 6666, 
2662, 1111, 1111, 1111, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 5555, 4444, 4444, 4444, 5335, 5555, 5555, 5555, 5555, 4664, 4664, 4664, 4224, 
2662, 2112, 2112, 2112, 4224, 4224, 4224, 3223, 3333, 3333, 3333, 3333, 5445, 5445, 5445, 5335, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 4444, 
3113, 2112, 2112, 2112, 4334, 4224, 4224, 4224, 5555, 3333, 3333, 3333, 5445, 5445, 5445, 6446, 6666, 5555, 5555, 5555, 2662, 2662, 2662, 2662, 
3113, 3113, 3113, 3113, 1661, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 4444, 4444, 4444, 6666, 3333, 5555, 5555, 5555, 5555, 1661, 1661, 1661, 
3113, 3113, 3113, 3113, 4334, 2222, 2222, 2222, 5555, 4334, 4334, 4334, 6666, 4444, 4444, 4444, 6666, 5555, 5555, 5555, 2222, 6666, 6666, 6666, 
3113, 4114, 4114, 4664, 5225, 5225, 5225, 5225, 1331, 1331, 1331, 1331, 1331, 1441, 1441, 6446, 5555, 5555, 5555, 5555, 4664, 4664, 4664, 4664, 
3113, 5115, 5115, 5115, 1221, 1221, 1221, 1661, 3333, 3333, 3333, 2222, 2442, 2442, 2442, 6446, 5555, 5555, 5555, 3333, 5665, 5665, 5665, 5665, 
3233, 1111, 1111, 1111, 2222, 6666, 2222, 2222, 3333, 2222, 3333, 3333, 4444, 4444, 4444, 6566, 5535, 5535, 5535, 5535, 1661, 1551, 1661, 1661, 
3233, 1211, 1211, 1211, 2422, 2422, 2422, 2622, 3333, 3333, 3333, 3333, 4544, 4544, 4544, 6566, 5515, 5515, 5515, 5535, 1661, 1661, 1661, 1661, 
3323, 1111, 1111, 1111, 2222, 2222, 6666, 2222, 3333, 3333, 2222, 3333, 4444, 4444, 4444, 6656, 5355, 5355, 5355, 5355, 1661, 1661, 1551, 1661, 
3323, 1121, 1121, 1121, 2242, 2242, 2242, 2262, 3333, 3333, 3333, 3333, 4454, 4454, 4454, 6656, 5155, 5155, 5155, 5355, 1661, 1661, 1661, 1661, 
3333, 1111, 1111, 1111, 2222, 1661, 2222, 2222, 3333, 2222, 3333, 3333, 4444, 4444, 4444, 6666, 5555, 3333, 5555, 5555, 1661, 5555, 1661, 1661, 
3333, 1111, 1111, 1111, 2222, 2222, 1661, 2222, 3333, 3333, 2222, 3333, 4444, 4444, 4444, 6666, 5555, 5555, 3333, 5555, 1661, 1661, 5555, 1661, 
3333, 1111, 1111, 1111, 2222, 2222, 2222, 1661, 3333, 3333, 3333, 2222, 6446, 6446, 6446, 6446, 5555, 5555, 5555, 3333, 1661, 1661, 1661, 5555, 
3333, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 6666, 1111, 5555, 5555, 5555, 2662, 1661, 1661, 1661, 
3333, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 6666, 2222, 5555, 5555, 5555, 4664, 1661, 1661, 1661, 
3333, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 6666, 4444, 5555, 5555, 5555, 5665, 1661, 1661, 1661, 
3333, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 6666, 1551, 1551, 1551, 3553, 1661, 1661, 1661, 1661, 
3333, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 4334, 4334, 4334, 4334, 4444, 4444, 4444, 6666, 2552, 2552, 2552, 2552, 1661, 1661, 1661, 1661, 
3333, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 4444, 3333, 3333, 3333, 4444, 4444, 4444, 6666, 6556, 4554, 4554, 4554, 1661, 1661, 1661, 1661, 
3333, 1111, 1111, 1111, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 5555, 4444, 4444, 4444, 4444, 5555, 5555, 5555, 1661, 1661, 1661, 1661, 2222, 
3333, 1111, 1111, 1111, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 5555, 4444, 4444, 4444, 6666, 6556, 6556, 6556, 6556, 1661, 1661, 1661, 1221, 
3333, 1111, 1111, 1111, 2222, 2222, 2222, 5555, 3333, 3333, 3333, 1661, 6666, 4444, 4444, 4444, 5555, 5555, 5555, 2222, 1661, 1661, 1661, 3333, 
3333, 1111, 1111, 1111, 2222, 2222, 2222, 5555, 3333, 3333, 3333, 6666, 4444, 4444, 4444, 6666, 2552, 2552, 2552, 2552, 1661, 1661, 1661, 1331, 
3333, 1111, 1111, 1111, 2222, 2222, 2222, 6666, 3333, 3333, 3333, 2222, 4444, 4444, 4444, 6666, 3553, 3553, 3553, 3553, 1661, 1661, 1661, 1551, 
3333, 1111, 1111, 1111, 2222, 2222, 3333, 2222, 3333, 3333, 5555, 3333, 4444, 4444, 4444, 6666, 5555, 5555, 1661, 5555, 1661, 1661, 2222, 1661, 
3333, 1111, 1111, 1111, 2222, 2222, 5555, 2222, 3333, 3333, 1661, 3333, 4444, 4444, 4444, 6666, 5555, 5555, 2222, 5555, 1661, 1661, 3333, 1661, 
3333, 1111, 1111, 1111, 2222, 3333, 2222, 2222, 3333, 5555, 3333, 3333, 4444, 4444, 4444, 6666, 5555, 1661, 5555, 5555, 1661, 2222, 1661, 1661, 
3333, 1111, 1111, 1111, 2222, 5555, 2222, 2222, 3333, 1661, 3333, 3333, 4444, 4444, 4444, 6666, 5555, 2222, 5555, 5555, 1661, 3333, 1661, 1661, 
3333, 1111, 1111, 1111, 5555, 2222, 2222, 2222, 6666, 4334, 4334, 4334, 6666, 4444, 4444, 4444, 2222, 5555, 5555, 5555, 4334, 6666, 6666, 6666, 
3333, 1111, 1111, 3333, 2222, 2222, 2222, 2222, 4334, 4334, 4334, 4334, 6666, 4444, 4444, 6666, 5555, 5555, 5555, 5555, 1661, 1661, 1661, 1661, 
3333, 1111, 1111, 4444, 2222, 2222, 2222, 2222, 6336, 6336, 6336, 6336, 1111, 4444, 4444, 6666, 5555, 5555, 5555, 5555, 1661, 1661, 1661, 1661, 
3333, 1111, 1111, 6666, 2222, 2222, 2222, 2222, 1331, 1331, 1331, 1331, 3333, 4444, 4444, 6666, 5555, 5555, 5555, 5555, 1661, 1661, 1661, 1661, 
3333, 1111, 3333, 1111, 2222, 2222, 2222, 2222, 3433, 3433, 3433, 3433, 4444, 6666, 4444, 6666, 5555, 5555, 5555, 5555, 1611, 1611, 1611, 1611, 
3333, 1111, 4444, 1111, 2222, 2222, 2222, 2222, 3633, 3633, 3633, 3633, 4444, 1111, 4444, 6666, 5555, 5555, 5555, 5555, 1631, 1631, 1631, 1631, 
3333, 1111, 6666, 1111, 2222, 2222, 2222, 2222, 3133, 3133, 3133, 3133, 4444, 3333, 4444, 6666, 5555, 5555, 5555, 5555, 1641, 1641, 1641, 1641, 
3333, 1121, 1121, 1121, 2242, 2242, 2242, 2242, 3333, 3333, 3333, 3333, 4454, 4454, 4454, 6666, 5555, 1111, 5555, 5555, 1661, 2662, 1661, 1661, 
3333, 1141, 1141, 1141, 2252, 2252, 2252, 2252, 3333, 3333, 3333, 3333, 4414, 4414, 4414, 6666, 5555, 2222, 5555, 5555, 1661, 4664, 1661, 1661, 
3333, 1151, 1151, 1151, 2212, 2212, 2212, 2212, 3333, 3333, 3333, 3333, 4424, 4424, 4424, 6666, 5555, 4444, 5555, 5555, 1661, 5665, 1661, 1661, 
3333, 1211, 1211, 1211, 2422, 2422, 2422, 2422, 3333, 3333, 3333, 3333, 4544, 4544, 4544, 6666, 5555, 5555, 1111, 5555, 1661, 1661, 2662, 1661, 
3333, 1411, 1411, 1411, 2522, 2522, 2522, 2522, 3333, 3333, 3333, 3333, 4144, 4144, 4144, 6666, 5555, 5555, 2222, 5555, 1661, 1661, 4664, 1661, 
3333, 1511, 1511, 1511, 2122, 2122, 2122, 2122, 3333, 3333, 3333, 3333, 4244, 4244, 4244, 6666, 5555, 5555, 4444, 5555, 1661, 1661, 5665, 1661, 
3333, 2112, 2112, 2112, 4224, 4224, 4224, 4224, 3333, 3333, 3333, 3333, 5445, 5445, 5445, 6666, 5555, 5555, 5555, 1111, 1661, 1661, 1661, 2662, 
3333, 3333, 1111, 1111, 2222, 2222, 2222, 2222, 3343, 3343, 3343, 3343, 4444, 4444, 6666, 6666, 5555, 5555, 5555, 5555, 1161, 1161, 1161, 1161, 
3333, 4114, 4114, 4114, 5225, 5225, 5225, 5225, 3333, 3333, 3333, 3333, 1441, 1441, 1441, 6666, 5555, 5555, 5555, 2222, 1661, 1661, 1661, 4664, 
3333, 4444, 1111, 1111, 2222, 2222, 2222, 2222, 3363, 3363, 3363, 3363, 4444, 4444, 1111, 6666, 5555, 5555, 5555, 5555, 1361, 1361, 1361, 1361, 
3333, 5115, 5115, 5115, 1221, 1221, 1221, 1221, 3333, 3333, 3333, 3333, 2442, 2442, 2442, 6666, 5555, 5555, 5555, 4444, 1661, 1661, 1661, 5665, 
3333, 6666, 1111, 1111, 2222, 2222, 2222, 2222, 3313, 3313, 3313, 3313, 4444, 4444, 3333, 6666, 5555, 5555, 5555, 5555, 1461, 1461, 1461, 1461, 
3343, 1141, 1141, 1161, 2252, 2252, 2252, 2252, 3333, 3333, 3333, 3333, 4434, 4414, 4414, 6616, 5255, 5255, 5255, 5255, 1661, 1661, 1661, 1661, 
3353, 1111, 1111, 1111, 2222, 2222, 3333, 2222, 3333, 3333, 5555, 3333, 4444, 4444, 4444, 6626, 5655, 5655, 5655, 5655, 1661, 1661, 1221, 1661, 
3353, 1151, 1151, 1151, 2232, 2212, 2212, 2212, 3333, 3333, 3333, 3333, 4424, 4424, 4424, 6626, 5655, 5455, 5455, 5455, 1661, 1661, 1661, 1661, 
3363, 1111, 1111, 1111, 2222, 2222, 5555, 2222, 3333, 3333, 6666, 3333, 4444, 4444, 4444, 6636, 5255, 5255, 5255, 5255, 1661, 1661, 1331, 1661, 
3433, 1411, 1411, 1611, 2522, 2522, 2522, 2522, 3333, 3333, 3333, 3333, 4344, 4144, 4144, 6166, 5525, 5525, 5525, 5525, 1661, 1661, 1661, 1661, 
3533, 1111, 1111, 1111, 2222, 3333, 2222, 2222, 3333, 5555, 3333, 3333, 4444, 4444, 4444, 6266, 5565, 5565, 5565, 5565, 1661, 1221, 1661, 1661, 
3533, 1511, 1511, 1511, 2322, 2122, 2122, 2122, 3333, 3333, 3333, 3333, 4244, 4244, 4244, 6266, 5565, 5545, 5545, 5545, 1661, 1661, 1661, 1661, 
3633, 1111, 1111, 1111, 2222, 5555, 2222, 2222, 3333, 6666, 3333, 3333, 4444, 4444, 4444, 6366, 5525, 5525, 5525, 5525, 1661, 1331, 1661, 1661, 
3663, 1111, 1111, 1111, 2222, 2222, 2222, 5555, 3333, 3333, 3333, 6666, 4444, 4444, 4444, 6336, 5555, 5555, 5555, 5555, 4664, 4664, 4664, 4334, 
4114, 1111, 4444, 4114, 5225, 5225, 5225, 5225, 3633, 3633, 3633, 3633, 1441, 1111, 4444, 1441, 5555, 5555, 5555, 5555, 6366, 6366, 6366, 6366, 
4114, 3113, 4664, 4114, 5225, 5225, 5225, 5225, 3133, 3133, 3133, 3133, 1441, 1331, 6446, 1441, 5555, 5555, 5555, 5555, 6466, 6466, 6466, 6466, 
4114, 3333, 4114, 4114, 5225, 5225, 5225, 5225, 3343, 3343, 3343, 3313, 1441, 1441, 6666, 1441, 5555, 5555, 5555, 5555, 6166, 6166, 6166, 6466, 
4114, 4114, 3333, 4114, 5225, 5225, 5225, 5225, 3433, 3433, 3433, 3133, 1441, 6666, 1441, 1441, 5555, 5555, 5555, 5555, 6616, 6616, 6616, 6646, 
4114, 4114, 4114, 3333, 2222, 2222, 2222, 5555, 4334, 4334, 4334, 1331, 6666, 1441, 1441, 1441, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
4114, 4114, 4114, 4114, 2222, 5225, 5225, 5555, 3333, 3333, 3333, 6666, 1441, 1441, 1441, 1441, 5555, 5555, 5555, 2222, 3333, 6666, 6666, 6666, 
4114, 4114, 4114, 4114, 2552, 2222, 2222, 2222, 6666, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 2222, 2552, 2552, 2552, 3333, 6666, 6666, 6666, 
4114, 4114, 4114, 4114, 3223, 5225, 5225, 5665, 3333, 3333, 3333, 2222, 1441, 1441, 1441, 1441, 5555, 5555, 5555, 3333, 5555, 6666, 6666, 6666, 
4114, 4114, 4114, 4114, 3663, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 4444, 4444, 4444, 1111, 3333, 5555, 5555, 5555, 5555, 3663, 3663, 3663, 
4114, 4114, 4114, 4114, 5225, 2222, 5555, 5225, 3333, 3333, 6666, 3333, 1441, 1441, 1441, 1441, 5555, 5555, 2222, 5555, 6666, 3333, 6666, 6666, 
4114, 4114, 4114, 4114, 5225, 3223, 5665, 5225, 3333, 3333, 2222, 3333, 1441, 1441, 1441, 1441, 5555, 5555, 3333, 5555, 6666, 5555, 6666, 6666, 
4114, 4114, 4114, 4114, 5225, 3333, 5225, 5225, 3333, 5555, 3333, 3333, 1441, 1441, 1441, 1441, 5555, 6666, 5555, 5555, 6666, 5225, 6666, 6666, 
4114, 4114, 4114, 4114, 5225, 5225, 3333, 5225, 3333, 3333, 5555, 3333, 1441, 1441, 1441, 1441, 5555, 5555, 6666, 5555, 6666, 6666, 5225, 6666, 
4114, 4114, 4114, 4114, 5225, 5225, 5225, 3333, 3333, 3333, 3333, 5555, 4444, 4444, 4444, 1111, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 5225, 
4114, 4114, 4114, 4114, 5225, 5225, 5225, 5225, 3333, 3333, 3333, 3333, 1441, 1441, 1441, 1441, 1551, 1551, 1551, 1551, 6666, 6666, 6666, 6666, 
4114, 4114, 4114, 4114, 5225, 5225, 5225, 5225, 3333, 3333, 3333, 3333, 1441, 1441, 1441, 1441, 2552, 2552, 2552, 2552, 6666, 6666, 6666, 6666, 
4114, 4114, 4114, 4114, 5225, 5225, 5225, 5225, 3333, 3333, 3333, 3333, 1441, 1441, 1441, 1441, 4554, 4554, 4554, 4554, 6666, 6666, 6666, 6666, 
4114, 4114, 4114, 4114, 5225, 5225, 5225, 5555, 3333, 3333, 3333, 6666, 4444, 4444, 4444, 4444, 5555, 5555, 5555, 5225, 6666, 6666, 6666, 3333, 
4114, 4114, 4114, 4114, 5225, 5225, 5225, 6666, 3333, 3333, 3333, 5225, 1111, 4444, 4444, 4444, 5555, 5555, 5555, 3333, 6666, 6666, 6666, 5555, 
4114, 4114, 4114, 4114, 5225, 5225, 5555, 5225, 3333, 3333, 6666, 3333, 1441, 1441, 1441, 1441, 5555, 5555, 5225, 5555, 6666, 6666, 3333, 6666, 
4114, 4114, 4114, 4114, 5225, 5225, 6666, 5225, 3333, 3333, 5225, 3333, 1441, 1441, 1441, 1441, 5555, 5555, 3333, 5555, 6666, 6666, 5555, 6666, 
4114, 4114, 4114, 4114, 5225, 5335, 6226, 5225, 3333, 5555, 3333, 3333, 1441, 1441, 1441, 1441, 5555, 6666, 5555, 5555, 6666, 6666, 2222, 6666, 
4114, 4114, 4114, 4114, 5225, 5555, 2222, 5225, 3333, 6666, 3333, 3333, 1441, 1441, 1441, 1441, 5555, 2222, 5555, 5555, 6666, 6666, 3333, 6666, 
4114, 4114, 4114, 4114, 5225, 5555, 5225, 5225, 3333, 6666, 3333, 3333, 1441, 1441, 1441, 1441, 5555, 5225, 5555, 5555, 6666, 3333, 6666, 6666, 
4114, 4114, 4114, 4114, 5225, 5665, 3223, 5225, 3333, 2222, 3333, 3333, 1441, 1441, 1441, 1441, 5555, 3333, 5555, 5555, 6666, 6666, 5555, 6666, 
4114, 4114, 4114, 4114, 5225, 6226, 5335, 5225, 3333, 3333, 5555, 3333, 1441, 1441, 1441, 1441, 5555, 5555, 6666, 5555, 6666, 2222, 6666, 6666, 
4114, 4114, 4114, 4114, 5225, 6666, 5225, 5225, 3333, 5225, 3333, 3333, 1441, 1441, 1441, 1441, 5555, 3333, 5555, 5555, 6666, 5555, 6666, 6666, 
4114, 4114, 4114, 4114, 5335, 5225, 5225, 6226, 5555, 3333, 3333, 3333, 1441, 1441, 1441, 1441, 6666, 5555, 5555, 5555, 6666, 6666, 6666, 2222, 
4114, 4114, 4114, 4114, 5555, 5225, 5225, 2222, 6666, 3333, 3333, 3333, 1441, 1441, 1441, 1441, 2222, 5555, 5555, 5555, 6666, 6666, 6666, 3333, 
4114, 4114, 4114, 4114, 5665, 5225, 5225, 3223, 2222, 3333, 3333, 3333, 1441, 1441, 1441, 1441, 3333, 5555, 5555, 5555, 6666, 6666, 6666, 5555, 
4114, 4114, 4114, 4114, 6226, 5225, 5225, 5335, 3333, 3333, 3333, 5555, 1441, 1441, 1441, 1441, 5555, 5555, 5555, 6666, 2222, 6666, 6666, 6666, 
4114, 4114, 4114, 4114, 6336, 2222, 2222, 2222, 5555, 6336, 6336, 6336, 1111, 4444, 4444, 4444, 6666, 5555, 5555, 5555, 2222, 6666, 6666, 6666, 
4114, 4114, 4114, 4444, 2222, 2222, 2222, 2222, 6336, 6336, 6336, 6336, 1111, 1441, 1441, 1441, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
4114, 4114, 4114, 6666, 5555, 2222, 2222, 2222, 4334, 1331, 1331, 1331, 3333, 1441, 1441, 1441, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
4114, 4114, 4444, 4114, 5225, 5225, 5225, 5225, 3633, 3633, 3633, 3633, 1441, 1111, 1441, 1441, 5555, 5555, 5555, 5555, 6636, 6636, 6636, 6636, 
4114, 4114, 6666, 4114, 5225, 5225, 5225, 5225, 3433, 3133, 3133, 3133, 1441, 3333, 1441, 1441, 5555, 5555, 5555, 5555, 6616, 6646, 6646, 6646, 
4114, 4334, 6116, 4114, 5225, 5225, 5225, 5225, 3343, 3343, 3343, 3343, 1441, 3443, 1661, 1441, 5555, 5555, 5555, 5555, 6616, 6616, 6616, 6616, 
4114, 4444, 1111, 4114, 5225, 5225, 5225, 5225, 3363, 3363, 3363, 3363, 1441, 4444, 1111, 1441, 5555, 5555, 5555, 5555, 6636, 6636, 6636, 6636, 
4114, 4444, 4114, 4114, 5225, 5225, 5225, 5225, 3363, 3363, 3363, 3363, 1441, 1441, 1111, 1441, 5555, 5555, 5555, 5555, 6366, 6366, 6366, 6366, 
4114, 4664, 3113, 4114, 5225, 5225, 5225, 5225, 3313, 3313, 3313, 3313, 1441, 6446, 1331, 1441, 5555, 5555, 5555, 5555, 6646, 6646, 6646, 6646, 
4114, 6116, 4334, 4114, 5225, 5225, 5225, 5225, 3433, 3433, 3433, 3433, 1441, 1661, 3443, 1441, 5555, 5555, 5555, 5555, 6166, 6166, 6166, 6166, 
4114, 6666, 4114, 4114, 5225, 5225, 5225, 5225, 3343, 3313, 3313, 3313, 1441, 1441, 3333, 1441, 5555, 5555, 5555, 5555, 6166, 6466, 6466, 6466, 
4124, 4124, 4124, 4124, 5245, 5245, 5245, 5245, 3333, 3333, 3333, 3333, 1451, 1451, 1451, 1451, 5155, 5155, 5155, 5155, 6666, 6666, 6666, 6666, 
4144, 1141, 1141, 1141, 2252, 2252, 2252, 2252, 3333, 3333, 3333, 3333, 4414, 4414, 4414, 1411, 5525, 5525, 5525, 5525, 3663, 3663, 3663, 3663, 
4144, 4144, 4144, 4144, 5255, 5255, 5255, 5255, 3333, 3333, 3333, 3333, 1411, 1411, 1411, 1411, 5255, 5255, 5255, 5255, 6666, 6666, 6666, 6666, 
4154, 4154, 4154, 4154, 5215, 5215, 5215, 5215, 3333, 3333, 3333, 3333, 1421, 1421, 1421, 1421, 5455, 5455, 5455, 5455, 6666, 6666, 6666, 6666, 
4214, 4214, 4214, 4214, 5425, 5425, 5425, 5425, 3333, 3333, 3333, 3333, 1541, 1541, 1541, 1541, 5515, 5515, 5515, 5515, 6666, 6666, 6666, 6666, 
4244, 1151, 1151, 1151, 2212, 2212, 2212, 2212, 3333, 3333, 3333, 3333, 4424, 4424, 4424, 1511, 5545, 5545, 5545, 5545, 3663, 3663, 3663, 3663, 
4244, 1211, 1211, 1211, 2422, 2422, 2422, 2122, 3333, 3333, 3333, 3333, 4544, 4544, 4544, 1511, 5515, 5515, 5515, 5545, 3663, 3663, 3663, 3663, 
4334, 4114, 4114, 6116, 5225, 5225, 5225, 5225, 3333, 3333, 3333, 3333, 3443, 1441, 1441, 1661, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
4414, 1411, 1411, 1411, 2522, 2522, 2522, 2522, 3333, 3333, 3333, 3333, 4144, 4144, 4144, 1141, 5255, 5255, 5255, 5255, 3663, 3663, 3663, 3663, 
4414, 4414, 4414, 4414, 5525, 5525, 5525, 5525, 3333, 3333, 3333, 3333, 1141, 1141, 1141, 1141, 5525, 5525, 5525, 5525, 6666, 6666, 6666, 6666, 
4424, 1121, 1121, 1121, 2242, 2242, 2242, 2212, 3333, 3333, 3333, 3333, 4454, 4454, 4454, 1151, 5155, 5155, 5155, 5455, 3663, 3663, 3663, 3663, 
4424, 1511, 1511, 1511, 2122, 2122, 2122, 2122, 3333, 3333, 3333, 3333, 4244, 4244, 4244, 1151, 5455, 5455, 5455, 5455, 3663, 3663, 3663, 3663, 
4444, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 6666, 4444, 4444, 4444, 1111, 1551, 1551, 1551, 4554, 3663, 3663, 3663, 3663, 
4444, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 6336, 6336, 6336, 6336, 4444, 4444, 4444, 1111, 2552, 2552, 2552, 2552, 3663, 3663, 3663, 3663, 
4444, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 6666, 3333, 3333, 3333, 4444, 4444, 4444, 1111, 1551, 4554, 4554, 4554, 3663, 3663, 3663, 3663, 
4444, 1111, 1111, 1111, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 5555, 4444, 4444, 4444, 1111, 6666, 5555, 5555, 5555, 5665, 3663, 3663, 3223, 
4444, 1111, 1111, 1111, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 5555, 4444, 4444, 4444, 4444, 5555, 5555, 5555, 3663, 3663, 3663, 3663, 2222, 
4444, 1111, 1111, 1111, 2222, 2222, 2222, 3663, 3333, 3333, 3333, 2222, 1441, 1441, 1441, 1441, 5555, 5555, 5555, 3333, 3663, 3663, 3663, 5555, 
4444, 1111, 1111, 1111, 2222, 2222, 2222, 5555, 3333, 3333, 3333, 3663, 1111, 4444, 4444, 4444, 5555, 5555, 5555, 2222, 3663, 3663, 3663, 3333, 
4444, 1111, 1111, 1111, 2222, 2222, 2222, 5555, 3333, 3333, 3333, 6666, 4444, 4444, 4444, 1111, 2222, 5555, 5555, 5555, 6666, 3663, 3663, 3333, 
4444, 1111, 1111, 1111, 2222, 2222, 2222, 6666, 3333, 3333, 3333, 2222, 4444, 4444, 4444, 1111, 3333, 5555, 5555, 5555, 2662, 3663, 3663, 3553, 
4444, 1111, 1111, 1111, 2222, 2222, 3333, 2222, 3333, 3333, 5555, 3333, 4444, 4444, 4444, 1111, 5555, 5555, 3663, 5555, 3663, 3663, 2222, 3663, 
4444, 1111, 1111, 1111, 2222, 2222, 3333, 2222, 3333, 3333, 5555, 3333, 4444, 4444, 4444, 1111, 5555, 6666, 5555, 5555, 3663, 5665, 3223, 3663, 
4444, 1111, 1111, 1111, 2222, 2222, 3663, 2222, 3333, 3333, 2222, 3333, 4444, 4444, 4444, 1111, 5555, 5555, 3333, 5555, 3663, 3663, 5555, 3663, 
4444, 1111, 1111, 1111, 2222, 2222, 5555, 2222, 3333, 3333, 3663, 3333, 4444, 4444, 4444, 1111, 5555, 5555, 2222, 5555, 3663, 3663, 3333, 3663, 
4444, 1111, 1111, 1111, 2222, 2222, 5555, 2222, 3333, 3333, 6666, 3333, 4444, 4444, 4444, 1111, 5555, 2222, 5555, 5555, 3663, 6666, 3333, 3663, 
4444, 1111, 1111, 1111, 2222, 2222, 6666, 2222, 3333, 3333, 2222, 3333, 4444, 4444, 4444, 1111, 5555, 3333, 5555, 5555, 3663, 2662, 3553, 3663, 
4444, 1111, 1111, 1111, 2222, 3333, 2222, 2222, 3333, 5555, 3333, 3333, 4444, 4444, 4444, 1111, 5555, 3663, 5555, 5555, 3663, 2222, 3663, 3663, 
4444, 1111, 1111, 1111, 2222, 3333, 2222, 2222, 3333, 5555, 3333, 3333, 4444, 4444, 4444, 1111, 5555, 5555, 6666, 5555, 3663, 3223, 5665, 3663, 
4444, 1111, 1111, 1111, 2222, 3663, 2222, 2222, 3333, 2222, 3333, 3333, 4444, 4444, 4444, 1111, 5555, 3333, 5555, 5555, 3663, 5555, 3663, 3663, 
4444, 1111, 1111, 1111, 2222, 5555, 2222, 2222, 3333, 3663, 3333, 3333, 4444, 4444, 4444, 1111, 5555, 2222, 5555, 5555, 3663, 3333, 3663, 3663, 
4444, 1111, 1111, 1111, 2222, 5555, 2222, 2222, 3333, 6666, 3333, 3333, 4444, 4444, 4444, 1111, 5555, 5555, 2222, 5555, 3663, 3333, 6666, 3663, 
4444, 1111, 1111, 1111, 2222, 6666, 2222, 2222, 3333, 2222, 3333, 3333, 4444, 4444, 4444, 1111, 5555, 5555, 3333, 5555, 3663, 3553, 2662, 3663, 
4444, 1111, 1111, 1111, 3333, 2222, 2222, 2222, 5555, 3333, 3333, 3333, 4444, 4444, 4444, 1111, 5555, 5555, 5555, 6666, 3223, 3663, 3663, 5665, 
4444, 1111, 1111, 1111, 3333, 5225, 5225, 5225, 5555, 3333, 3333, 3333, 1441, 1441, 1441, 1441, 6666, 5555, 5555, 5555, 5225, 6666, 6666, 6666, 
4444, 1111, 1111, 1111, 5555, 2222, 2222, 2222, 6666, 3333, 3333, 3333, 4444, 4444, 4444, 1111, 5555, 5555, 5555, 2222, 3333, 3663, 3663, 6666, 
4444, 1111, 1111, 1111, 5555, 2222, 2222, 2222, 6666, 6336, 6336, 6336, 1111, 4444, 4444, 4444, 2222, 5555, 5555, 5555, 6336, 6666, 6666, 6666, 
4444, 1111, 1111, 1111, 6666, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 4444, 4444, 4444, 1111, 5555, 5555, 5555, 3333, 3553, 3663, 3663, 2662, 
4444, 1111, 1111, 1111, 6666, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 3333, 2552, 2552, 2552, 2552, 6666, 6666, 6666, 
4444, 1111, 1111, 3333, 2222, 2222, 2222, 2222, 4334, 4334, 4334, 4334, 6666, 4444, 4444, 1111, 5555, 5555, 5555, 5555, 3663, 3663, 3663, 3663, 
4444, 1111, 1111, 4444, 2222, 2222, 2222, 2222, 6336, 6336, 6336, 6336, 1111, 4444, 4444, 1111, 5555, 5555, 5555, 5555, 3663, 3663, 3663, 3663, 
4444, 1111, 1111, 6666, 2222, 2222, 2222, 2222, 1331, 1331, 1331, 1331, 3333, 4444, 4444, 1111, 5555, 5555, 5555, 5555, 3663, 3663, 3663, 3663, 
4444, 1111, 3333, 1111, 2222, 2222, 2222, 2222, 3433, 3433, 3433, 3433, 4444, 6666, 4444, 1111, 5555, 5555, 5555, 5555, 3613, 3613, 3613, 3613, 
4444, 1111, 4444, 1111, 2222, 2222, 2222, 2222, 3633, 3633, 3633, 3633, 4444, 1111, 4444, 1111, 5555, 5555, 5555, 5555, 3633, 3633, 3633, 3633, 
4444, 1111, 6666, 1111, 2222, 2222, 2222, 2222, 3133, 3133, 3133, 3133, 4444, 3333, 4444, 1111, 5555, 5555, 5555, 5555, 3643, 3643, 3643, 3643, 
4444, 1141, 1141, 1111, 2252, 2252, 2252, 2252, 3333, 3333, 3333, 3333, 4444, 4414, 4414, 1111, 5255, 5255, 5255, 5255, 3663, 3663, 3663, 3663, 
4444, 1411, 1411, 1111, 2522, 2522, 2522, 2522, 3333, 3333, 3333, 3333, 4444, 4144, 4144, 1111, 5525, 5525, 5525, 5525, 3663, 3663, 3663, 3663, 
4444, 2112, 2112, 2112, 4224, 4224, 4224, 4224, 3333, 3333, 3333, 3333, 5445, 5445, 5445, 1111, 1551, 1551, 1551, 1551, 3663, 3663, 3663, 3663, 
4444, 3333, 1111, 1111, 2222, 2222, 2222, 2222, 3343, 3343, 3343, 3343, 4444, 4444, 6666, 1111, 5555, 5555, 5555, 5555, 3163, 3163, 3163, 3163, 
4444, 4114, 4114, 1111, 5225, 5225, 5225, 5225, 3333, 3333, 3333, 3333, 4444, 1441, 1441, 1111, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
4444, 4114, 4114, 4114, 5225, 5225, 5225, 5225, 3333, 3333, 3333, 3333, 1441, 1441, 1441, 1111, 2552, 2552, 2552, 2552, 3663, 3663, 3663, 3663, 
4444, 4444, 1111, 1111, 2222, 2222, 2222, 2222, 3363, 3363, 3363, 3363, 4444, 4444, 1111, 1111, 5555, 5555, 5555, 5555, 3363, 3363, 3363, 3363, 
4444, 5115, 5115, 5115, 1221, 1221, 1221, 1221, 3333, 3333, 3333, 3333, 2442, 2442, 2442, 1111, 4554, 4554, 4554, 4554, 3663, 3663, 3663, 3663, 
4444, 6666, 1111, 1111, 2222, 2222, 2222, 2222, 3313, 3313, 3313, 3313, 4444, 4444, 3333, 1111, 5555, 5555, 5555, 5555, 3463, 3463, 3463, 3463, 
4454, 1151, 1151, 1151, 2242, 2212, 2212, 2212, 3333, 3333, 3333, 3333, 4424, 4424, 4424, 1121, 5155, 5455, 5455, 5455, 3663, 3663, 3663, 3663, 
4454, 1211, 1211, 1211, 2422, 2422, 2422, 2422, 3333, 3333, 3333, 3333, 4544, 4544, 4544, 1121, 5155, 5155, 5155, 5155, 3663, 3663, 3663, 3663, 
4514, 4514, 4514, 4514, 5125, 5125, 5125, 5125, 3333, 3333, 3333, 3333, 1241, 1241, 1241, 1241, 5545, 5545, 5545, 5545, 6666, 6666, 6666, 6666, 
4544, 1121, 1121, 1121, 2242, 2242, 2242, 2242, 3333, 3333, 3333, 3333, 4454, 4454, 4454, 1211, 5515, 5515, 5515, 5515, 3663, 3663, 3663, 3663, 
4544, 1511, 1511, 1511, 2422, 2122, 2122, 2122, 3333, 3333, 3333, 3333, 4244, 4244, 4244, 1211, 5515, 5545, 5545, 5545, 3663, 3663, 3663, 3663, 
4664, 4114, 4114, 3113, 5225, 5225, 5225, 5225, 3333, 3333, 3333, 3333, 6446, 1441, 1441, 1331, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
5115, 2112, 2112, 2112, 4554, 4224, 4224, 4224, 6666, 3333, 3333, 3333, 5445, 5445, 5445, 2442, 2222, 5555, 5555, 5555, 3663, 3663, 3663, 3663, 
5115, 2112, 5115, 5115, 1221, 1221, 1551, 1221, 3333, 3333, 6666, 3333, 2442, 2442, 5445, 2442, 5555, 5555, 2222, 5555, 6366, 6366, 6366, 6366, 
5115, 3113, 5115, 5115, 1221, 1221, 1661, 1221, 3333, 3333, 2222, 3333, 2442, 2442, 6446, 2442, 5555, 5555, 3333, 5555, 6566, 6566, 6566, 6566, 
5115, 3333, 5115, 5115, 1221, 1221, 1221, 1221, 3343, 3343, 3343, 3323, 2442, 2442, 6666, 2442, 5555, 5555, 5555, 5555, 6166, 6166, 6166, 6566, 
5115, 4444, 5115, 5115, 1221, 1221, 1221, 1221, 3363, 3363, 3363, 3363, 2442, 2442, 1111, 2442, 5555, 5555, 5555, 5555, 6366, 6366, 6366, 6366, 
5115, 5115, 2112, 5115, 1221, 1551, 1221, 1221, 3333, 6666, 3333, 3333, 2442, 5445, 2442, 2442, 5555, 2222, 5555, 5555, 6636, 6636, 6636, 6636, 
5115, 5115, 3113, 5115, 1221, 1661, 1221, 1221, 3333, 2222, 3333, 3333, 2442, 6446, 2442, 2442, 5555, 3333, 5555, 5555, 6656, 6656, 6656, 6656, 
5115, 5115, 3333, 5115, 1221, 1221, 1221, 1221, 3433, 3433, 3433, 3233, 2442, 6666, 2442, 2442, 5555, 5555, 5555, 5555, 6616, 6616, 6616, 6656, 
5115, 5115, 4444, 5115, 1221, 1221, 1221, 1221, 3633, 3633, 3633, 3633, 2442, 1111, 2442, 2442, 5555, 5555, 5555, 5555, 6636, 6636, 6636, 6636, 
5115, 5115, 5115, 2112, 1551, 1221, 1221, 1221, 6666, 3333, 3333, 3333, 5445, 2442, 2442, 2442, 2222, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
5115, 5115, 5115, 3113, 1661, 1221, 1221, 1221, 2222, 3333, 3333, 3333, 6446, 2442, 2442, 2442, 3333, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
5115, 5115, 5115, 3333, 2222, 2222, 2222, 1111, 4334, 4334, 4334, 2332, 6666, 2442, 2442, 2442, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
5115, 5115, 5115, 4444, 2222, 2222, 2222, 2222, 6336, 6336, 6336, 6336, 1111, 2442, 2442, 2442, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
5115, 5115, 5115, 5115, 1221, 1221, 1221, 1221, 3333, 3333, 3333, 3333, 2442, 2442, 2442, 2442, 1551, 1551, 1551, 1551, 6666, 6666, 6666, 6666, 
5115, 5115, 5115, 5115, 1221, 1221, 1221, 1221, 3333, 3333, 3333, 3333, 2442, 2442, 2442, 2442, 2552, 2552, 2552, 2552, 6666, 6666, 6666, 6666, 
5115, 5115, 5115, 5115, 1221, 1221, 1221, 1221, 3333, 3333, 3333, 3333, 2442, 2442, 2442, 2442, 4554, 4554, 4554, 4554, 6666, 6666, 6666, 6666, 
5115, 5115, 5115, 5115, 1221, 1221, 1221, 3333, 3333, 3333, 3333, 5555, 4444, 4444, 4444, 2222, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 1221, 
5115, 5115, 5115, 5115, 1221, 1221, 1221, 5555, 3333, 3333, 3333, 6666, 4444, 4444, 4444, 4444, 5555, 5555, 5555, 1221, 6666, 6666, 6666, 3333, 
5115, 5115, 5115, 5115, 1221, 1221, 1221, 6666, 3333, 3333, 3333, 1221, 2222, 4444, 4444, 4444, 5555, 5555, 5555, 3333, 6666, 6666, 6666, 5555, 
5115, 5115, 5115, 5115, 1221, 1221, 3333, 1221, 3333, 3333, 5555, 3333, 2442, 2442, 2442, 2442, 5555, 5555, 6666, 5555, 6666, 6666, 1221, 6666, 
5115, 5115, 5115, 5115, 1221, 1221, 5555, 1221, 3333, 3333, 6666, 3333, 2442, 2442, 2442, 2442, 5555, 5555, 1221, 5555, 6666, 6666, 3333, 6666, 
5115, 5115, 5115, 5115, 1221, 1221, 6666, 1221, 3333, 3333, 1221, 3333, 2442, 2442, 2442, 2442, 5555, 5555, 3333, 5555, 6666, 6666, 5555, 6666, 
5115, 5115, 5115, 5115, 1221, 3333, 1221, 1221, 3333, 5555, 3333, 3333, 2442, 2442, 2442, 2442, 5555, 6666, 5555, 5555, 6666, 1221, 6666, 6666, 
5115, 5115, 5115, 5115, 1221, 5555, 1221, 1221, 3333, 6666, 3333, 3333, 2442, 2442, 2442, 2442, 5555, 1221, 5555, 5555, 6666, 3333, 6666, 6666, 
5115, 5115, 5115, 5115, 1221, 6666, 1221, 1221, 3333, 1221, 3333, 3333, 2442, 2442, 2442, 2442, 5555, 3333, 5555, 5555, 6666, 5555, 6666, 6666, 
5115, 5115, 5115, 5115, 4554, 2222, 2222, 2222, 6666, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 2222, 4554, 4554, 4554, 3333, 6666, 6666, 6666, 
5115, 5115, 5115, 5335, 1221, 1221, 1221, 3223, 4334, 4334, 4334, 4334, 2662, 2442, 2442, 2442, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 1111, 
5115, 5115, 5115, 5445, 1221, 1221, 1221, 4224, 6336, 6336, 6336, 6336, 2112, 2442, 2442, 2442, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 3333, 
5115, 5115, 5115, 5665, 1221, 1221, 1221, 6226, 1331, 1331, 1331, 1331, 2332, 2442, 2442, 2442, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 4444, 
5115, 5115, 5115, 6116, 1331, 1221, 1221, 1221, 5555, 3333, 3333, 3333, 3443, 2442, 2442, 2442, 6666, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
5115, 5115, 5115, 6666, 1111, 2222, 2222, 2222, 5335, 1331, 1331, 1331, 3333, 2442, 2442, 2442, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
5115, 5115, 5335, 5115, 1221, 1221, 3223, 1221, 3433, 3433, 3433, 3433, 2442, 2662, 2442, 2442, 5555, 5555, 5555, 5555, 6666, 6666, 1111, 6666, 
5115, 5115, 5445, 5115, 1221, 1221, 4224, 1221, 3633, 3633, 3633, 3633, 2442, 2112, 2442, 2442, 5555, 5555, 5555, 5555, 6666, 6666, 3333, 6666, 
5115, 5115, 5665, 5115, 1221, 1221, 6226, 1221, 3133, 3133, 3133, 3133, 2442, 2332, 2442, 2442, 5555, 5555, 5555, 5555, 6666, 6666, 4444, 6666, 
5115, 5115, 6116, 5115, 1221, 1331, 1221, 1221, 3333, 5555, 3333, 3333, 2442, 3443, 2442, 2442, 5555, 6666, 5555, 5555, 6626, 6626, 6626, 6626, 
5115, 5115, 6666, 5115, 1221, 1221, 1221, 1221, 3533, 3133, 3133, 3133, 2442, 3333, 2442, 2442, 5555, 5555, 5555, 5555, 6626, 6646, 6646, 6646, 
5115, 5335, 5115, 5115, 1221, 3223, 1221, 1221, 3343, 3343, 3343, 3343, 2442, 2442, 2662, 2442, 5555, 5555, 5555, 5555, 6666, 1111, 6666, 6666, 
5115, 5445, 5115, 5115, 1221, 4224, 1221, 1221, 3363, 3363, 3363, 3363, 2442, 2442, 2112, 2442, 5555, 5555, 5555, 5555, 6666, 3333, 6666, 6666, 
5115, 5665, 5115, 5115, 1221, 6226, 1221, 1221, 3313, 3313, 3313, 3313, 2442, 2442, 2332, 2442, 5555, 5555, 5555, 5555, 6666, 4444, 6666, 6666, 
5115, 6116, 5115, 5115, 1221, 1221, 1331, 1221, 3333, 3333, 5555, 3333, 2442, 2442, 3443, 2442, 5555, 5555, 6666, 5555, 6266, 6266, 6266, 6266, 
5115, 6666, 5115, 5115, 1221, 1221, 1221, 1221, 3353, 3313, 3313, 3313, 2442, 2442, 3333, 2442, 5555, 5555, 5555, 5555, 6266, 6466, 6466, 6466, 
5125, 5125, 5125, 5125, 1241, 1241, 1241, 1241, 3333, 3333, 3333, 3333, 2452, 2452, 2452, 2452, 5155, 5155, 5155, 5155, 6666, 6666, 6666, 6666, 
5145, 5145, 5145, 5145, 1251, 1251, 1251, 1251, 3333, 3333, 3333, 3333, 2412, 2412, 2412, 2412, 5255, 5255, 5255, 5255, 6666, 6666, 6666, 6666, 
5155, 5155, 5155, 5155, 1211, 1211, 1211, 1211, 3333, 3333, 3333, 3333, 2422, 2422, 2422, 2422, 5455, 5455, 5455, 5455, 6666, 6666, 6666, 6666, 
5215, 5215, 5215, 5215, 1421, 1421, 1421, 1421, 3333, 3333, 3333, 3333, 2542, 2542, 2542, 2542, 5515, 5515, 5515, 5515, 6666, 6666, 6666, 6666, 
5335, 1111, 1111, 1111, 3333, 2222, 2222, 2222, 5555, 3333, 3333, 3333, 4444, 4444, 4444, 2662, 5555, 5555, 5555, 5555, 1221, 1661, 1661, 1661, 
5335, 5115, 5115, 5115, 3223, 1221, 1221, 1221, 3333, 3333, 3333, 3333, 2442, 2442, 2442, 2662, 5555, 5555, 5555, 5555, 1111, 6666, 6666, 6666, 
5415, 5415, 5415, 5415, 1521, 1521, 1521, 1521, 3333, 3333, 3333, 3333, 2142, 2142, 2142, 2142, 5525, 5525, 5525, 5525, 6666, 6666, 6666, 6666, 
5445, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 2112, 5555, 5555, 5555, 5555, 3663, 3663, 3663, 3663, 
5445, 5115, 5115, 5115, 4224, 1221, 1221, 1221, 3333, 3333, 3333, 3333, 2442, 2442, 2442, 2112, 5555, 5555, 5555, 5555, 3333, 6666, 6666, 6666, 
5515, 5515, 5515, 5515, 1121, 1121, 1121, 1121, 3333, 3333, 3333, 3333, 2242, 2242, 2242, 2242, 5545, 5545, 5545, 5545, 6666, 6666, 6666, 6666, 
5555, 1111, 1111, 1111, 3333, 1221, 1221, 1221, 5555, 3333, 3333, 3333, 2442, 2442, 2442, 2442, 6666, 5555, 5555, 5555, 1221, 6666, 6666, 6666, 
5555, 1111, 1111, 1111, 6666, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 3333, 4554, 4554, 4554, 4554, 6666, 6666, 6666, 
5665, 1111, 1111, 1111, 2222, 2222, 2222, 6666, 3333, 3333, 3333, 2222, 4444, 4444, 4444, 2332, 5555, 5555, 5555, 5555, 4664, 4664, 4664, 4554, 
5665, 5115, 5115, 5115, 6226, 1221, 1221, 1221, 3333, 3333, 3333, 3333, 2442, 2442, 2442, 2332, 5555, 5555, 5555, 5555, 4444, 6666, 6666, 6666, 
6116, 2112, 2112, 2112, 4664, 4224, 4224, 4224, 2222, 3333, 3333, 3333, 5445, 5445, 5445, 3443, 3333, 5555, 5555, 5555, 5665, 5665, 5665, 5665, 
6116, 4114, 4114, 4334, 5225, 5225, 5225, 5225, 4334, 4334, 4334, 4334, 1661, 1441, 1441, 3443, 5555, 5555, 5555, 5555, 1661, 1661, 1661, 1661, 
6116, 5115, 5115, 5115, 1221, 1221, 1221, 1331, 3333, 3333, 3333, 5555, 2442, 2442, 2442, 3443, 5555, 5555, 5555, 6666, 2662, 2662, 2662, 2662, 
6116, 6116, 6116, 6116, 1331, 2222, 2222, 2222, 5555, 1331, 1331, 1331, 3333, 4444, 4444, 4444, 6666, 5555, 5555, 5555, 2222, 6666, 6666, 6666, 
6116, 6116, 6116, 6116, 4664, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 4444, 4444, 4444, 3333, 3333, 5555, 5555, 5555, 5555, 4664, 4664, 4664, 
6266, 1111, 1111, 1111, 2222, 2222, 3333, 2222, 3333, 3333, 5555, 3333, 4444, 4444, 4444, 3533, 5565, 5565, 5565, 5565, 4664, 4664, 4224, 4664, 
6266, 1211, 1211, 1211, 2422, 2422, 2422, 2322, 3333, 3333, 3333, 3333, 4544, 4544, 4544, 3533, 5515, 5515, 5515, 5565, 4664, 4664, 4664, 4664, 
6336, 1111, 1111, 1111, 5555, 2222, 2222, 2222, 6666, 3333, 3333, 3333, 4444, 4444, 4444, 3663, 5555, 5555, 5555, 5555, 1331, 1661, 1661, 1661, 
6366, 1111, 1111, 1111, 2222, 2222, 5555, 2222, 3333, 3333, 6666, 3333, 4444, 4444, 4444, 3633, 5525, 5525, 5525, 5525, 4664, 4664, 4334, 4664, 
6466, 1411, 1411, 1311, 2522, 2522, 2522, 2522, 3333, 3333, 3333, 3333, 4644, 4144, 4144, 3133, 5525, 5525, 5525, 5525, 4664, 4664, 4664, 4664, 
6566, 1111, 1111, 1111, 2222, 2222, 6666, 2222, 3333, 3333, 2222, 3333, 4444, 4444, 4444, 3233, 5535, 5535, 5535, 5535, 4664, 4664, 4554, 4664, 
6566, 1511, 1511, 1511, 2622, 2122, 2122, 2122, 3333, 3333, 3333, 3333, 4244, 4244, 4244, 3233, 5535, 5545, 5545, 5545, 4664, 4664, 4664, 4664, 
6626, 1111, 1111, 1111, 2222, 3333, 2222, 2222, 3333, 5555, 3333, 3333, 4444, 4444, 4444, 3353, 5655, 5655, 5655, 5655, 4664, 4224, 4664, 4664, 
6626, 1121, 1121, 1121, 2242, 2242, 2242, 2232, 3333, 3333, 3333, 3333, 4454, 4454, 4454, 3353, 5155, 5155, 5155, 5655, 4664, 4664, 4664, 4664, 
6636, 1111, 1111, 1111, 2222, 5555, 2222, 2222, 3333, 6666, 3333, 3333, 4444, 4444, 4444, 3363, 5255, 5255, 5255, 5255, 4664, 4334, 4664, 4664, 
6646, 1141, 1141, 1131, 2252, 2252, 2252, 2252, 3333, 3333, 3333, 3333, 4464, 4414, 4414, 3313, 5255, 5255, 5255, 5255, 4664, 4664, 4664, 4664, 
6656, 1111, 1111, 1111, 2222, 6666, 2222, 2222, 3333, 2222, 3333, 3333, 4444, 4444, 4444, 3323, 5355, 5355, 5355, 5355, 4664, 4554, 4664, 4664, 
6656, 1151, 1151, 1151, 2262, 2212, 2212, 2212, 3333, 3333, 3333, 3333, 4424, 4424, 4424, 3323, 5355, 5455, 5455, 5455, 4664, 4664, 4664, 4664, 
6666, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 1111, 3333, 3333, 3333, 4444, 4444, 4444, 3333, 3553, 4554, 4554, 4554, 4664, 4664, 4664, 4664, 
6666, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 1331, 1331, 1331, 1331, 4444, 4444, 4444, 3333, 2552, 2552, 2552, 2552, 4664, 4664, 4664, 4664, 
6666, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 1111, 4444, 4444, 4444, 3333, 1551, 1551, 1551, 6556, 4664, 4664, 4664, 4664, 
6666, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 3333, 5555, 5555, 5555, 1111, 4664, 4664, 4664, 5665, 
6666, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 3333, 5555, 5555, 5555, 2222, 4664, 4664, 4664, 1661, 
6666, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 3333, 5555, 5555, 5555, 4444, 4664, 4664, 4664, 2662, 
6666, 1111, 1111, 1111, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 5555, 4444, 4444, 4444, 4444, 5555, 5555, 5555, 4664, 4664, 4664, 4664, 2222, 
6666, 1111, 1111, 1111, 2222, 2222, 2222, 4664, 3333, 3333, 3333, 2222, 3443, 3443, 3443, 3443, 5555, 5555, 5555, 3333, 4664, 4664, 4664, 5555, 
6666, 1111, 1111, 1111, 2222, 2222, 2222, 5555, 3333, 3333, 3333, 4664, 3333, 4444, 4444, 4444, 5555, 5555, 5555, 2222, 4664, 4664, 4664, 3333, 
6666, 1111, 1111, 1111, 2222, 2222, 3333, 2222, 3333, 3333, 5555, 3333, 4444, 4444, 4444, 3333, 5555, 5555, 4664, 5555, 4664, 4664, 2222, 4664, 
6666, 1111, 1111, 1111, 2222, 2222, 4664, 2222, 3333, 3333, 2222, 3333, 4444, 4444, 4444, 3333, 5555, 5555, 3333, 5555, 4664, 4664, 5555, 4664, 
6666, 1111, 1111, 1111, 2222, 2222, 5555, 2222, 3333, 3333, 4664, 3333, 4444, 4444, 4444, 3333, 5555, 5555, 2222, 5555, 4664, 4664, 3333, 4664, 
6666, 1111, 1111, 1111, 2222, 3333, 2222, 2222, 3333, 5555, 3333, 3333, 4444, 4444, 4444, 3333, 5555, 4664, 5555, 5555, 4664, 2222, 4664, 4664, 
6666, 1111, 1111, 1111, 2222, 4664, 2222, 2222, 3333, 2222, 3333, 3333, 4444, 4444, 4444, 3333, 5555, 3333, 5555, 5555, 4664, 5555, 4664, 4664, 
6666, 1111, 1111, 1111, 2222, 5555, 2222, 2222, 3333, 4664, 3333, 3333, 4444, 4444, 4444, 3333, 5555, 2222, 5555, 5555, 4664, 3333, 4664, 4664, 
6666, 1111, 1111, 1111, 3333, 2222, 2222, 2222, 5555, 3333, 3333, 3333, 4444, 4444, 4444, 3333, 6556, 6556, 6556, 6556, 4224, 4664, 4664, 4664, 
6666, 1111, 1111, 1111, 5555, 2222, 2222, 2222, 6666, 1331, 1331, 1331, 3333, 4444, 4444, 4444, 2222, 5555, 5555, 5555, 1331, 6666, 6666, 6666, 
6666, 1111, 1111, 1111, 5555, 2222, 2222, 2222, 6666, 3333, 3333, 3333, 4444, 4444, 4444, 3333, 2552, 2552, 2552, 2552, 4334, 4664, 4664, 4664, 
6666, 1111, 1111, 1111, 6666, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 4444, 4444, 4444, 3333, 3553, 3553, 3553, 3553, 4554, 4664, 4664, 4664, 
6666, 1111, 1111, 3333, 2222, 2222, 2222, 2222, 4334, 4334, 4334, 4334, 6666, 4444, 4444, 3333, 5555, 5555, 5555, 5555, 4664, 4664, 4664, 4664, 
6666, 1111, 1111, 4444, 2222, 2222, 2222, 2222, 6336, 6336, 6336, 6336, 1111, 4444, 4444, 3333, 5555, 5555, 5555, 5555, 4664, 4664, 4664, 4664, 
6666, 1111, 1111, 6666, 2222, 2222, 2222, 2222, 1331, 1331, 1331, 1331, 3333, 4444, 4444, 3333, 5555, 5555, 5555, 5555, 4664, 4664, 4664, 4664, 
6666, 1111, 3333, 1111, 2222, 2222, 2222, 2222, 3433, 3433, 3433, 3433, 4444, 6666, 4444, 3333, 5555, 5555, 5555, 5555, 4614, 4614, 4614, 4614, 
6666, 1111, 4444, 1111, 2222, 2222, 2222, 2222, 3633, 3633, 3633, 3633, 4444, 1111, 4444, 3333, 5555, 5555, 5555, 5555, 4634, 4634, 4634, 4634, 
6666, 1111, 6666, 1111, 2222, 2222, 2222, 2222, 3133, 3133, 3133, 3133, 4444, 3333, 4444, 3333, 5555, 5555, 5555, 5555, 4644, 4644, 4644, 4644, 
6666, 1121, 1121, 1121, 2242, 2242, 2242, 2242, 3333, 3333, 3333, 3333, 4454, 4454, 4454, 3333, 5555, 5555, 1111, 5555, 4664, 4664, 5665, 4664, 
6666, 1141, 1141, 1141, 2252, 2252, 2252, 2252, 3333, 3333, 3333, 3333, 4414, 4414, 4414, 3333, 5555, 5555, 2222, 5555, 4664, 4664, 1661, 4664, 
6666, 1151, 1151, 1151, 2212, 2212, 2212, 2212, 3333, 3333, 3333, 3333, 4424, 4424, 4424, 3333, 5555, 5555, 4444, 5555, 4664, 4664, 2662, 4664, 
6666, 1211, 1211, 1211, 2422, 2422, 2422, 2422, 3333, 3333, 3333, 3333, 4544, 4544, 4544, 3333, 5555, 1111, 5555, 5555, 4664, 5665, 4664, 4664, 
6666, 1411, 1411, 1411, 2522, 2522, 2522, 2522, 3333, 3333, 3333, 3333, 4144, 4144, 4144, 3333, 5555, 2222, 5555, 5555, 4664, 1661, 4664, 4664, 
6666, 1511, 1511, 1511, 2122, 2122, 2122, 2122, 3333, 3333, 3333, 3333, 4244, 4244, 4244, 3333, 5555, 4444, 5555, 5555, 4664, 2662, 4664, 4664, 
6666, 2112, 2112, 2112, 4224, 4224, 4224, 4224, 3333, 3333, 3333, 3333, 5445, 5445, 5445, 3333, 1111, 5555, 5555, 5555, 5665, 4664, 4664, 4664, 
6666, 3333, 1111, 1111, 2222, 2222, 2222, 2222, 3343, 3343, 3343, 3343, 4444, 4444, 6666, 3333, 5555, 5555, 5555, 5555, 4164, 4164, 4164, 4164, 
6666, 4114, 4114, 4114, 5225, 5225, 5225, 5225, 3333, 3333, 3333, 3333, 1441, 1441, 1441, 3333, 2222, 5555, 5555, 5555, 1661, 4664, 4664, 4664, 
6666, 4444, 1111, 1111, 2222, 2222, 2222, 2222, 3363, 3363, 3363, 3363, 4444, 4444, 1111, 3333, 5555, 5555, 5555, 5555, 4364, 4364, 4364, 4364, 
6666, 5115, 5115, 5115, 1221, 1221, 1221, 1221, 3333, 3333, 3333, 3333, 2442, 2442, 2442, 3333, 4444, 5555, 5555, 5555, 2662, 4664, 4664, 4664, 
6666, 6666, 1111, 1111, 2222, 2222, 2222, 2222, 3313, 3313, 3313, 3313, 4444, 4444, 3333, 3333, 5555, 5555, 5555, 5555, 4464, 4464, 4464, 4464};

unsigned short GLOBAL_FACE_CONVERSION_MATRIX[14] = {0,1,0,2,0,3,0,4,0,0,0,5,0,6};

void init_search_variables(void)
{
	/* counters, not settings */
	GLOBAL_TFS_1_DATABASE_PROBES = 0;
	GLOBAL_TFS_2_DATABASE_PROBES = 0;
}

void init_user_search_preferences(void)
{
	GLOBAL_SEARCH_EXTENSIONS_ON = 1;
	GLOBAL_PROBE_TFS_1_DATABASE = 1;
	GLOBAL_PROBE_TFS_2_DATABASE = 1;

}

unsigned short cube_row_to_4_digit_number(unsigned short square_1, unsigned short square_2, unsigned short square_3, unsigned short square_4)
{
	unsigned short row_value;

	row_value = (GLOBAL_FACE_CONVERSION_MATRIX[square_1] * 1000) + (GLOBAL_FACE_CONVERSION_MATRIX[square_2] * 100) + (GLOBAL_FACE_CONVERSION_MATRIX[square_3] * 10) + GLOBAL_FACE_CONVERSION_MATRIX[square_1];
	return row_value;
}

signed short top_solved(CUBE_4x4_ARRANGEMENT your_cube)
{
	unsigned short sum;

	sum = 0;

	sum += your_cube.cube_top[0];
	sum += your_cube.cube_top[1];
	sum += your_cube.cube_top[2];
	sum += your_cube.cube_top[3];
	sum += your_cube.cube_top[4];
	sum += your_cube.cube_top[5];
	sum += your_cube.cube_top[6];
	sum += your_cube.cube_top[7];
	sum += your_cube.cube_top[8];
	sum += your_cube.cube_top[9];
	sum += your_cube.cube_top[10];
	sum += your_cube.cube_top[11];
	sum += your_cube.cube_top[12];
	sum += your_cube.cube_top[13];
	sum += your_cube.cube_top[14];
	sum += your_cube.cube_top[15];
	
	if(sum == TOP_IS_SOLVED)
		return ALREADY_SOLVED;

	return UNSOLVED;

}

signed short front_solved(CUBE_4x4_ARRANGEMENT your_cube)
{
	unsigned short sum;

	sum = 0;

	sum += your_cube.cube_front[0];
	sum += your_cube.cube_front[1];
	sum += your_cube.cube_front[2];
	sum += your_cube.cube_front[3];
	sum += your_cube.cube_front[4];
	sum += your_cube.cube_front[5];
	sum += your_cube.cube_front[6];
	sum += your_cube.cube_front[7];
	sum += your_cube.cube_front[8];
	sum += your_cube.cube_front[9];
	sum += your_cube.cube_front[10];
	sum += your_cube.cube_front[11];
	sum += your_cube.cube_front[12];
	sum += your_cube.cube_front[13];
	sum += your_cube.cube_front[14];
	sum += your_cube.cube_front[15];
	
	if(sum == FRONT_IS_SOLVED)
		return ALREADY_SOLVED;

	return UNSOLVED;
}


signed short right_solved(CUBE_4x4_ARRANGEMENT your_cube)
{
	unsigned short sum;

	sum = 0;

	sum += your_cube.cube_right[0];
	sum += your_cube.cube_right[1];
	sum += your_cube.cube_right[2];
	sum += your_cube.cube_right[3];
	sum += your_cube.cube_right[4];
	sum += your_cube.cube_right[5];
	sum += your_cube.cube_right[6];
	sum += your_cube.cube_right[7];
	sum += your_cube.cube_right[8];
	sum += your_cube.cube_right[9];
	sum += your_cube.cube_right[10];
	sum += your_cube.cube_right[11];
	sum += your_cube.cube_right[12];
	sum += your_cube.cube_right[13];
	sum += your_cube.cube_right[14];
	sum += your_cube.cube_right[15];
	
	if(sum == RIGHT_IS_SOLVED)
		return ALREADY_SOLVED;

	return UNSOLVED;
}

signed short bottom_solved(CUBE_4x4_ARRANGEMENT your_cube)
{
	unsigned short sum;

	sum = 0;

	sum += your_cube.cube_bottom[0];
	sum += your_cube.cube_bottom[1];
	sum += your_cube.cube_bottom[2];
	sum += your_cube.cube_bottom[3];
	sum += your_cube.cube_bottom[4];
	sum += your_cube.cube_bottom[5];
	sum += your_cube.cube_bottom[6];
	sum += your_cube.cube_bottom[7];
	sum += your_cube.cube_bottom[8];
	sum += your_cube.cube_bottom[9];
	sum += your_cube.cube_bottom[10];
	sum += your_cube.cube_bottom[11];
	sum += your_cube.cube_bottom[12];
	sum += your_cube.cube_bottom[13];
	sum += your_cube.cube_bottom[14];
	sum += your_cube.cube_bottom[15];
	
	if(sum == BOTTOM_IS_SOLVED)
		return ALREADY_SOLVED;

	return UNSOLVED;
}

signed short back_solved(CUBE_4x4_ARRANGEMENT your_cube)
{
	unsigned short sum;

	sum = 0;

	sum += your_cube.cube_back[0];
	sum += your_cube.cube_back[1];
	sum += your_cube.cube_back[2];
	sum += your_cube.cube_back[3];
	sum += your_cube.cube_back[4];
	sum += your_cube.cube_back[5];
	sum += your_cube.cube_back[6];
	sum += your_cube.cube_back[7];
	sum += your_cube.cube_back[8];
	sum += your_cube.cube_back[9];
	sum += your_cube.cube_back[10];
	sum += your_cube.cube_back[11];
	sum += your_cube.cube_back[12];
	sum += your_cube.cube_back[13];
	sum += your_cube.cube_back[14];
	sum += your_cube.cube_back[15];
	
	if(sum == BACK_IS_SOLVED)
		return ALREADY_SOLVED;

	return UNSOLVED;
}

signed short left_solved(CUBE_4x4_ARRANGEMENT your_cube)
{
	unsigned short sum;

	sum = 0;

	sum += your_cube.cube_left[0];
	sum += your_cube.cube_left[1];
	sum += your_cube.cube_left[2];
	sum += your_cube.cube_left[3];
	sum += your_cube.cube_left[4];
	sum += your_cube.cube_left[5];
	sum += your_cube.cube_left[6];
	sum += your_cube.cube_left[7];
	sum += your_cube.cube_left[8];
	sum += your_cube.cube_left[9];
	sum += your_cube.cube_left[10];
	sum += your_cube.cube_left[11];
	sum += your_cube.cube_left[12];
	sum += your_cube.cube_left[13];
	sum += your_cube.cube_left[14];
	sum += your_cube.cube_left[15];
	
	if(sum == LEFT_IS_SOLVED)
		return ALREADY_SOLVED;

	return UNSOLVED;
}

signed short solved_distance(CUBE_4x4_ARRANGEMENT your_cube)
{
	// return 0 if solved now
	// return 1 if 1 move away from being solved
	// return 2 if 2 moves away from being solved
	// return -1 if unsolved


	signed short top_solved_status, front_solved_status, right_solved_status, bottom_solved_status, back_solved_status, left_solved_status;

	unsigned short current_cube_row_data, current_database_row_data;
	unsigned long total_entries_in_database;
	unsigned long total_bytes_in_database;
	unsigned long index_start, index_stop, index_offset;

	top_solved_status    = top_solved(your_cube);
	front_solved_status  = front_solved(your_cube);
	right_solved_status  = right_solved(your_cube);
	bottom_solved_status = bottom_solved(your_cube);
	back_solved_status   = back_solved(your_cube);
	left_solved_status   = left_solved(your_cube);

	// if all cubes are in the right place, 0 is returned by each of 6 variables. 0 means "solved now"
	if((top_solved_status == ALREADY_SOLVED) && (front_solved_status == ALREADY_SOLVED) && (right_solved_status == ALREADY_SOLVED) && (bottom_solved_status == ALREADY_SOLVED) && (back_solved_status == ALREADY_SOLVED) && (left_solved_status == ALREADY_SOLVED))
	{
		return ALREADY_SOLVED;
	}

	/*****************************************************/
	/*****************************************************/
	/**                                                 **/
	/**          2-TURN-FROM-SOLUTION DATABASE          **/
	/**                                                 **/
	/*****************************************************/
	/*****************************************************/

	test_tfs_02:
	if(GLOBAL_PROBE_TFS_2_DATABASE)
	{
		TFS_02_ARRAY_INDEX = 0;
		current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_top[0], your_cube.cube_top[1], your_cube.cube_top[2], your_cube.cube_top[3]);

		switch(current_cube_row_data)
		{
			case 1111: index_start = 0; index_stop = 10200; break;
			case 1121: index_start = 10224; index_stop = 11184; break;
			case 1131: index_start = 11208; index_stop = 11304; break;
			case 1141: index_start = 11328; index_stop = 12312; break;
			case 1151: index_start = 12336; index_stop = 13296; break;
			case 1161: index_start = 13320; index_stop = 13416; break;
			case 1211: index_start = 13440; index_stop = 14400; break;
			case 1221: index_start = 14424; index_stop = 14424; break;
			case 1241: index_start = 14448; index_stop = 14448; break;
			case 1251: index_start = 14472; index_stop = 14472; break;
			case 1311: index_start = 14496; index_stop = 14592; break;
			case 1411: index_start = 14616; index_stop = 15600; break;
			case 1421: index_start = 15624; index_stop = 15624; break;
			case 1441: index_start = 15648; index_stop = 15672; break;
			case 1451: index_start = 15696; index_stop = 15696; break;
			case 1511: index_start = 15720; index_stop = 16680; break;
			case 1521: index_start = 16704; index_stop = 16704; break;
			case 1541: index_start = 16728; index_stop = 16728; break;
			case 1551: index_start = 16752; index_stop = 16752; break;
			case 1611: index_start = 16776; index_stop = 16872; break;
			case 2112: index_start = 16896; index_stop = 17856; break;
			case 2122: index_start = 17880; index_stop = 17880; break;
			case 2142: index_start = 17904; index_stop = 17904; break;
			case 2152: index_start = 17928; index_stop = 17928; break;
			case 2212: index_start = 17952; index_stop = 17952; break;
			case 2222: index_start = 17976; index_stop = 18000; break;
			case 2332: index_start = 18024; index_stop = 18048; break;
			case 2412: index_start = 18072; index_stop = 18072; break;
			case 2442: index_start = 18096; index_stop = 18120; break;
			case 2512: index_start = 18144; index_stop = 18144; break;
			case 2662: index_start = 18168; index_stop = 18192; break;
			case 3113: index_start = 18216; index_stop = 18312; break;
			case 3233: index_start = 18336; index_stop = 18360; break;
			case 3323: index_start = 18384; index_stop = 18408; break;
			case 3333: index_start = 18432; index_stop = 19296; break;
			case 3343: index_start = 19320; index_stop = 19320; break;
			case 3353: index_start = 19344; index_stop = 19368; break;
			case 3363: index_start = 19392; index_stop = 19392; break;
			case 3433: index_start = 19416; index_stop = 19416; break;
			case 3533: index_start = 19440; index_stop = 19464; break;
			case 3633: index_start = 19488; index_stop = 19488; break;
			case 3663: index_start = 19512; index_stop = 19512; break;
			case 4114: index_start = 19536; index_stop = 20520; break;
			case 4124: index_start = 20544; index_stop = 20544; break;
			case 4144: index_start = 20568; index_stop = 20592; break;
			case 4154: index_start = 20616; index_stop = 20616; break;
			case 4214: index_start = 20640; index_stop = 20640; break;
			case 4244: index_start = 20664; index_stop = 20688; break;
			case 4334: index_start = 20712; index_stop = 20712; break;
			case 4414: index_start = 20736; index_stop = 20760; break;
			case 4424: index_start = 20784; index_stop = 20808; break;
			case 4444: index_start = 20832; index_stop = 21816; break;
			case 4454: index_start = 21840; index_stop = 21864; break;
			case 4514: index_start = 21888; index_stop = 21888; break;
			case 4544: index_start = 21912; index_stop = 21936; break;
			case 4664: index_start = 21960; index_stop = 21960; break;
			case 5115: index_start = 21984; index_stop = 22944; break;
			case 5125: index_start = 22968; index_stop = 22968; break;
			case 5145: index_start = 22992; index_stop = 22992; break;
			case 5155: index_start = 23016; index_stop = 23016; break;
			case 5215: index_start = 23040; index_stop = 23040; break;
			case 5335: index_start = 23064; index_stop = 23088; break;
			case 5415: index_start = 23112; index_stop = 23112; break;
			case 5445: index_start = 23136; index_stop = 23160; break;
			case 5515: index_start = 23184; index_stop = 23184; break;
			case 5555: index_start = 23208; index_stop = 23232; break;
			case 5665: index_start = 23256; index_stop = 23280; break;
			case 6116: index_start = 23304; index_stop = 23400; break;
			case 6266: index_start = 23424; index_stop = 23448; break;
			case 6336: index_start = 23472; index_stop = 23472; break;
			case 6366: index_start = 23496; index_stop = 23496; break;
			case 6466: index_start = 23520; index_stop = 23520; break;
			case 6566: index_start = 23544; index_stop = 23568; break;
			case 6626: index_start = 23592; index_stop = 23616; break;
			case 6636: index_start = 23640; index_stop = 23640; break;
			case 6646: index_start = 23664; index_stop = 23664; break;
			case 6656: index_start = 23688; index_stop = 23712; break;
			case 6666: index_start = 23736; index_stop = 24600; break;
			default: goto test_tfs_01; break;
		}

	
		for(TFS_02_ARRAY_INDEX = index_start; TFS_02_ARRAY_INDEX <= index_stop; TFS_02_ARRAY_INDEX+= 24)
		{
			GLOBAL_TFS_2_DATABASE_PROBES++;

			index_offset = 0;

			/*********************************/
			/* TOP face match existing cube? */
			/*********************************/
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_top[0], your_cube.cube_top[1], your_cube.cube_top[2], your_cube.cube_top[3]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_top[4], your_cube.cube_top[5], your_cube.cube_top[6], your_cube.cube_top[7]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_top[8], your_cube.cube_top[9], your_cube.cube_top[10], your_cube.cube_top[11]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_top[12], your_cube.cube_top[13], your_cube.cube_top[14], your_cube.cube_top[15]);
			if(current_database_row_data != current_cube_row_data) continue;

			/***********************************/
			/* FRONT face match existing cube? */
			/***********************************/
			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_front[0], your_cube.cube_front[1], your_cube.cube_front[2], your_cube.cube_front[3]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_front[4], your_cube.cube_front[5], your_cube.cube_front[6], your_cube.cube_front[7]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_front[8], your_cube.cube_front[9], your_cube.cube_front[10], your_cube.cube_front[11]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_front[12], your_cube.cube_front[13], your_cube.cube_front[14], your_cube.cube_front[15]);
			if(current_database_row_data != current_cube_row_data) continue;

			/***********************************/
			/* RIGHT face match existing cube? */
			/***********************************/
			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_right[0], your_cube.cube_right[1], your_cube.cube_right[2], your_cube.cube_right[3]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_right[4], your_cube.cube_right[5], your_cube.cube_right[6], your_cube.cube_right[7]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_right[8], your_cube.cube_right[9], your_cube.cube_right[10], your_cube.cube_right[11]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_right[12], your_cube.cube_right[13], your_cube.cube_right[14], your_cube.cube_right[15]);
			if(current_database_row_data != current_cube_row_data) continue;

			/************************************/
			/* BOTTOM face match existing cube? */
			/************************************/
			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_bottom[0], your_cube.cube_bottom[1], your_cube.cube_bottom[2], your_cube.cube_bottom[3]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_bottom[4], your_cube.cube_bottom[5], your_cube.cube_bottom[6], your_cube.cube_bottom[7]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_bottom[8], your_cube.cube_bottom[9], your_cube.cube_bottom[10], your_cube.cube_bottom[11]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_bottom[12], your_cube.cube_bottom[13], your_cube.cube_bottom[14], your_cube.cube_bottom[15]);
			if(current_database_row_data != current_cube_row_data) continue;

			/**********************************/
			/* BACK face match existing cube? */
			/**********************************/
			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_back[0], your_cube.cube_back[1], your_cube.cube_back[2], your_cube.cube_back[3]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_back[4], your_cube.cube_back[5], your_cube.cube_back[6], your_cube.cube_back[7]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_back[8], your_cube.cube_back[9], your_cube.cube_back[10], your_cube.cube_back[11]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_back[12], your_cube.cube_back[13], your_cube.cube_back[14], your_cube.cube_back[15]);
			if(current_database_row_data != current_cube_row_data) continue;

			/**********************************/
			/* LEFT face match existing cube? */
			/**********************************/
			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_left[0], your_cube.cube_left[1], your_cube.cube_left[2], your_cube.cube_left[3]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_left[4], your_cube.cube_left[5], your_cube.cube_left[6], your_cube.cube_left[7]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_left[8], your_cube.cube_left[9], your_cube.cube_left[10], your_cube.cube_left[11]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_left[12], your_cube.cube_left[13], your_cube.cube_left[14], your_cube.cube_left[15]);
			if(current_database_row_data == current_cube_row_data)
			{
				return SOLVED_IN_2_MORE_MOVES;
			}
		}
	}

test_tfs_01:
if(GLOBAL_PROBE_TFS_1_DATABASE)
	{
		TFS_01_ARRAY_INDEX = 0;
		current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_top[0], your_cube.cube_top[1], your_cube.cube_top[2], your_cube.cube_top[3]);

		switch(current_cube_row_data)
		{
			case 1111: index_start = 0; index_stop = 552; break;
			case 1121: index_start = 576; index_stop = 576; break; 
			case 1141: index_start = 600; index_stop = 600; break;
			case 1151: index_start = 624; index_stop = 624; break;
			case 1211: index_start = 648; index_stop = 648; break;
			case 1411: index_start = 672; index_stop = 672; break;
			case 1511: index_start = 696; index_stop = 696; break;
			case 2112: index_start = 720; index_stop = 720; break;
			case 3333: index_start = 744; index_stop = 744; break;
			case 4114: index_start = 768; index_stop = 768; break;
			case 4444: index_start = 792; index_stop = 792; break;
			case 5115: index_start = 816; index_stop = 816; break;
			case 6666: index_start = 840; index_stop = 840; break;
			default: return UNSOLVED; break;
		}

	
		for(TFS_01_ARRAY_INDEX = index_start; TFS_01_ARRAY_INDEX <= index_stop; TFS_01_ARRAY_INDEX+= 24)
		{
			GLOBAL_TFS_1_DATABASE_PROBES++;

			index_offset = 0;

			/*********************************/
			/* TOP face match existing cube? */
			/*********************************/
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_top[0], your_cube.cube_top[1], your_cube.cube_top[2], your_cube.cube_top[3]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_top[4], your_cube.cube_top[5], your_cube.cube_top[6], your_cube.cube_top[7]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_top[8], your_cube.cube_top[9], your_cube.cube_top[10], your_cube.cube_top[11]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_top[12], your_cube.cube_top[13], your_cube.cube_top[14], your_cube.cube_top[15]);
			if(current_database_row_data != current_cube_row_data) continue;

			/***********************************/
			/* FRONT face match existing cube? */
			/***********************************/
			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_front[0], your_cube.cube_front[1], your_cube.cube_front[2], your_cube.cube_front[3]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_front[4], your_cube.cube_front[5], your_cube.cube_front[6], your_cube.cube_front[7]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_front[8], your_cube.cube_front[9], your_cube.cube_front[10], your_cube.cube_front[11]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_front[12], your_cube.cube_front[13], your_cube.cube_front[14], your_cube.cube_front[15]);
			if(current_database_row_data != current_cube_row_data) continue;

			/***********************************/
			/* RIGHT face match existing cube? */
			/***********************************/
			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_right[0], your_cube.cube_right[1], your_cube.cube_right[2], your_cube.cube_right[3]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_right[4], your_cube.cube_right[5], your_cube.cube_right[6], your_cube.cube_right[7]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_right[8], your_cube.cube_right[9], your_cube.cube_right[10], your_cube.cube_right[11]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_right[12], your_cube.cube_right[13], your_cube.cube_right[14], your_cube.cube_right[15]);
			if(current_database_row_data != current_cube_row_data) continue;

			/************************************/
			/* BOTTOM face match existing cube? */
			/************************************/
			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_bottom[0], your_cube.cube_bottom[1], your_cube.cube_bottom[2], your_cube.cube_bottom[3]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_bottom[4], your_cube.cube_bottom[5], your_cube.cube_bottom[6], your_cube.cube_bottom[7]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_bottom[8], your_cube.cube_bottom[9], your_cube.cube_bottom[10], your_cube.cube_bottom[11]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_bottom[12], your_cube.cube_bottom[13], your_cube.cube_bottom[14], your_cube.cube_bottom[15]);
			if(current_database_row_data != current_cube_row_data) continue;

			/**********************************/
			/* BACK face match existing cube? */
			/**********************************/
			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_back[0], your_cube.cube_back[1], your_cube.cube_back[2], your_cube.cube_back[3]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_back[4], your_cube.cube_back[5], your_cube.cube_back[6], your_cube.cube_back[7]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_back[8], your_cube.cube_back[9], your_cube.cube_back[10], your_cube.cube_back[11]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_back[12], your_cube.cube_back[13], your_cube.cube_back[14], your_cube.cube_back[15]);
			if(current_database_row_data != current_cube_row_data) continue;

			/**********************************/
			/* LEFT face match existing cube? */
			/**********************************/
			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_left[0], your_cube.cube_left[1], your_cube.cube_left[2], your_cube.cube_left[3]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_left[4], your_cube.cube_left[5], your_cube.cube_left[6], your_cube.cube_left[7]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_left[8], your_cube.cube_left[9], your_cube.cube_left[10], your_cube.cube_left[11]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_left[12], your_cube.cube_left[13], your_cube.cube_left[14], your_cube.cube_left[15]);
			if(current_database_row_data == current_cube_row_data)
			{
				return SOLVED_IN_1_MORE_MOVE;
			}
		}
	}

	return UNSOLVED;
}



void init_array_based_cube(void)
{
	unsigned short i;

	init_user_search_preferences();
	init_search_variables();

	for(i = 0; i<16; i++)
	{
		global_4x4x4_array_cube.cube_top[i]    = CONSTANT_TOP;
		global_4x4x4_array_cube.cube_front[i]  = CONSTANT_FRONT;
		global_4x4x4_array_cube.cube_right[i]  = CONSTANT_RIGHT;

		global_4x4x4_array_cube.cube_bottom[i] = CONSTANT_BOTTOM;
		global_4x4x4_array_cube.cube_back[i]   = CONSTANT_BACK;
		global_4x4x4_array_cube.cube_left[i]   = CONSTANT_LEFT;
	}

	for(i = 1; i<= MAX_DEPTH; i++)
		GLOBAL_CUBE_SOLUTION[i-1] = 0;
}

void answer_4x4x4(unsigned short distance_returned)
{
	switch(distance_returned)
	{
		case ALREADY_SOLVED: printf("This 4x4x4 cube is already solved.\n\n"); break;
		case SOLVED_IN_1_MORE_MOVE : printf("This 4x4x4 cube is 1 move from being solved after %llu probes.\n\n", GLOBAL_TFS_1_DATABASE_PROBES); break;
		case SOLVED_IN_2_MORE_MOVES : printf("This 4x4x4 cube is 2 moves from being solved after %llu probes.\n\n", GLOBAL_TFS_2_DATABASE_PROBES); break;
		default: printf("This 4x4x4 cube is more than 2 moves from being solved.\n\n"); break;
	}
}

void enter_your_position_here(void)
{
	unsigned short how_far_away_is_solution;

	//An example of U = just change the 1st row of the 4 faces, front, right, back, left.
	//1st row = 0,1,2,3. 2nd row = 4,5,6,7. 3rd row = 8,9,10,11. 4th row = 12,13,14,15.

	printf("Testing U'\n\n");

	//call this to reset the cube to solved state
	init_array_based_cube();

	global_4x4x4_array_cube.cube_front[0] = CONSTANT_LEFT;
	global_4x4x4_array_cube.cube_front[1] = CONSTANT_LEFT;
	global_4x4x4_array_cube.cube_front[2] = CONSTANT_LEFT;
	global_4x4x4_array_cube.cube_front[3] = CONSTANT_LEFT;

	global_4x4x4_array_cube.cube_right[0] = CONSTANT_FRONT;
	global_4x4x4_array_cube.cube_right[1] = CONSTANT_FRONT;
	global_4x4x4_array_cube.cube_right[2] = CONSTANT_FRONT;
	global_4x4x4_array_cube.cube_right[3] = CONSTANT_FRONT;

	global_4x4x4_array_cube.cube_back[0] = CONSTANT_RIGHT;
	global_4x4x4_array_cube.cube_back[1] = CONSTANT_RIGHT;
	global_4x4x4_array_cube.cube_back[2] = CONSTANT_RIGHT;
	global_4x4x4_array_cube.cube_back[3] = CONSTANT_RIGHT;

	global_4x4x4_array_cube.cube_left[0] = CONSTANT_BACK;
	global_4x4x4_array_cube.cube_left[1] = CONSTANT_BACK;
	global_4x4x4_array_cube.cube_left[2] = CONSTANT_BACK;
	global_4x4x4_array_cube.cube_left[3] = CONSTANT_BACK;

	how_far_away_is_solution = solved_distance(global_4x4x4_array_cube);

	answer_4x4x4(how_far_away_is_solution);

	printf("Testing f2, which should be one move away (2 turns of the same side == 1 move)\n\n");

	//call this to reset the cube to solved state
	init_array_based_cube();

	global_4x4x4_array_cube.cube_top[8] =  CONSTANT_BOTTOM;
	global_4x4x4_array_cube.cube_top[9] =  CONSTANT_BOTTOM;
	global_4x4x4_array_cube.cube_top[10] =  CONSTANT_BOTTOM;
	global_4x4x4_array_cube.cube_top[11] = CONSTANT_BOTTOM;

	// holding the cube with right facing us, different indices result
	global_4x4x4_array_cube.cube_right[1] =  CONSTANT_LEFT;
	global_4x4x4_array_cube.cube_right[5] =  CONSTANT_LEFT;
	global_4x4x4_array_cube.cube_right[9] =  CONSTANT_LEFT;
	global_4x4x4_array_cube.cube_right[13] = CONSTANT_LEFT;

	//roll the cube in your hands from top to front to bottom to get this frame of reference
	global_4x4x4_array_cube.cube_bottom[4] = CONSTANT_TOP;
	global_4x4x4_array_cube.cube_bottom[5] = CONSTANT_TOP;
	global_4x4x4_array_cube.cube_bottom[6] = CONSTANT_TOP;
	global_4x4x4_array_cube.cube_bottom[7] = CONSTANT_TOP;

	// holding the cube facing front, and roll to the left to get this frame of reference
	global_4x4x4_array_cube.cube_left[2] = CONSTANT_RIGHT;
	global_4x4x4_array_cube.cube_left[6] = CONSTANT_RIGHT;
	global_4x4x4_array_cube.cube_left[10] = CONSTANT_RIGHT;
	global_4x4x4_array_cube.cube_left[14] = CONSTANT_RIGHT;

	how_far_away_is_solution = solved_distance(global_4x4x4_array_cube);

	answer_4x4x4(how_far_away_is_solution);

	printf("Testing f2 R', which should be 2 moves away\n\n");

	//call this to reset the cube to solved state
	init_array_based_cube();

	global_4x4x4_array_cube.cube_top[8] =  CONSTANT_BOTTOM;
	global_4x4x4_array_cube.cube_top[9] =  CONSTANT_BOTTOM;
	global_4x4x4_array_cube.cube_top[10] = CONSTANT_BOTTOM;

	global_4x4x4_array_cube.cube_top[3] = CONSTANT_BACK;
	global_4x4x4_array_cube.cube_top[7] = CONSTANT_BACK;
	global_4x4x4_array_cube.cube_top[11] = CONSTANT_BACK;
	global_4x4x4_array_cube.cube_top[15] = CONSTANT_BACK;

	// holding the cube with right facing us, different indices result
	global_4x4x4_array_cube.cube_right[8] =  CONSTANT_LEFT;
	global_4x4x4_array_cube.cube_right[9] =  CONSTANT_LEFT;
	global_4x4x4_array_cube.cube_right[10] = CONSTANT_LEFT;
	global_4x4x4_array_cube.cube_right[11] = CONSTANT_LEFT;

	//roll the cube in your hands from top to front to bottom to get this frame of reference
	global_4x4x4_array_cube.cube_bottom[4] = CONSTANT_TOP;
	global_4x4x4_array_cube.cube_bottom[5] = CONSTANT_TOP;
	global_4x4x4_array_cube.cube_bottom[6] = CONSTANT_TOP;

	global_4x4x4_array_cube.cube_bottom[3] = CONSTANT_FRONT;
	global_4x4x4_array_cube.cube_bottom[7] = CONSTANT_FRONT;
	global_4x4x4_array_cube.cube_bottom[11] = CONSTANT_FRONT;
	global_4x4x4_array_cube.cube_bottom[15] = CONSTANT_FRONT;

	// holding the cube facing front, and roll to the left to get this frame of reference
	global_4x4x4_array_cube.cube_left[2] = CONSTANT_RIGHT;
	global_4x4x4_array_cube.cube_left[6] = CONSTANT_RIGHT;
	global_4x4x4_array_cube.cube_left[10] = CONSTANT_RIGHT;
	global_4x4x4_array_cube.cube_left[14] = CONSTANT_RIGHT;

	// holding the cube facing front
	global_4x4x4_array_cube.cube_front[3] = CONSTANT_TOP;
	global_4x4x4_array_cube.cube_front[7] = CONSTANT_TOP;
	global_4x4x4_array_cube.cube_front[11] = CONSTANT_BOTTOM;
	global_4x4x4_array_cube.cube_front[15] = CONSTANT_TOP;

	// holding the cube facing front, then rotate it 180 degrees horizontally
	global_4x4x4_array_cube.cube_back[0] = CONSTANT_BOTTOM;
	global_4x4x4_array_cube.cube_back[4] = CONSTANT_BOTTOM;
	global_4x4x4_array_cube.cube_back[8] = CONSTANT_TOP;
	global_4x4x4_array_cube.cube_back[12] = CONSTANT_BOTTOM;

	how_far_away_is_solution = solved_distance(global_4x4x4_array_cube);

	answer_4x4x4(how_far_away_is_solution);
}

int _tmain(int argc, _TCHAR* argv[])
{
	int result_code;

	init_array_based_cube();

	enter_your_position_here();

	while(1)
	{
	}

	return 0;

};
 
Last edited:

rokicki

Member
Joined
Oct 31, 2008
Messages
301
Another easy pruning heuristic that doesn't even require a nontrivial table is this.
This works best in the outer block turn metric, which is my favorite.

For every corner->edge pair that should be adjacent, and every edge->edge
pair that should be adjacent, but isn't, add one. Take the total sum and
divide by 4; if there is any remainder, add one. This is a lower bound on the
number of remaining moves.

The average here will probably be about 9 moves.

And for every such pair as described above, you can also determine:

1. If it is paired, what moves will unpair it;
2. If it is not paired, what moves will pair it.

Thus, you can trivially "look ahead" one move in this heuristic, so your
average distance is probably closer to 10 (if you are at 9 but no moves
bring you to 8, you must be at 10).

You can apply this one two ways, too: to the current position, and to
its inverse.

I think this one complements the corners pruning table fairly well. But
it doesn't help much with the centers.

-tom
 

unsolved

Member
Joined
Mar 2, 2014
Messages
566
Location
Doylestown, PA
I think this one complements the corners pruning table fairly well. But
it doesn't help much with the centers.

Hi Tom,

I spend a fair amount of time thinking about ways to "deal with the centers" in terms of pruning. Just look at this treasure trove of possibilities:

lots_of_solutions.jpg


All of those paths to 3-turn and 2-turn database solutions represent nodes with known distances that can be probed from a table to hacksaw the game tree. I modified my program to accept different search term parameters and collect all, most, or some of these positions, depending on how fast I want to see an answer to a problem, or how many answers I want to see.

For maximum speed, you treat endgame databases as "one strike, you're out." If you hit the 3-TFS database, you know every other 3-TFS position at that depth will not bring you any closer to an optimal line of play. Turn it off! Your search speed goes up, the 2-TFS and 1-TFS get hit harder, and you get an improved distance if you encounter any such database position in your search.

You could also try the "one strike, you're safe" approach, and not turn off the most-distant database until the end of the iteration depth. At ply-6 if you hit a 3-TFS entry, you might want to see all of the paths to the 3-TFS. But once you start ply-7, this would be counterproductive. You'd only probe TFS-2 and TFS-1 at ply-7, then only TFS-1 at ply-8, then none of the above at ply-9.

I still believe that having every possible 1-face vs. 1 face database of every color configuration of centers would be an awesome pruning tool. Example:

4 red, 4 blue
4 red, 3 blue + 1 white
4 red, 3 blue + 1 yellow

...

3 red + 1 blue, 3 blue + 1 white
3 red + 1 blue, 2 blue + 1 yellow

...

0 red + 1 white + 1 yellow + 1 blue+ 1 green, 0 blue + 1 orange + 1 white + 1 green + 1 red

As I mentioned before, a chain is only as strong as its weakest link. Likewise, when you consider the centers across all faces, the quickest solve can't be faster than the longest-to-solve center configuration between just 2 faces.
So knowing all of these 2-face combos would basically be almost as good as having every one of those 24!/4! centers mapped. Why? In the first case, it doesn't matter if you are 19 or God's Number for 4x4x4 away from a solution, a pruned branch is a pruned branch. And secondly, even if you had all of the centers solved, you'd never be able to access the data to make use of it! So why wish for something you can't utilize?

This 1-Face vs. 1-Face of all centers has to be the way to go for center pruning tables.

Code:
Solution to 4x4x4 cube center scenario U1:F1 with [B]"One strike, you're safe"[/B] configuration.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|OOOO|####|####|   |OOOO|####|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  U  r  u2 r' U  r   [INSIDE 3-turn database] @ 000000000007734244 nodes with 000000011995681252 3-TFS database probes           
Solution [002] =  U  f  u' f' U2 f   [INSIDE 3-turn database] @ 000000000015321430 nodes with 000000020416154204 3-TFS database probes           
Solution [003] =  U' r  u2 r' U' r   [INSIDE 3-turn database] @ 000000000028339219 nodes with 000000038812493717 3-TFS database probes           
Solution [004] =  U' b  u  b' U2 b   [INSIDE 3-turn database] @ 000000000038489054 nodes with 000000050780609717 3-TFS database probes           
Solution [005] =  U2 f  u' f' U  f   [INSIDE 3-turn database] @ 000000000056531248 nodes with 000000074888579146 3-TFS database probes           
Solution [006] =  U2 b  u  b' U' b   [INSIDE 3-turn database] @ 000000000059093963 nodes with 000000078532776871 3-TFS database probes           
Solution [007] =  u  L' u' l  u  L'  [INSIDE 3-turn database] @ 000000000071322856 nodes with 000000093838647893 3-TFS database probes           
Solution [008] =  u  L' u' l  u  L   [INSIDE 2-turn database] @ 000000000071322857 nodes with 000000004575143791 2-TFS database probes           
** TFS-3 database is now off. **
Solution [009] =  u' R' u  l  u' R   [INSIDE 2-turn database] @ 000000000084671461 nodes with 000000005469700467 2-TFS database probes           
Solution [010] =  u' b' u  F  u' b   [INSIDE 2-turn database] @ 000000000095727818 nodes with 000000006124422084 2-TFS database probes           
Solution [011] =  d' b  d  F' d' b'  [INSIDE 2-turn database] @ 000000000131859229 nodes with 000000008350977489 2-TFS database probes           
Solution [012] =  r  u2 r' U2 r  u2  [INSIDE 2-turn database] @ 000000000279311235 nodes with 000000016681909072 2-TFS database probes           
Solution [013] =  r' b2 r  F2 r' b2  [INSIDE 2-turn database] @ 000000000310945476 nodes with 000000017734270694 2-TFS database probes           
Solution [014] =  l' U  r  U' l  U   [INSIDE 2-turn database] @ 000000000331691122 nodes with 000000018447098967 2-TFS database probes           
Solution [015] =  l  F  r' F' l' F   [INSIDE 2-turn database] @ 000000000357853534 nodes with 000000019430007006 2-TFS database probes           
Solution [016] =  f  u' f' U' f  u   [INSIDE 2-turn database] @ 000000000492667483 nodes with 000000025836897273 2-TFS database probes           
Solution [017] =  b' R' b  l' b' R   [INSIDE 2-turn database] @ 000000000554149858 nodes with 000000029094999956 2-TFS database probes           
Solution [018] =  b  u  b' U  b  u'  [INSIDE 2-turn database] @ 000000000564731510 nodes with 000000029497922103 2-TFS database probes           
Solution [019] =  b  L' b' l' b  L   [INSIDE 2-turn database] @ 000000000576006881 nodes with 000000030093779536 2-TFS database probes
 
Last edited:

cuBerBruce

Member
Joined
Oct 8, 2006
Messages
914
Location
Malden, MA, USA
WCA
2006NORS01
YouTube
Visit Channel
And what is GAP?

GAP is a free interactive system and programming language available here. As a general programming language, it may not be anywhere as fast as C/C++, but it has a lot of useful mathematics-related built-in functions that make it quite awesome. Particularly, it has a built-in data type for permutations, and also many built-in functions for permutation groups.

so, you can make definitions for the basic moves of a puzzle as permutations of facelets, and it can automatically determine the number of different permutations of the puzzle.

Code:
gap> U := ( 1, 3, 8, 6)( 2, 5, 7, 4)( 9,33,25,17)(10,34,26,18)(11,35,27,19);
(1,3,8,6)(2,5,7,4)(9,33,25,17)(10,34,26,18)(11,35,27,19)
gap> L := ( 9,11,16,14)(10,13,15,12)( 1,17,41,40)( 4,20,44,37)( 6,22,46,35);
(1,17,41,40)(4,20,44,37)(6,22,46,35)(9,11,16,14)(10,13,15,12)
gap> F := (17,19,24,22)(18,21,23,20)( 6,25,43,16)( 7,28,42,13)( 8,30,41,11);
(6,25,43,16)(7,28,42,13)(8,30,41,11)(17,19,24,22)(18,21,23,20)
gap> R := (25,27,32,30)(26,29,31,28)( 3,38,43,19)( 5,36,45,21)( 8,33,48,24);
(3,38,43,19)(5,36,45,21)(8,33,48,24)(25,27,32,30)(26,29,31,28)
gap> B := (33,35,40,38)(34,37,39,36)( 3, 9,46,32)( 2,12,47,29)( 1,14,48,27);
(1,14,48,27)(2,12,47,29)(3,9,46,32)(33,35,40,38)(34,37,39,36)
gap> D := (41,43,48,46)(42,45,47,44)(14,22,30,38)(15,23,31,39)(16,24,32,40);
(14,22,30,38)(15,23,31,39)(16,24,32,40)(41,43,48,46)(42,45,47,44)
gap> Size(Group(U,D,L,R,B,F));
43252003274489856000

Code:
Found solution: [11]  U  u' L' f  r2 f  r2 f2 L  U' u

Now that is cool! I'll have to set that up on a test run a little later.

This alg can be expressed as a conjugated commutator.
U u' L' f r2 f r2 f2 L U' u = [U u' L' f: [r2, f]]

If you look at the inner commutator [r2, f] = r2 f r2 f', its apparent it moves at least 6 center pieces. These are in fact the only center pieces that move, and its two separate 3-cycles.

Solution [1] finds a 3-TFS solution @ depth 6.
Solution [2] finds a 2-TFS solution @ depth 7, which you expect. By definition, there must be one solution of "distance - 1" when you find a turns-from-solved database solution from the previous iteration.

But now look at Solution [3].

It's back in the 3-TFS database just one node away from the 2-FTS solution just encountered. And the next node is also a 3-TFS solution.

With iterative deepening and proper move generator and TFS databases, you should always find the optimal solutions first using the maximum depth of your TFS database. For example, let's say the optimal solution for a given case has 11 moves and you have a database for positions 3 moves from solved. Your search should find the solutions by generating a tree to depth 8 and finding the resulting optimal solutions by searching the "depth 3" TFS database. There is no real point in searching "depth 2" and "depth 1" database since any solutions that might be found should have been found by an earlier depth in the iterative deepening. (In testing your code, you may well want to check the "depth 2" and "depth 1" TFS databases, just to verify that you never find any new optimal solutions this way. But this is essentially a waste of time. In the long run, I think you want to change the multiple TFS databases into a single hash table that stores the distance for each relevant position.)

What is happening is that you are find sub-optimal solutions by searching deeper than necessary, and many of the suboptimal solutions found will involve a move cancellation between the last move in the brute force tree and the first move for the position in the TFS database.

By "proper move generator and TFS databases" above, I mean that the "brute force" move generator builds an M-depth tree containing all algs that produce distinct supercube positions (producing the result of composing the scramble position with that supercube position), and your N-TFS databases have every non-supercube position N moves from solved.

EDIT:
I still believe that having every possible 1-face vs. 1 face database of every color configuration of centers would be an awesome pruning tool. Example:

4 red, 4 blue
4 red, 3 blue + 1 white
4 red, 3 blue + 1 yellow

...

3 red + 1 blue, 3 blue + 1 white
3 red + 1 blue, 2 blue + 1 yellow

...

0 red + 1 white + 1 yellow + 1 blue+ 1 green, 0 blue + 1 orange + 1 white + 1 green + 1 red

Each center piece has four locations it can be in order to be considered solved (assuming we have some sort of reference that determines which face it must go to). So my intuition is that you will get better pruning tables if you consider full sets of 4 center pieces for a face rather than looking at a set of positions that will contain a random set of center cubies.
 
Last edited:

unsolved

Member
Joined
Mar 2, 2014
Messages
566
Location
Doylestown, PA
GAP is a free interactive system and programming language

Thanks Bruce, I will check it out.

This alg can be expressed as a conjugated commutator.
U u' L' f r2 f r2 f2 L U' u = [U u' L' f: [r2, f]]

Yeah, I am going to have to learn such lingo and its application to cubing.

With iterative deepening and proper move generator and TFS databases, you should always find the optimal solutions first using the maximum depth of your TFS database.

I used to probe TFS-3 first, but just today I found a counter-example. I have a text dump in one of my directories, I was running 16 instances of the program to test various TFS-usage strategies. Here is the thing: Once I have a TFS result from the lookup code, it returns the value back to the search routine, and no longer searches any other TFS databases for that particular position. So, if I hit a TFS-3 position, and TFS-2 and TFS-1 are coded to be probed afterwards, I get more "unwanted" solutions as the depths go on. I can't find a screenshot showing this right now, but I have two different implementations shown below.

This is TFS Probing Configuration 2:

busy.jpg


I don't know when I will encounter a TFS position, and at most depths, I don't. So until I do, my "solution_length" variable is set to 999. Once I hit a TFS entry, my best solution is now depth + TFS distance. Note I have a little arrow pointing to a few entries. Each such entry is an improved solution depth. When I encounter a TFS-3 solution in this implementation, I keep that database on and active, until I encounter a TFS-2 or TFS-1 at the same depth.

Solution [008] is a TFS-2 hit, so the solution is now improved. At this point, probing TFS-3 does not make any more sense. I'll only find "oversolved" positions, like you mentioned. An additional turn is made that is just undone by a larger TFS database, so there is no point.

I continue to probe TFS-2 and TFS-1 until the end of the iteration, looking for improvements. Of course, I can always hit on a nominal depth solution, which trumps every TFS entry with an immediate solution.

At the end of depth-6, an 8-turn solution was found, and there is no need to search any longer. So the search halts, you can see some debug info on the screen "condition 02" being encountered in the code (lets me know where it was triggered).

That's one way to use the TFS databases, here is another:

TFS Probing Configuration 3:

ultra-optimized.jpg


In this configuration, as soon as I encounter one TFS position, I shut off probing that database immediately, without completing the iteration. Why? I know all subsequent solutions for that database cannot improve upon the solution length. You can see after one TFS-3 encounter, pow, it's off. Next it encounters a TFS-2 position, and pow, it gets shut off too. Turning off the databases speeds up the search, so the noose always tightens more quickly than before. The tradeoff is, I miss all of those other similar paths along the way, which might be some neat algos.

There are looser settings I can apply, to allow the search to continue to the next iteration to verify the TFS code is working. I have already done that, as you alluded to. I will always finds at least one TFS "n-1" solution if I search 1 ply more deeply, and a "n-2" solution two iterations beyond, etc. I have encoded all of these as user-configurable options.



For example, let's say the optimal solution for a given case has 11 moves and you have a database for positions 3 moves from solved. Your search should find the solutions by generating a tree to depth 8 and finding the resulting optimal solutions by searching the "depth 3" TFS database. There is no real point in searching "depth 2" and "depth 1" database since any solutions that might be found should have been found by an earlier depth in the iterative deepening.

Remember, I am skipping more than one level of search at each iteration.

When I complete ply 4 with TFS-3 turned on, I have searched plies 4,5,6 and 7. So I can jump to ply 8 at once, at which time I am scanning plies 8,9,10 and 11. For lower levels of search, I don't always jump 4 plies. I'll go to depth 7 in the hopes of encountering a 7+ TFS-1 solution more quickly than a nominal depth 8 solution. There is a tradeoff. At higher depths, I'll be more likely to encounter the solution with the 4-ply jump since search times get more and more lengthy. My 4-ply jump is worth a factor of over 1,000,000 in full-width search time!

So my intuition is that you will get better pruning tables if you consider full sets of 4 center pieces for a face rather than looking at a set of positions that will contain a random set of center cubies.

It is clearly possible, which is why computer science is so awesome. You can just code it and get the results!

Good post Bruce, thanks for all of your comments.
 

cuBerBruce

Member
Joined
Oct 8, 2006
Messages
914
Location
Malden, MA, USA
WCA
2006NORS01
YouTube
Visit Channel
Remember, I am skipping more than one level of search at each iteration.

In iterative deepening, you normally don't skip iterations. You would prove that there are no solutions of depth 4+3 before looking for solutions of length 5+3, and then prove there are no solutions of length 5+3 before looking for solutions of length 6+3. In your scheme, if the solution length turns out to be 7, you would probably be spending about 800 times longer finding the solutions (with a depth 6+3 search) than if you simply had tried a length 4+3 search first.
 

unsolved

Member
Joined
Mar 2, 2014
Messages
566
Location
Doylestown, PA
In iterative deepening, you normally don't skip iterations. You would prove that there are no solutions of depth 4+3 before looking for solutions of length 5+3, and then prove there are no solutions of length 5+3 before looking for solutions of length 6+3. In your scheme, if the solution length turns out to be 7, you would probably be spending about 800 times longer finding the solutions (with a depth 6+3 search) than if you simply had tried a length 4+3 search first.

That would be true if the cost of probing the databases was 0.

Using your example:

Solution = 7, unbeknownst to the program.

Worst case scenario for the solver: Finish depth 3 + 3, advance to depth 7 immediately and begin a search of 7 + 3, at which time the databases are of no value and only slow the nominal search.
Better case scenario for the solver: Finish depth 2 + 3, advance to depth 6 immediately and begin a search of 6 + 3, after which a solution of 6 + 1 would be found.
Best case scenario for the solver: Finish depth 0 + 3, advance to depth 4 immediately and begin a search of 4 + 3, after which a solution of 4 + 3 would be found.

When you start incorporating overlap, the picture is not as clear. There are multiple database probes per node in this "quickie" implementation (the bitboard version is much more efficient and faster executing, but presently its also buggy).
Creeping along the nominal depth would only be recommended if you knew, in advance, a solution was of a certain probable depth.

Executing 2+3, 3+3, 4+3, etc would be awful if it were an 11-ply solution that would have otherwise been found after 0 + 3, 4 + 3, and 8 + 3. Scanning nominal depths of only 4 and 8 to find an 11-ply solution would outperform the other option handily.

The question remains: Is there a good "attack" scheme in general that will minimize the time-to-solution given various positions of different depths?
 

rokicki

Member
Joined
Oct 31, 2008
Messages
301
If you do the math, you realize that if you need a ply-d search, then with great
probability the ply-(d-1) search is relatively negligible (even counting every
lookup), while a ply-(d+1) search will take much too long to find the solution.

Consider the order of the search tree and what the solution distribution looks
like.

This has been done for many, many years in exactly this way by very smart
people. I'm not trying to discourage experimentation but do the math.
 

unsolved

Member
Joined
Mar 2, 2014
Messages
566
Location
Doylestown, PA
If you do the math, you realize that if you need a ply-d search, then with great
probability the ply-(d-1) search is relatively negligible (even counting every
lookup), while a ply-(d+1) search will take much too long to find the solution.

Consider the order of the search tree and what the solution distribution looks
like.

This has been done for many, many years in exactly this way by very smart
people. I'm not trying to discourage experimentation but do the math.

I hear ya :)

But the non-linear nature of my current implementation (stressing that, because the bitboard version, when it's working, is much more akin to the branching factor/depth tradeoffs you are speaking of) is pretty tricky. A quick refresher diagram:

lots_of_solutions.jpg


Look at the bottom line there, where the program identified Solution [50] while nearing the end of ply-6.

There were 492 million nodes explored and a total of 541 billion probes of the 3-TFS database. That's roughly 1099 probes per node.

Sounds like a lot, but consider there are 1026 nodes for 2 plies from solved, and you can see I'm getting 3 plies worth of information for the cost of only 2 ply worth of calculation.
Plus, a database probe in RAM is much faster than a node being generated, or else my program would be 1099 times slower.

At lower search depths, you are absolutely correct. The near-instant location of a lower depth solution justifies the shallower depth + extensions.

But what if we are talking about a 15-ply solution?

Then it would not matter if my move generator speed was only 1000 nodes/second, the database extension at those huge depths is worth much more than cranking out nodes.

If I do searches of (nominal + extended) of 0 + 3 = 3, 4 + 3 = 7, 8 + 3 = 11, 12 + 3 = 15, even assuming if the program finds the solution on the last node and last database lookup from nominal depth 12, that must outperform searches of 0 + 3 = 3, 1 + 3 = 4, 2 + 3 = 5, 3 + 3 = 6, 4 + 3 = 7, 5 + 3 = 8, 6 + 3 = 9, 7 + 3 = 10, 8 + 3 = 11, 9 + 3 = 12, 10 + 3 = 13, 11 + 3 = 14, 12 + 3 = 15.

Change that 15-ply to 8, and you're right, I'm crushed:

0 + 3 = 3, 4 + 3 = 7, 8 + 3 finds the solution the hard way at the nominal level, and would easily lose to 0 + 3 = 3, 1 + 3 = 4, 2 + 3 = 5, 3 + 3 = 6, 4 + 3 = 7, 5 + 3 = 8.

Hey, I could be totally wrong. I just wish I had a damn corner-pruner!
 

qqwref

Member
Joined
Dec 18, 2007
Messages
7,834
Location
a <script> tag near you
WCA
2006GOTT01
YouTube
Visit Channel
Your hypothetical kind of presupposes that you know the depth of the algorithm you're looking for. So when you say "what if we are talking about a 15-ply solution" - you don't know it's 15 moves until you prove all 14-move solutions don't exist! And you definitely don't know that before starting the search.

So let's make a new hypothetical, where we do your 4-move deepening, and assume it might be 15 moves, but also might be 14 or 13. Also remember that each additional move multiplies the time taken by some factor, which for simplicity I'll call 20. Let's call the time a (12+3)-move search takes 1 unit.
- Whether it is 13, 14, or 15 moves, your approach will always do 0, 4, 8, and 12 move searches. Now even an 8-move search only takes .000006 units in this hypothetical, which is negligible. So let's call this 1 unit as well.
- For a 1-move deepening approach, it's a little more complex. If it's 13 moves, we do 0, 1, ..., 10 move searches. A 10-move search takes .0025 units, a 9-move takes .000125 units, etc., for a total of about .0026 units. Roughly 380 times as fast. If the solution is 14 moves, it's 20 times that for a total of about .0526 units, which is still about 19 times as fast. And if the solution is 15 moves, then yes, we have to do about 1.0526 units worth of computation, which is 5% slower.

So the question is, are you so worried about that 5% time loss (or less, if the branch factor is more than 20) that you will accept your program may take 19 or even 380 times as long to find the optimal solutions?


Also, I don't know what you're talking about with database probes... surely, after doing your moves, you are not checking the result against every element of the 3-TFS database? Looking through that database should be O(1) - this will be especially important if you ever increase it to 4 or 5 turns. And remember, if you deepen only one move at once, you only ever need to check the biggest database you have. If you care about solutions shorter than what you have in the database, you can just run a quick search without using the database at all - the time that takes should be absolutely negligible.
 
Last edited:

rokicki

Member
Joined
Oct 31, 2008
Messages
301
Another easy pruning heuristic that doesn't even require a nontrivial table is this.
This works best in the outer block turn metric, which is my favorite.

For every corner->edge pair that should be adjacent, and every edge->edge
pair that should be adjacent, but isn't, add one. Take the total sum and
divide by 4; if there is any remainder, add one. This is a lower bound on the
number of remaining moves.
...

I think with some care this could be refined to yield distances of 11 for
most positions. This is interesting: a non-table-based heuristic seems to
outperform the best practical pruning tables we can think of for this metric
and puzzle. I think I'm going to start to play with this a bit.
 

unsolved

Member
Joined
Mar 2, 2014
Messages
566
Location
Doylestown, PA
Also, I don't know what you're talking about with database probes... surely, after doing your moves, you are not checking the result against every element of the 3-TFS database?

I'll start here since this is where I have an easy answer :)

I posted my code online, so everyone could see what it does. A snippet:

Code:
TFS_03_ARRAY_INDEX = 0;
		current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_top[0], your_cube.cube_top[1], your_cube.cube_top[2], your_cube.cube_top[3]);

		switch(current_cube_row_data)
		{
			case 1111: index_start = 0; index_stop = 184656; break;
			case 1121: index_start = 184680; index_stop = 211824; break;
			case 1131: index_start = 211848; index_stop = 218160; break;
			case 1141: index_start = 218184; index_stop = 246384; break;
			case 1151: index_start = 246408; index_stop = 273384; break;
			case 1161: index_start = 273408; index_stop = 279720; break;
			case 1211: index_start = 279744; index_stop = 306888; break;
			case 1221: index_start = 306912; index_stop = 308808; break;

...

			case 6566: index_start = 656952; index_stop = 659568; break;
			case 6616: index_start = 659592; index_stop = 659976; break;
			case 6626: index_start = 660000; index_stop = 662664; break;
			case 6636: index_start = 662688; index_stop = 664152; break;
			case 6646: index_start = 664176; index_stop = 665544; break;
			case 6656: index_start = 665568; index_stop = 668184; break;
			case 6666: index_start = 668208; index_stop = 692040; break;
			default: goto test_tfs_04; break;
		}

		for(TFS_03_ARRAY_INDEX = index_start; TFS_03_ARRAY_INDEX <= index_stop; TFS_03_ARRAY_INDEX+= 24)
		{
			GLOBAL_TFS_3_DATABASE_PROBES++;

			index_offset = 0;

			/*********************************/
			/* TOP face match existing cube? */
			/*********************************/
			current_database_row_data = GLOBAL_TFS_03_DATABASE[TFS_03_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_top[0], your_cube.cube_top[1], your_cube.cube_top[2], your_cube.cube_top[3]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_03_DATABASE[TFS_03_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_top[4], your_cube.cube_top[5], your_cube.cube_top[6], your_cube.cube_top[7]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_03_DATABASE[TFS_03_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_top[8], your_cube.cube_top[9], your_cube.cube_top[10], your_cube.cube_top[11]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_03_DATABASE[TFS_03_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_top[12], your_cube.cube_top[13], your_cube.cube_top[14], your_cube.cube_top[15]);
			if(current_database_row_data != current_cube_row_data) continue;

...

unsigned short GLOBAL_TFS_03_DATABASE[692064] = 
{1111, 1111, 1111, 1111, 2222, 1221, 1221, 1221, 6666, 3333, 3333, 3333, 5445, 2442, 2442, 2442, 1551, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 1221, 2222, 2222, 3363, 3333, 3363, 3363, 4444, 4444, 4444, 4444, 1551, 5555, 1551, 1551, 6666, 3363, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 1331, 2222, 2222, 3323, 5555, 3323, 3323, 4444, 4444, 4444, 4444, 1551, 6666, 1551, 1551, 6666, 3323, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 1551, 1551, 2222, 3333, 6666, 6666, 3333, 4444, 4444, 4444, 4444, 1551, 2222, 2222, 1551, 6666, 3333, 3333, 6666, 
1111, 1111, 1111, 1111, 2222, 1551, 2222, 1551, 3333, 6666, 3333, 6666, 5445, 5445, 5445, 5445, 1551, 2222, 1551, 2222, 6666, 3333, 6666, 3333, 
1111, 1111, 1111, 1111, 2222, 1551, 2222, 2222, 3333, 3333, 6666, 3333, 4444, 4444, 4444, 4444, 4554, 4224, 5555, 4554, 6666, 3333, 6666, 6666, 

...

6666, 6666, 2112, 2112, 4224, 4224, 4224, 4224, 3323, 3313, 3313, 3313, 5445, 5445, 3333, 3333, 1111, 5555, 5555, 5555, 5565, 4464, 4464, 4464, 
6666, 6666, 3333, 1111, 2222, 2222, 2222, 2222, 3413, 3413, 3413, 3413, 4444, 6666, 3333, 3333, 5555, 5555, 5555, 5555, 4414, 4414, 4414, 4414, 
6666, 6666, 4114, 4114, 5225, 5225, 5225, 5225, 3343, 3313, 3313, 3313, 1441, 1441, 3333, 3333, 2222, 5555, 5555, 5555, 1161, 4464, 4464, 4464, 
6666, 6666, 4444, 1111, 2222, 2222, 2222, 2222, 3613, 3613, 3613, 3613, 4444, 1111, 3333, 3333, 5555, 5555, 5555, 5555, 4434, 4434, 4434, 4434, 
6666, 6666, 5115, 5115, 1221, 1221, 1221, 1221, 3353, 3313, 3313, 3313, 2442, 2442, 3333, 3333, 4444, 5555, 5555, 5555, 2262, 4464, 4464, 4464, 
6666, 6666, 6666, 1111, 2222, 2222, 2222, 2222, 3113, 3113, 3113, 3113, 4444, 3333, 3333, 3333, 5555, 5555, 5555, 5555, 4444, 4444, 4444, 4444};

Remember this is the simple, but not highly-optimized code for the array-based move generator. The bitboard lookups are nearly instantaneous by comparison (but buggy since I need to work out a few details yet.)

So basically, casing off of a 4-digit number that represents the 1st 4 cubes on row 1 of the top, a range of indices to scan is determined. Those indices are the boundaries within the GLOBAL_TFS_03_DATABASE[] array. The program performs a linear scan of the array, generating 4-digit numbers for each row while there are matches occurring, and failing quickly when not, skipping to the next integer multiple of 24 to start again. I count one database probe as the (up to) 24 separate comparisons of 2-byte data elements. Multiply that by the difference in the start and stop values, and that is the worst case probe count for that particular top-row-4-digit-number serving as the key.

So given averages in the neighborhood of 1000-1200 scans per node, when it is effectively probing a tree 3-ply into the future which would be 28,836 times its size (recall I have 0-pruning until I work out the corner table) I think it is better than not scanning and performing just nominal depth searches.

I already have 4-, 5- and 6- turns from solution (tfs) databases for the bitboard version of the program. I don't want to keep adding onto the array-based version, since I know I'll have the bitboard version debugged "some day" and then Omnia Obtorquebantur 4x4x4 will be cruising along nicely :)

...Now even an 8-move search only takes .000006 units ...

So the question is, are you so worried about that 5% time loss...

Trust me, I am not worried, this is all just experimental and fun and I am looking for all of the input I can get from more knowledgeable sources :)

And when I make posts such as these, it is to encourage the very thing you are doing: telling me why I am incorrect!

I don't know where the "units" came from, so it is not the data I used to come up with my observations. I merely used a stopwatch with some random positions. I guess I need a much larger sample, because the "luck factor" of hitting a database position that no longer necessitates going to the next iteration comes into play.
 
Last edited:

qqwref

Member
Joined
Dec 18, 2007
Messages
7,834
Location
a <script> tag near you
WCA
2006GOTT01
YouTube
Visit Channel
case 1121: index_start = 184680; index_stop = 211824; break;
case 1131: index_start = 211848; index_stop = 218160; break;
case 1141: index_start = 218184; index_stop = 246384; break;
case 1151: index_start = 246408; index_stop = 273384; break;
case 1161: index_start = 273408; index_stop = 279720; break;
case 1211: index_start = 279744; index_stop = 306888; break;
I've been wondering, how come the first and last digits are *always* the same? Is this a bug? Obviously for any two stickers there is a single move that moves them apart. Perhaps I just don't understand what you're doing.

So basically, casing off of a 4-digit number that represents the 1st 4 cubes on row 1 of the top, a range of indices to scan is determined. Those indices are the boundaries within the GLOBAL_TFS_03_DATABASE[] array. The program performs a linear scan of the array
If you are searching straight through from index_start to index_stop, then you are literally using thousands of times as much time as you should for this task - you want something that does not depend much on the actual size of the table, like a hash or some kind of tree lookup. Even if you don't want the extra memory of a data structure like that, I am sure there is a more efficient way to leverage the data structure you're already using.

I don't know where the "units" came from, so it is not the data I used to come up with my observations. I merely used a stopwatch with some random positions.
Please read what I said again, with the following in mind. A "unit" is quite literally just an arbitrary constant defined as how long a 12-move search (plus 3-TFS table) takes. If I write a task takes .0025 units, for instance, I mean it takes .0025 times the time it takes to run the 12-move search. (I'm assuming these are full searches, i.e. you go through the entire 12-move space. And as I mentioned I'm also assuming a branching factor of 20, just for simplicity.) That's it.
 

cuBerBruce

Member
Joined
Oct 8, 2006
Messages
914
Location
Malden, MA, USA
WCA
2006NORS01
YouTube
Visit Channel
Implementing a hash table is not that difficult. You may be able to use a hash table implementation from an existing library, or you can implement one yourself. In the spoiler is a simple program using my standard hash table code.

My implementation has a little caveat. Because of the rehash function I use, the size of the table must be a prime number; else the table may appear to fill up prematurely. In my implementation, the size of the table minus two is also used as a divisor for determining the initial hash index. (In my implementation, the initial hash is not allowed to be 0. The 0-element is a dummy element.) I suggest this also be prime. I always use the larger of a twin prime pair as my hash table size. Twin primes are sufficiently dense that I do not consider this a problem. The size of the table be about 10% larger than what the table needs to store to minimize hash collisions, which slow to access time.

The code requires something I call a "signature" for the object being added to the hash table. Basically, you want to create some big number that ideally would be different for each object stored in the hash table. The signature must be identical for objects that are considered identical (represent the same state of the puzzle).

My code also includes an array that stores hash table indices so that it is easy to iterate through the hash table in the order entries were added. This array can be eliminated if you don't need that functionality.

The code has a simple main function to illustrate adding and looking up elements.
Code:
// hash.cpp : simple hash table implementation
// Author: Bruce Norskog

#include "stdafx.h"  //Visual C++ header file for generating pre-compiled headers

typedef unsigned int UINT;
typedef unsigned char UBYTE;

const UINT HASH_TABLE_SIZE = 33073;	//prime number, since add-the-hash rehash is used.
const UINT HASH_DIVISOR = HASH_TABLE_SIZE - 2;	//also should be prime for good hashing

const UINT INVALID_DIST = 99;

class CubeState {
public:
	UBYTE m_corner[8];
	UBYTE m_distance;
	CubeState ();
	void init ();
	void swap_cubies (int i, int j);
	UINT get_signature () const;
	bool compare (const CubeState& cube2) const;
};

CubeState hash_table[HASH_TABLE_SIZE];
int hash_location[HASH_TABLE_SIZE];
int hash_count = 0;

CubeState::CubeState ()
{
	init ();
}

void
CubeState::init ()
{
	int i;
	for (i = 0; i < 8; ++i) {
		m_corner[i] = 3*i;
	}
	m_distance = 0;
}

UINT
CubeState::get_signature () const
{
	int i;
	UINT x1 = 0;
	UINT x2 = 0;
	for (i = 0; i < 6; ++i) {
		x1 = 24*x1 + m_corner[i];
	}
	for (i = 6; i < 8; ++i) {
		x2 = 24*x2 + m_corner[i];
	}
	return x1 ^ x2;
}

bool
CubeState::compare (const CubeState& cube2) const
{
	int i;
	for (i = 0; i < 8; ++i) {
		if (m_corner[i] != cube2.m_corner[i]) {
			return false;
		}
	}
	return true;
}

void
CubeState::swap_cubies (int i, int j)
{
	UBYTE t = m_corner[i];
	m_corner[i] = m_corner[j];
	m_corner[j] = t;
}

//init_hash table - initialize the hash table.
void
init_hash_table ()
{
	int i;
	hash_count = 0;
	for (i = 0; i < HASH_TABLE_SIZE; ++i) {
		hash_table[i].init ();
		hash_table[i].m_distance = INVALID_DIST;
		hash_location[i] = 0;
	}
}

//hash_table_lookup - find an object in the hash table.
bool
hash_table_lookup (const CubeState& cube1, int* hash_loc)
{
	UINT sig1 = cube1.get_signature ();
	UINT hash = sig1 % HASH_DIVISOR + 1;
	UINT i = hash;
	while (hash_table[i].m_distance < INVALID_DIST) {
		if (cube1.compare (hash_table[i])) {
			*hash_loc = i;
			return true;
		}
		i += hash;
		i %= HASH_TABLE_SIZE;
		if (i == 0) {	//relies on table being a prime number in size
			*hash_loc = 0;
			return false;
		}
	}
	*hash_loc = i;
	return false;	//not found in the table, hash_loc contains index where to add it
}

//add_to_hash_table - add an element to the hash table.
//Call lookup_hash_table first to get the hash index.
void
add_to_hash_table (const CubeState& cube2, int hash_idx, int dist)
{
	if (hash_idx == 0) {
		printf ("Hash table full! (%d)\n", hash_count);
		exit (1);
	}
	//This check can be used to declare hash table "full" before its out of room.
	//Performance tends to get drastically reduced when the table is nearly full.
	if (hash_count > HASH_TABLE_SIZE - 10) {
		printf ("Hash table full.\n");
		exit (1);
	}
	hash_table[hash_idx] = cube2;
	hash_table[hash_idx].m_distance = dist;
	hash_location[hash_count++] = hash_idx;
}

//get_distance - Look up the distance or other data associated a hash table object.
int
get_distance (const CubeState& cube2)
{
	int hash_loc = 0;
	if (! hash_table_lookup (cube2, &hash_loc)) {
		return INVALID_DIST;	//unknown distance, return ridiculously large value
	}
	return hash_table[hash_loc].m_distance;
}

int
main (int argc, char** argv)
{
	CubeState cube1;
	int hash_loc = 0;
	init_hash_table ();
	if (! hash_table_lookup (cube1, &hash_loc)) {
		add_to_hash_table (cube1, hash_loc, 0);
	}
	cube1.swap_cubies (3, 5);
	if (! hash_table_lookup (cube1, &hash_loc)) {
		add_to_hash_table (cube1, hash_loc, 1);
	}
	cube1.swap_cubies (2, 6);
	if (! hash_table_lookup (cube1, &hash_loc)) {
		add_to_hash_table (cube1, hash_loc, 2);
	}
	cube1.swap_cubies (2, 6);
	if (! hash_table_lookup (cube1, &hash_loc)) {
		add_to_hash_table (cube1, hash_loc, 2);
	} else {
		printf ("Already in hash table! Distance: %d\n", get_distance (cube1));
	}
	cube1.swap_cubies (0, 1);
	int x = get_distance (cube1);
	printf ("Distance (99 means not found): %d\n", x);
	return 0;
}
 

unsolved

Member
Joined
Mar 2, 2014
Messages
566
Location
Doylestown, PA
I've been wondering, how come the first and last digits are *always* the same? Is this a bug? Obviously for any two stickers there is a single move that moves them apart. Perhaps I just don't understand what you're doing.

This is data after a cube has been turned 1, 2, or 3 times. The initial values for the top face are

1111 1111 1111 1111

The front side = 2, right side = 3, bottom = 4, back = 5, left = 6.

So if you see 1121, that means the top row of stickers on the top face are UUFU. This would be the position after the slice move r. You see so much symmetry in those numbers since there are so few turns made on the cube that are in the database.


If you are searching straight through from index_start to index_stop, then you are literally using thousands of times as much time as you should for this task...

Yes, I know. This is more of a "proof of concept" and an easy way to verify the implementation. The program I wrote that generated the data also wrote all of the C code for me, including the matrix and the case statements. What could be easier than copy/paste? :)

Implementing a hash table is not that difficult. You may be able to use a hash table implementation from an existing library, or you can implement one yourself. In the spoiler is a simple program using my standard hash table code.

Bruce posted code! Yay! :)

My implementation has a little caveat. Because of the rehash function I use, the size of the table must be a prime number;

I am familiar with both power-of-2 and prime keyed hash tables, I am just lazy :) When I write code that writes itself, I am easily amused. I'll get around to a hashing function eventually, and I do appreciate your code post. I'll take a look at it. And, speaking of primes, about a year ago, I found the 84th largest prime number in the world: 7 followed by 902,707 zeroes, then the number 1.

http://primes.utm.edu/primes/page.php?id=114510

And a question for you, sir. I am not sure if I am "allowed" to send messages on here. Nothing I ever write appears in my outbox. Nothing. Ever.

I am still working out the orientation bug, and I think I am getting closer.

Can you please tell me, in your own cubicle designations, the 8 orientations of the cubies after:

U R2 U R F2 R' U' R2 F U R'

And is this a max distance of 11 in your table?

Thanks!
 
Last edited:
Joined
Mar 18, 2014
Messages
687
Location
in d middle of angleland
WCA
2009WHIT01
YouTube
Visit Channel
This is data after a cube has been turned 1, 2, or 3 times. The initial values for the top face are

1111 1111 1111 1111

The front side = 2, right side = 3, bottom = 4, back = 5, left = 6.

So if you see 1121, that means the top row of stickers on the top face are UUFU. This would be the position after the slice move r. You see so much symmetry in those numbers since there are so few turns made on the cube that are in the database.

wait, are you representing the cube using stickers instead of pieces? that just seems as though it would take longer to implement, be more complicated, and make the code less intuitive to understand (example: "case 1141: index_start = 218184; index_stop = 246384; break;" - it's definitely not obvious what that is supposed to mean)
 

qqwref

Member
Joined
Dec 18, 2007
Messages
7,834
Location
a <script> tag near you
WCA
2006GOTT01
YouTube
Visit Channel
This is data after a cube has been turned 1, 2, or 3 times. The initial values for the top face are

1111 1111 1111 1111

The front side = 2, right side = 3, bottom = 4, back = 5, left = 6.

So if you see 1121, that means the top row of stickers on the top face are UUFU. This would be the position after the slice move r. You see so much symmetry in those numbers since there are so few turns made on the cube that are in the database.
Yes, but why do you never have a pattern like 1122 or 1364? The way I understand what you're doing, any sequence of 4 digits (in 1-6) should be possible.

By the way, while writing code with a program may be fun, I don't recommend it for a final version. The most you should do automatically is generate arrays of data. Any code where someone might go "what are all these magic numbers for" is just going to end up hard to maintain, and will probably need to be completely redone whenever you change something.
 
Status
Not open for further replies.
Top