/*

Program: Tabled Tic Tac Toe! (TTTT version 1.0)
File: tttt.c
Author: Ruben Carlo Benante (Dr. Beco)
Site: www.beco.cc
Email: rcb at beco.cc
License: CC BY-NC-SA 3.0 Licence http://creativecommons.org/licenses/by-nc-sa/3.0/br/

Description:

Suc is a successor matrix calculated beforehand by an minimax algorithm set to find best moves in a 5-level tree.
The game is unbeatable in this level. You can only draw or lose.

Configuration of pieces on the board is a 9-digit number in ternary base.
Each digit configures a square as being 0-empty, 1-x, 2-o.

For example, the last entry in suc table means:

From this table:
suc[TOTAL][0]=221-221-110

 o | o | x
-----------
 o | o | x
-----------
 x | x | .

Play and go to this table
suc[TOTAL][0]=221221111

 o | o | x
-----------
 o | o | x
-----------
 x | x | x


Also: x is always the first player to play.

*/

#include <stdio.h>
#include <stdlib.h>

#define TOTAL 4520
#define EMP 0 /* empty */
#define XIS 1 /* x */
#define BOL 2 /* o */

int suc[TOTAL][2]={ { 0, 10000}, { 1, 20001}, { 10, 20010}, { 12, 1012}, { 21, 1021},
    { 100, 20100}, { 102, 100102}, { 112, 2112}, { 120, 10120}, { 121, 20121}, { 201, 1201},
    { 210, 10210}, { 211, 200211}, { 1000, 21000}, { 1002, 1012}, { 1012, 21012}, { 1020, 1021},
    { 1021, 1221}, { 1102, 21102}, { 1120, 21120}, { 1122, 11122}, { 1200, 1201}, { 1201, 1221},
    { 1210,200001210}, { 1212, 11212}, { 1221, 11221}, { 2001, 2011}, { 2010, 2011}, { 2011, 2211},
    { 2100, 2101}, { 2101, 2121}, { 2110, 2112}, { 2112, 12112}, { 2121, 12121}, { 2211, 12211},
    { 10000, 10002}, { 10002, 10012}, { 10012, 20010012}, { 10020, 10021}, { 10021, 10221}, { 10102, 2010102},
    { 10120, 10122}, { 10122, 11122}, { 10200, 10201}, { 10201,200010201}, { 10210, 20010210}, { 10212, 11212},
    { 10221, 11221}, { 11002, 211002}, { 11020, 11022}, { 11022, 11122}, { 11122, 211122}, { 11200, 211200},
    { 11202, 11212}, { 11212, 211212}, { 11220, 11221}, { 11221, 211221}, { 12000, 12001}, { 12001, 12021},
    { 12010, 12012}, { 12012, 1012012}, { 12021, 12121}, { 12100, 12102}, { 12102, 1012102}, { 12112, 2012112},
    { 12120, 12121}, { 12121, 212121}, { 12201, 12211}, { 12210, 12211}, { 12211, 212211}, { 20001, 20011},
    { 20010, 20011}, { 20011, 20211}, { 20100, 20101}, { 20101, 20121}, { 20110, 20112}, { 20112,100020112},
    { 20121, 10020121}, { 20211, 1020211}, { 21000, 21001}, { 21001, 2021001}, { 21010, 21012}, { 21012,100021012},
    { 21021, 1021021}, { 21100, 21102}, { 21102,100021102}, { 21112,200021112}, { 21120, 10021120}, { 21121, 20021121},
    { 21201, 1021201}, { 21210, 1021210}, { 21211, 2021211}, { 22011, 22111}, { 22101, 22111}, { 22110, 22111},
    { 100000, 120000}, { 100002, 100102}, { 100012, 2100012}, { 100020, 100120}, { 100021, 120021}, { 100102, 100122},
    { 100120, 100122}, { 100122, 101122}, { 100200, 100201}, { 100201, 102201}, { 100210, 102210}, { 100212, 110212},
    { 100221, 101221}, { 101002, 121002}, { 101020, 121020}, { 101022, 101122}, { 101122, 121122}, { 101200, 121200},
    { 101202, 111202}, { 101212, 121212}, { 101220, 101221}, { 101221, 121221}, { 102000, 102001}, { 102001, 102201},
    { 102010, 102210}, { 102012, 1102012}, { 102021,100102021}, { 102100,200102100}, { 102102, 1102102}, { 102112, 2102112},
    { 102120, 112120}, { 102121,200102121}, { 102201, 102211}, { 102210, 102211}, { 102211, 122211}, { 110002, 112002},
    { 110020, 110022}, { 110022, 110122}, { 110122, 112122}, { 110200, 112200}, { 110202, 110212}, { 110212, 112212},
    { 110220, 110221}, { 110221, 112221}, { 112000, 112002}, { 112002, 1112002}, { 112012, 2112012}, { 112020, 112120},
    { 112021,200112021}, { 112102, 2112102}, { 112120, 112122}, { 112122, 1112122}, { 112200, 112201}, { 112201,200112201},
    { 112210, 20112210}, { 112212, 10112212}, { 112221,100112221}, { 120000, 120001}, { 120001, 120021}, { 120010, 120012},
    { 120012,100120012}, { 120021, 10120021}, { 120100,200120100}, { 120102,100120102}, { 120112,200120112}, { 120120,100120120},
    { 120121, 20120121}, { 120201, 1120201}, { 120210, 1120210}, { 120211, 2120211}, { 121000, 121002}, { 121002, 121012},
    { 121012, 121212}, { 121020, 121021}, { 121021, 2121021}, { 121102,200121102}, { 121120, 20121120}, { 121122,100121122},
    { 121200, 121201}, { 121201, 2121201}, { 121210, 121212}, { 121212, 1121212}, { 121221, 1121221}, { 122001, 122101},
    { 122010, 122110}, { 122011, 122211}, { 122100, 122101}, { 122101, 122121}, { 122110, 122112}, { 122112,100122112},
    { 122121,100122121}, { 122211, 1122211}, { 200001, 200101}, { 200010, 200110}, { 200011, 200211}, { 200100, 200101},
    { 200101, 200121}, { 200110, 200112}, { 200112, 210112}, { 200121, 210121}, { 200211, 201211}, { 201000, 201001},
    { 201001, 2201001}, { 201010, 201012}, { 201012, 201112}, { 201021, 211021}, { 201100, 201102}, { 201102, 201112},
    { 201112, 221112}, { 201120, 1201120}, { 201121, 2201121}, { 201201, 1201201}, { 201210,100201210}, { 201211, 2201211},
    { 202011, 202111}, { 202101, 202111}, { 202110, 202111}, { 210000, 210001}, { 210001, 210021}, { 210010, 210012},
    { 210012, 210112}, { 210021, 210121}, { 210100, 210102}, { 210102, 210112}, { 210112, 212112}, { 210120, 210121},
    { 210121, 212121}, { 210201,100210201}, { 210210, 10210210}, { 210211,200210211}, { 211000, 211002}, { 211002, 211012},
    { 211012, 20211012}, { 211020, 211021}, { 211021, 211221}, { 211102, 2211102}, { 211120, 2211120}, { 211122, 1211122},
    { 211200,100211200}, { 211201,200211201}, { 211210,200211210}, { 211212, 10211212}, { 211221, 1211221}, { 212001, 212011},
    { 212010, 212011}, { 212011, 212211}, { 212100, 212101}, { 212101, 212121}, { 212110, 212112}, { 212112, 1212112},
    { 212121, 1212121}, { 212211, 10212211}, { 220011, 220111}, { 220101, 220111}, { 220110, 220111}, { 221001, 221011},
    { 221010, 221011}, { 221011, 221211}, { 221100, 221101}, { 221101, 221121}, { 221110, 221112}, { 221112,100221112},
    { 221121, 1221121}, { 221211, 1221211}, { 1000000, 1020000}, { 1000002, 1000102}, { 1000012, 1020012}, { 1000020, 1000021},
    { 1000021, 1000221}, { 1000102, 1000122}, { 1000120, 1020120}, { 1000122, 1010122}, { 1000200, 1000201}, { 1000201, 1000221},
    { 1000210, 1020210}, { 1000212, 11000212}, { 1000221, 1001221}, { 1001002, 1001022}, { 1001020, 1001022}, { 1001022, 1001122},
    { 1001122, 1021122}, { 1001200, 1001202}, { 1001202, 1001212}, { 1001212,201001212}, { 1001220, 1001221}, { 1002000, 1012000},
    { 1002001, 1022001}, { 1002010, 1022010}, { 1002012, 1012012}, { 1002021, 1012021}, { 1002100, 1022100}, { 1002102, 1012102},
    { 1002112, 1022112}, { 1002120, 1012120}, { 1002121, 1022121}, { 1002201,101002201}, { 1002210, 11002210}, { 1002211, 1202211},
    { 1010002, 1010202}, { 1010020, 1010022}, { 1010022, 1010122}, { 1010200, 1010202}, { 1010202, 1010212}, { 1010212, 21010212},
    { 1010220, 1010221}, { 1010221, 1012221}, { 1011022, 1011222}, { 1011202, 1011222}, { 1011220, 1011222}, { 1012000, 1012002},
    { 1012002, 1012012}, { 1012012, 1012212}, { 1012020, 1012021}, { 1012021, 1012221}, { 1012200, 11012200}, { 1012201,201012201},
    { 1012210, 21012210}, { 1012212, 11012212}, { 1012221,101012221}, { 1020000, 1020001}, { 1020001, 1022001}, { 1020010, 1020012},
    { 1020012,101020012}, { 1020021, 1021021}, { 1020100, 1020120}, { 1020102,101020102}, { 1020112, 1022112}, { 1020120, 11020120},
    { 1020121, 1022121}, { 1020201, 1021201}, { 1020210, 1020211}, { 1020211, 1022211}, { 1021000, 1021002}, { 1021002,101021002},
    { 1021012,201021012}, { 1021020, 1021021}, { 1021102, 1021122}, { 1021120, 1021122}, { 1021122, 1121122}, { 1021200, 1021201},
    { 1021210, 1021212}, { 1021212,101021212}, { 1022001, 1122001}, { 1022010, 1122010}, { 1022011, 1222011}, { 1022100, 1122100},
    { 1022101, 1022121}, { 1022110, 1022112}, { 1022112, 1122112}, { 1022121, 1122121}, { 1022211, 1122211}, { 1100002, 1100202},
    { 1100020, 1120020}, { 1100022, 1100122}, { 1100122, 1102122}, { 1100200, 1100202}, { 1100202, 1100212}, { 1100212, 1120212},
    { 1100220, 1100221}, { 1100221, 1102221}, { 1101022, 1101222}, { 1101202, 1101222}, { 1101220, 1101222}, { 1102000, 1102200},
    { 1102002, 1102012}, { 1102012, 1102212}, { 1102020, 1102120}, { 1102021, 1122021}, { 1102102, 1102122}, { 1102120, 1102122},
    { 1102122, 1112122}, { 1102200, 1102201}, { 1102201, 1122201}, { 1102210, 1122210}, { 1102212, 11102212}, { 1102221,101102221},
    { 1110022, 1110222}, { 1110202, 1110222}, { 1110220, 1110222}, { 1112002, 1112202}, { 1112020, 1112220}, { 1112022, 1112122},
    { 1112200, 1112202}, { 1112202, 1112212}, { 1112212, 21112212}, { 1112220, 1112221}, { 1112221,201112221}, { 1120000, 1120020},
    { 1120002,101120002}, { 1120012,201120012}, { 1120020, 11120020}, { 1120021, 21120021}, { 1120102,201120102}, { 1120120, 21120120},
    { 1120122,101120122}, { 1120200, 1120201}, { 1120201, 1122201}, { 1120210, 1120212}, { 1120212,101120212}, { 1120221, 1121221},
    { 1121002, 1121022}, { 1121020, 1121022}, { 1121022, 1121122}, { 1121122, 21121122}, { 1121200, 1121202}, { 1121202, 1121212},
    { 1121212,201121212}, { 1121220, 1121221}, { 1122000,101122000}, { 1122001, 1122021}, { 1122010, 1122210}, { 1122012,101122012},
    { 1122021, 11122021}, { 1122100,201122100}, { 1122102,101122102}, { 1122112,201122112}, { 1122120,101122120}, { 1122121, 21122121},
    { 1122201, 1122211}, { 1122210, 1122211}, { 1122211, 21122211}, { 1200000, 1200001}, { 1200001, 1200021}, { 1200010, 1220010},
    { 1200012, 1210012}, { 1200021, 1200121}, { 1200100, 1220100}, { 1200102, 1210102}, { 1200112, 1220112}, { 1200120, 1200121},
    { 1200121, 1202121}, { 1200201, 1201201}, { 1200210,101200210}, { 1200211, 1202211}, { 1201000, 1201002}, { 1201002, 1201102},
    { 1201012,201201012}, { 1201020, 1201021}, { 1201102, 1221102}, { 1201120, 1201122}, { 1201122, 1211122}, { 1201200, 1201201},
    { 1201210,201201210}, { 1201212,101201212}, { 1202001, 1212001}, { 1202010, 1212010}, { 1202011, 1202211}, { 1202100, 1212100},
    { 1202101, 1222101}, { 1202110, 1222110}, { 1202112, 1212112}, { 1202121, 1212121}, { 1202211, 1212211}, { 1210000, 1210002},
    { 1210002, 1210012}, { 1210012, 1210212}, { 1210020, 1210021}, { 1210021, 1210221}, { 1210200,101210200}, { 1210201,201210201},
    { 1210210,201210210}, { 1210212, 11210212}, { 1210221, 1211221}, { 1211002, 1211202}, { 1211020, 1211022}, { 1211022, 1211122},
    { 1211200, 1211202}, { 1211202, 1211212}, { 1211212,201211212}, { 1211220, 1211221}, { 1212000, 1212001}, { 1212001, 1212021},
    { 1212010, 1212012}, { 1212012, 1212112}, { 1212021, 1212121}, { 1212201,101212201}, { 1212210, 11212210}, { 1212211,201212211},
    { 1220001, 1221001}, { 1220010, 1221010}, { 1220011, 1222011}, { 1220100, 1221100}, { 1220101, 1222101}, { 1220110, 1220112},
    { 1220112, 1221112}, { 1220121, 1221121}, { 1220211, 1221211}, { 1221000, 1221001}, { 1221010, 1221012}, { 1221012,101221012},
    { 1221100, 1221102}, { 1221102,101221102}, { 1221112,201221112}, { 1221120, 1221121}, { 1221210, 1221211}, { 2000001, 2000011},
    { 2000010, 2000011}, { 2000011, 2000211}, { 2000100, 2000101}, { 2000101, 2000121}, { 2000110, 2000112}, { 2000112, 2001112},
    { 2000121,102000121}, { 2000211, 2010211}, { 2001000, 2001100}, { 2001001, 22001001}, { 2001010,202001010}, { 2001012, 2011012},
    { 2001021, 2011021}, { 2001100, 2021100}, { 2001102, 2101102}, { 2001112,202001112}, { 2001120, 2101120}, { 2001121, 22001121},
    { 2001201, 2011201}, { 2001210, 2011210}, { 2001211, 2021211}, { 2002011, 2002111}, { 2002101, 2002111}, { 2002110, 2002111},
    { 2010000, 2010001}, { 2010001,202010001}, { 2010010, 22010010}, { 2010012, 2011012}, { 2010021, 2011021}, { 2010100, 2010102},
    { 2010102, 2011102}, { 2010112, 2012112}, { 2010120, 2110120}, { 2010121,202010121}, { 2010201, 2010211}, { 2010210, 2010211},
    { 2010211, 2012211}, { 2011000, 2211000}, { 2011002, 2011012}, { 2011012, 2011212}, { 2011020, 2011021}, { 2011021, 2011221},
    { 2011102, 2211102}, { 2011120, 2211120}, { 2011122, 2111122}, { 2011200, 2011201}, { 2011201, 2011221}, { 2011210, 2011212},
    { 2011212, 2111212}, { 2011221, 2111221}, { 2012001, 2012011}, { 2012010, 2012011}, { 2012011, 2012211}, { 2012100, 2012101},
    { 2012101, 2012121}, { 2012110, 2012112}, { 2012121,102012121}, { 2012211, 2112211}, { 2020011, 2020111}, { 2020101, 2020111},
    { 2020110, 2020111}, { 2021001, 2021101}, { 2021010, 2021110}, { 2021011, 2021211}, { 2021100, 2021101}, { 2021101, 2021121},
    { 2021110, 2021112}, { 2021112,102021112}, { 2021121, 12021121}, { 2100000,102100000}, { 2100001,202100001}, { 2100010, 2100012},
    { 2100012, 2100112}, { 2100021, 2110021}, { 2100100,202100100}, { 2100102, 2101102}, { 2100112, 2102112}, { 2100120, 2101120},
    { 2100121,202100121}, { 2100201, 2110201}, { 2100210, 2110210}, { 2100211, 2120211}, { 2101000, 2121000}, { 2101002, 2101102},
    { 2101012, 2121012}, { 2101020, 2101120}, { 2101021, 2121021}, { 2101102, 2101122}, { 2101120, 2101122}, { 2101122, 2111122},
    { 2101200, 2111200}, { 2101201, 2121201}, { 2101210, 2121210}, { 2101212, 2111212}, { 2101221, 2111221}, { 2102001, 2102011},
    { 2102010, 2102011}, { 2102011, 2102211}, { 2102100, 2102101}, { 2102101, 2102121}, { 2102110, 2102112}, { 2102121,102102121},
    { 2102211, 2112211}, { 2110000, 2112000}, { 2110002, 2111002}, { 2110012, 2112012}, { 2110020, 2110021}, { 2110021, 2110221},
    { 2110102, 2112102}, { 2110120, 2110122}, { 2110122, 2111122}, { 2110200, 2110201}, { 2110201, 2110221}, { 2110210, 2110212},
    { 2110212, 2111212}, { 2110221, 2111221}, { 2112000, 2112001}, { 2112001,202112001}, { 2112010, 2112012}, { 2112021,102112021},
    { 2112100, 2112102}, { 2112120,102112120}, { 2112121,202112121}, { 2112201, 2112211}, { 2112210, 2112211}, { 2112211, 22112211},
    { 2120001, 2120101}, { 2120010, 2120110}, { 2120011, 2120211}, { 2120100, 2120101}, { 2120101, 2120121}, { 2120110, 2120112},
    { 2120112,102120112}, { 2120121,102120121}, { 2121000, 2121001}, { 2121001, 2121021}, { 2121010, 2121012}, { 2121012, 2121112},
    { 2121021, 2121121}, { 2121100,202121100}, { 2121102,102121102}, { 2121112,202121112}, { 2121120,102121120}, { 2121121, 22121121},
    { 2122011, 2122111}, { 2122101, 2122111}, { 2122110, 2122111}, { 2200011, 2200111}, { 2200101, 2200111}, { 2200110, 2200111},
    { 2201001, 2201101}, { 2201010, 2201110}, { 2201011, 2201211}, { 2201100, 2201101}, { 2201101, 2201121}, { 2201110, 2201112},
    { 2201112, 2211112}, { 2201121, 2211121}, { 2201211, 2211211}, { 2210001, 2210011}, { 2210010, 2210011}, { 2210011, 2210211},
    { 2210100, 2210101}, { 2210101, 2210121}, { 2210110, 2210112}, { 2210112, 12210112}, { 2210121,102210121}, { 2210211, 12210211},
    { 2211000, 2211010}, { 2211001,202211001}, { 2211010, 22211010}, { 2211012, 12211012}, { 2211021,102211021}, { 2211100, 2211102},
    { 2211102, 2211112}, { 2211112, 22211112}, { 2211120, 2211121}, { 2211121,202211121}, { 2211201,102211201}, { 2211210, 12211210},
    { 2211211,202211211}, { 2212011, 2212111}, { 2212101, 2212111}, { 2212110, 2212111}, { 2221011, 2221111}, { 2221101, 2221111},
    { 2221110, 2221111}, { 10000000, 10020000}, { 10000002, 11000002}, { 10000012, 10020012}, { 10000020, 10000021}, { 10000021, 12000021},
    { 10000102, 12000102}, { 10000120, 12000120}, { 10000122, 10001122}, { 10000200,110000200}, { 10000201,210000201}, { 10000210, 10020210},
    { 10000212, 10010212}, { 10000221, 10001221}, { 10001002, 10001202}, { 10001020, 12001020}, { 10001022, 10001122}, { 10001122, 10021122},
    { 10001200, 10001202}, { 10001202, 10001212}, { 10001212, 10021212}, { 10001220, 10001221}, { 10001221, 10021221}, { 10002000, 10012000},
    { 10002001, 10022001}, { 10002010, 10022010}, { 10002012, 10012012}, { 10002021,110002021}, { 10002100, 10022100}, { 10002102, 11002102},
    { 10002112, 10022112}, { 10002120, 11002120}, { 10002121, 10022121}, { 10002201, 10012201}, { 10002210, 10012210}, { 10002211, 10022211},
    { 10010002, 10010022}, { 10010020, 10010022}, { 10010022, 10010122}, { 10010122, 12010122}, { 10010200, 10010220}, { 10010202, 10010212},
    { 10010220, 10010221}, { 10010221,210010221}, { 10011022, 10011222}, { 10011202, 10011222}, { 10011220, 10011222}, { 10012000, 10012002},
    { 10012002, 10012012}, { 10012020, 11012020}, { 10012021,210012021}, { 10012102, 12012102}, { 10012120, 12012120}, { 10012122, 11012122},
    { 10012200, 10012201}, { 10012201, 10012221}, { 10012221,110012221}, { 10020000, 10020001}, { 10020001, 10022001}, { 10020010, 10020012},
    { 10020012, 10020112}, { 10020021, 11020021}, { 10020100, 10022100}, { 10020102,110020102}, { 10020112, 10022112}, { 10020120,110020120},
    { 10020121, 10022121}, { 10020201, 11020201}, { 10020210, 10020211}, { 10020211, 10022211}, { 10021000, 10021002}, { 10021002,110021002},
    { 10021012, 10021212}, { 10021020, 11021020}, { 10021021, 12021021}, { 10021102,210021102}, { 10021120, 12021120}, { 10021122,110021122},
    { 10021200, 11021200}, { 10021201, 12021201}, { 10021210, 10021212}, { 10021212, 10121212}, { 10021221, 11021221}, { 10022001, 10122001},
    { 10022010, 10022011}, { 10022011, 10022211}, { 10022100, 10122100}, { 10022101, 10222101}, { 10022110, 10022112}, { 10022112, 10122112},
    { 10022121, 10122121}, { 10022211, 10122211}, { 10100002, 10100202}, { 10100020, 12100020}, { 10100022, 10100122}, { 10100122, 10102122},
    { 10100200, 10100202}, { 10100202, 10100212}, { 10100212, 10120212}, { 10100220, 10100221}, { 10100221, 10102221}, { 10101022, 10101222},
    { 10101202, 10101222}, { 10101220, 10101222}, { 10102000, 10102200}, { 10102002, 11102002}, { 10102012, 10122012}, { 10102020,110102020},
    { 10102021,210102021}, { 10102102, 12102102}, { 10102120,210102120}, { 10102122, 11102122}, { 10102200, 10102201}, { 10102201, 10122201},
    { 10102210, 10122210}, { 10102212, 10112212}, { 10102221,110102221}, { 10110022, 10110222}, { 10110202, 10110222}, { 10110220, 10110222},
    { 10112002, 10112022}, { 10112020, 10112022}, { 10112022, 10112122}, { 10112122, 12112122}, { 10112200, 10112220}, { 10112202, 10112212},
    { 10112220, 10112221}, { 10112221,210112221}, { 10120000, 10120200}, { 10120002,110120002}, { 10120012, 10120212}, { 10120020,110120020},
    { 10120021, 12120021}, { 10120102,210120102}, { 10120120,210120120}, { 10120122,110120122}, { 10120200, 11120200}, { 10120201, 12120201},
    { 10120210, 10120212}, { 10120212, 10121212}, { 10120221, 11120221}, { 10121002, 10121022}, { 10121020, 10121022}, { 10121022, 10121122},
    { 10121122,210121122}, { 10121200, 10121202}, { 10121202, 10121212}, { 10121212, 12121212}, { 10121220, 10121221}, { 10121221, 12121221},
    { 10122000,110122000}, { 10122001, 10122201}, { 10122010, 10122012}, { 10122012, 10122112}, { 10122021,110122021}, { 10122100,210122100},
    { 10122102,110122102}, { 10122112, 12122112}, { 10122120,110122120}, { 10122121,210122121}, { 10122201, 11122201}, { 10122210, 11122210},
    { 10122211, 12122211}, { 10200000, 10210000}, { 10200001, 10220001}, { 10200010, 10220010}, { 10200012, 10210012}, { 10200021, 11200021},
    { 10200100, 10220100}, { 10200102, 10210102}, { 10200112, 10220112}, { 10200120, 11200120}, { 10200121, 10220121}, { 10200201,110200201},
    { 10200210, 10210210}, { 10200211, 10220211}, { 10201000, 10201002}, { 10201002, 10201012}, { 10201012, 10221012}, { 10201020, 11201020},
    { 10201021, 12201021}, { 10201102, 10221102}, { 10201120, 12201120}, { 10201122, 11201122}, { 10201200,110201200}, { 10201201, 12201201},
    { 10201210, 10221210}, { 10201212, 10211212}, { 10201221, 11201221}, { 10202001, 10212001}, { 10202010, 10212010}, { 10202011, 10222011},
    { 10202100, 10212100}, { 10202101, 10222101}, { 10202110, 10222110}, { 10202112, 10212112}, { 10202121, 10212121}, { 10202211, 10212211},
    { 10210000, 10210002}, { 10210002, 10210012}, { 10210020, 11210020}, { 10210021,210210021}, { 10210102, 10210122}, { 10210120, 12210120},
    { 10210122, 11210122}, { 10210200, 10210210}, { 10210201,210210201}, { 10210221,110210221}, { 10211002, 10211022}, { 10211020, 10211220},
    { 10211022, 10211122}, { 10211122, 12211122}, { 10211200, 10211220}, { 10211202, 10211212}, { 10211220, 10211221}, { 10211221,210211221},
    { 10212000, 10212001}, { 10212001, 10212021}, { 10212021, 10212121}, { 10212100, 10212102}, { 10212102, 10212112}, { 10212120, 10212121},
    { 10212121, 12212121}, { 10212201, 10212211}, { 10220001, 10221001}, { 10220010, 10220011}, { 10220011, 10220211}, { 10220100, 10221100},
    { 10220101, 10222101}, { 10220110, 10220112}, { 10220112, 10221112}, { 10220121, 10221121}, { 10220211, 10221211}, { 10221000, 11221000},
    { 10221001, 12221001}, { 10221010, 10221210}, { 10221012,110221012}, { 10221021, 11221021}, { 10221100, 10221102}, { 10221102,110221102},
    { 10221112,210221112}, { 10221120, 11221120}, { 10221121, 12221121}, { 10221201, 11221201}, { 10221210, 10221211}, { 10221211, 12221211},
    { 11000002, 11000022}, { 11000020,211000020}, { 11000022, 11000122}, { 11000122, 11002122}, { 11000200,211000200}, { 11000202, 11000212},
    { 11000212, 11002212}, { 11000220, 11000221}, { 11000221, 11002221}, { 11001022, 11001222}, { 11001202, 11001222}, { 11001220, 11001222},
    { 11002000, 11002002}, { 11002002, 11002012}, { 11002012, 11002212}, { 11002020, 11002120}, { 11002021,211002021}, { 11002102, 11002122},
    { 11002120, 11002122}, { 11002122, 11012122}, { 11002200, 11002210}, { 11002201,211002201}, { 11002210, 11002212}, { 11002212, 11012212},
    { 11002221,111002221}, { 11010022, 11010222}, { 11010202, 11010222}, { 11010220, 11010222}, { 11012002, 11012022}, { 11012020, 11012022},
    { 11012022, 11012122}, { 11012200, 11012202}, { 11012202, 11012212}, { 11012220,111012220}, { 11012221,211012221}, { 11020000,211020000},
    { 11020002,111020002}, { 11020012,211020012}, { 11020020, 11020021}, { 11020021, 11020221}, { 11020102,211020102}, { 11020120,211020120},
    { 11020122,111020122}, { 11020200, 11020201}, { 11020201, 11020221}, { 11020210,211020210}, { 11020212,111020212}, { 11020221, 11021221},
    { 11021002,211021002}, { 11021020, 11021022}, { 11021022,111021022}, { 11021122,211021122}, { 11021200, 11021202}, { 11021202,111021202},
    { 11021212,211021212}, { 11021220, 11021221}, { 11022000,111022000}, { 11022001, 11222001}, { 11022010, 11222010}, { 11022012,111022012},
    { 11022021,111022021}, { 11022100, 11222100}, { 11022102,111022102}, { 11022112, 11222112}, { 11022120,111022120}, { 11022121, 11222121},
    { 11022201,111022201}, { 11022210,111022210}, { 11022211, 11222211}, { 11100022, 11100222}, { 11100202, 11100222}, { 11100220, 11100222},
    { 11102002, 11102022}, { 11102020,211102020}, { 11102022, 11102122}, { 11102122, 11122122}, { 11102200,211102200}, { 11102202, 11102212},
    { 11102212, 11122212}, { 11102220,111102220}, { 11102221,211102221}, { 11112022, 11112222}, { 11112202, 11112222}, { 11112220, 11112222},
    { 11120002,211120002}, { 11120020,211120020}, { 11120022,111120022}, { 11120122,211120122}, { 11120200,211120200}, { 11120202,111120202},
    { 11120212,211120212}, { 11120220, 11120221}, { 11120221, 11122221}, { 11121022, 11121222}, { 11121202, 11121222}, { 11121220, 11121222},
    { 11122000,211122000}, { 11122002,111122002}, { 11122012,211122012}, { 11122020,111122020}, { 11122021,211122021}, { 11122102,211122102},
    { 11122120,211122120}, { 11122122,111122122}, { 11122200,111122200}, { 11122201,211122201}, { 11122210,211122210}, { 11122212,111122212},
    { 11122221,111122221}, { 11200000,211200000}, { 11200002, 11200012}, { 11200012, 11200212}, { 11200020, 11200021}, { 11200021, 11200221},
    { 11200102, 11200122}, { 11200120, 11200122}, { 11200122, 11201122}, { 11200200,111200200}, { 11200201,211200201}, { 11200210,211200210},
    { 11200212, 11210212}, { 11200221, 11201221}, { 11201002,211201002}, { 11201020, 11201022}, { 11201022, 11201122}, { 11201122, 11221122},
    { 11201200,211201200}, { 11201202,111201202}, { 11201212,211201212}, { 11201220, 11201221}, { 11202000, 11212000}, { 11202001, 11222001},
    { 11202010, 11222010}, { 11202012, 11212012}, { 11202021, 11212021}, { 11202100, 11222100}, { 11202102, 11212102}, { 11202112, 11222112},
    { 11202120, 11212120}, { 11202121, 11222121}, { 11202201,111202201}, { 11202210, 11212210}, { 11202211, 11222211}, { 11210002, 11210022},
    { 11210020, 11210022}, { 11210022, 11210122}, { 11210200,211210200}, { 11210202, 11210212}, { 11210220,111210220}, { 11210221,211210221},
    { 11211022, 11211222}, { 11211202, 11211222}, { 11211220, 11211222}, { 11212000, 11212002}, { 11212002, 11212012}, { 11212020, 11212021},
    { 11212021, 11212221}, { 11212200, 11212210}, { 11212201,211212201}, { 11212221,111212221}, { 11220000, 11221000}, { 11220001, 11222001},
    { 11220010, 11222010}, { 11220012,111220012}, { 11220021, 11221021}, { 11220100, 11222100}, { 11220102,111220102}, { 11220112, 11222112},
    { 11220120, 11221120}, { 11220121, 11222121}, { 11220201, 11221201}, { 11220210,111220210}, { 11220211, 11222211}, { 11221000, 11221002},
    { 11221002,111221002}, { 11221012,211221012}, { 11221020, 11221021}, { 11221102,211221102}, { 11221120, 11221122}, { 11221122,111221122},
    { 11221200, 11221201}, { 11221210,211221210}, { 11221212,111221212}, { 12000000, 12000001}, { 12000001, 12000021}, { 12000010, 12020010},
    { 12000012, 12010012}, { 12000021, 12000121}, { 12000100, 12000102}, { 12000102, 12001102}, { 12000112, 12002112}, { 12000120, 12000121},
    { 12000121, 12020121}, { 12000201, 12010201}, { 12000210, 12010210}, { 12000211, 12020211}, { 12001000, 12001020}, { 12001002, 12011002},
    { 12001012, 12021012}, { 12001020, 12001021}, { 12001021, 12021021}, { 12001102, 12021102}, { 12001120, 12021120}, { 12001122, 12101122},
    { 12001200, 12011200}, { 12001201, 12021201}, { 12001210, 12021210}, { 12001212, 12011212}, { 12001221, 12011221}, { 12002001, 12002011},
    { 12002010, 12002011}, { 12002011, 12002211}, { 12002100, 12002101}, { 12002101, 12002121}, { 12002110, 12002112}, { 12002121,112002121},
    { 12002211, 12012211}, { 12010000, 12010020}, { 12010002, 12010012}, { 12010020, 12010021}, { 12010021,212010021}, { 12010102, 12012102},
    { 12010120, 12010122}, { 12010122, 12011122}, { 12010200, 12010201}, { 12010201, 12010221}, { 12010221, 12011221}, { 12011002, 12011022},
    { 12011020, 12211020}, { 12011022, 12111022}, { 12011122, 12211122}, { 12011200, 12011202}, { 12011202, 12011212}, { 12011220, 12011221},
    { 12011221, 12211221}, { 12012000, 12012001}, { 12012001, 12012021}, { 12012021,112012021}, { 12012100, 12012102}, { 12012120, 12012121},
    { 12012121,212012121}, { 12012201, 12012211}, { 12020001, 12020101}, { 12020010, 12020011}, { 12020011, 12020211}, { 12020100, 12020101},
    { 12020101, 12020121}, { 12020110, 12020112}, { 12020112, 12021112}, { 12020121, 12021121}, { 12021000, 12021100}, { 12021001, 12021201},
    { 12021010, 12021012}, { 12021012, 12021112}, { 12021021, 12021121}, { 12021100, 12021102}, { 12021102,112021102}, { 12021112,212021112},
    { 12021120, 12021121}, { 12021121, 12221121}, { 12022011, 12022111}, { 12022101, 12022111}, { 12022110, 12022111}, { 12100000, 12100002},
    { 12100002, 12100012}, { 12100012, 12102012}, { 12100020, 12100021}, { 12100021, 12120021}, { 12100102, 12102102}, { 12100120,212100120},
    { 12100122, 12101122}, { 12100200, 12110200}, { 12100201, 12120201}, { 12100210, 12120210}, { 12100212, 12110212}, { 12100221, 12110221},
    { 12101002, 12121002}, { 12101020, 12121020}, { 12101022, 12101122}, { 12101122, 12121122}, { 12101200, 12121200}, { 12101202, 12111202},
    { 12101212, 12121212}, { 12101220, 12111220}, { 12101221, 12121221}, { 12102000, 12102001}, { 12102001, 12102021}, { 12102010, 12102012},
    { 12102021,112102021}, { 12102100, 12102102}, { 12102120,112102120}, { 12102121,212102121}, { 12102201, 12112201}, { 12102210, 12112210},
    { 12102211, 12122211}, { 12110002, 12112002}, { 12110020, 12112020}, { 12110022, 12111022}, { 12110122, 12112122}, { 12110200, 12110202},
    { 12110202, 12110212}, { 12110220, 12110221}, { 12110221, 12112221}, { 12112000, 12112002}, { 12112020, 12112021}, { 12112021,212112021},
    { 12112120, 12112122}, { 12112200, 12112201}, { 12112201, 12112221}, { 12112221,112112221}, { 12120000, 12120100}, { 12120001, 12120201},
    { 12120010, 12120012}, { 12120012, 12120112}, { 12120021, 12120121}, { 12120100,212120100}, { 12120102,112120102}, { 12120112, 12122112},
    { 12120120,112120120}, { 12120121,212120121}, { 12121000, 12121002}, { 12121002, 12121012}, { 12121012, 12121212}, { 12121020, 12121120},
    { 12121021, 12121221}, { 12121102,212121102}, { 12121120,212121120}, { 12121122,112121122}, { 12122001, 12122101}, { 12122010, 12122011},
    { 12122011, 12122211}, { 12122100, 12122101}, { 12122101, 12122121}, { 12122110, 12122112}, { 12122121,112122121}, { 12200001, 12200011},
    { 12200010, 12200011}, { 12200011, 12200211}, { 12200100, 12200110}, { 12200101, 12200121}, { 12200110, 12200112}, { 12200112, 12210112},
    { 12200121, 12201121}, { 12200211, 12210211}, { 12201000, 12201010}, { 12201001, 12201201}, { 12201010, 12221010}, { 12201012, 12211012},
    { 12201021, 12201121}, { 12201100, 12201102}, { 12201102, 12201112}, { 12201112, 12221112}, { 12201120, 12201121}, { 12201121, 12221121},
    { 12201201, 12201211}, { 12201210, 12211210}, { 12201211, 12221211}, { 12202011, 12202111}, { 12202101, 12202111}, { 12202110, 12202111},
    { 12210000, 12210001}, { 12210001, 12210021}, { 12210021,112210021}, { 12210100, 12210120}, { 12210102, 12210112}, { 12210120, 12210121},
    { 12210121,212210121}, { 12210201, 12210211}, { 12211000, 12211020}, { 12211002, 12211012}, { 12211020, 12211021}, { 12211021,212211021},
    { 12211102, 12211122}, { 12211120, 12211122}, { 12211122,112211122}, { 12211200, 12211210}, { 12211201,212211201}, { 12211221,112211221},
    { 12212001, 12212011}, { 12212100, 12212101}, { 12212101, 12212121}, { 12212121,112212121}, { 12220011, 12220111}, { 12220101, 12220111},
    { 12220110, 12220111}, { 12221001, 12221101}, { 12221010, 12221110}, { 12221011, 12221211}, { 12221100, 12221101}, { 12221101, 12221121},
    { 12221110, 12221112}, { 12221112,112221112}, { 12221121,112221121}, { 20000001, 20000101}, { 20000010, 20000011}, { 20000011, 20000211},
    { 20000100, 20000101}, { 20000101, 20000121}, { 20000110, 20000112}, { 20000112, 21000112}, { 20000121, 20010121}, { 20000211, 21000211},
    { 20001000, 20011000}, { 20001001, 22001001}, { 20001010, 20001012}, { 20001012, 20011012}, { 20001021, 20011021}, { 20001100, 20021100},
    { 20001102, 20011102}, { 20001112,220001112}, { 20001120, 20011120}, { 20001121, 20021121}, { 20001201, 20011201}, { 20001210, 20011210},
    { 20001211, 22001211}, { 20002011, 20002111}, { 20002101, 20002111}, { 20002110, 20002111}, { 20010000, 20010001}, { 20010001, 20010021},
    { 20010010, 20010012}, { 20010012, 20011012}, { 20010021, 20010121}, { 20010100, 20010102}, { 20010102, 20011102}, { 20010112, 22010112},
    { 20010120, 20010121}, { 20010121, 20012121}, { 20010201, 20011201}, { 20010210, 20011210}, { 20010211,220010211}, { 20011000, 20011002},
    { 20011002, 20011102}, { 20011012, 20211012}, { 20011020, 20011021}, { 20011021, 20011221}, { 20011102, 20011122}, { 20011120, 20011122},
    { 20011122, 20111122}, { 20011200, 20011201}, { 20011201, 20011221}, { 20011210, 20211210}, { 20011212, 20111212}, { 20011221, 20111221},
    { 20012001, 20012011}, { 20012010, 20012011}, { 20012011, 20012211}, { 20012100, 20012101}, { 20012101, 20012121}, { 20012110, 20012112},
    { 20012112, 21012112}, { 20012121, 20112121}, { 20012211,120012211}, { 20020011, 20020111}, { 20020101, 20020111}, { 20020110, 20020111},
    { 20021001, 20021011}, { 20021010, 20021011}, { 20021011, 20021211}, { 20021100, 20021110}, { 20021101, 20021121}, { 20021110, 20021112},
    { 20021112,120021112}, { 20021211, 21021211}, { 20100000, 20110000}, { 20100001, 20120001}, { 20100010, 20100012}, { 20100012, 20101012},
    { 20100021, 20110021}, { 20100100,220100100}, { 20100102, 20101102}, { 20100112,220100112}, { 20100120, 20110120}, { 20100121, 20120121},
    { 20100201, 20101201}, { 20100210, 20101210}, { 20100211, 22100211}, { 20101000, 20121000}, { 20101002, 20101102}, { 20101012, 20121012},
    { 20101020, 20111020}, { 20101021, 20121021}, { 20101102, 20101122}, { 20101120, 20121120}, { 20101122, 20111122}, { 20101200, 20101201},
    { 20101201, 20101221}, { 20101210, 20121210}, { 20101212, 20111212}, { 20101221, 20111221}, { 20102001, 20102101}, { 20102010, 20102110},
    { 20102011, 20102211}, { 20102100, 20102101}, { 20102101, 20102121}, { 20102110, 20102112}, { 20102112, 21102112}, { 20102121, 20112121},
    { 20102211, 20112211}, { 20110000, 20110002}, { 20110002, 20110102}, { 20110012, 20112012}, { 20110020, 20110021}, { 20110021, 20110221},
    { 20110102, 20110122}, { 20110120, 20110122}, { 20110122, 20111122}, { 20110200, 20110201}, { 20110201, 20110221}, { 20110210, 20112210},
    { 20110212, 20111212}, { 20110221, 20111221}, { 20112000, 20112100}, { 20112001,220112001}, { 20112010, 22112010}, { 20112012, 21112012},
    { 20112021, 20112121}, { 20112100, 20112102}, { 20112102, 21112102}, { 20112112, 22112112}, { 20112120, 20112121}, { 20112121, 22112121},
    { 20112201,120112201}, { 20112210, 20112211}, { 20112211,220112211}, { 20120001, 20120011}, { 20120010, 20120110}, { 20120011, 20120211},
    { 20120100, 20120110}, { 20120101, 20120121}, { 20120110, 20120112}, { 20120112,120120112}, { 20120211, 21120211}, { 20121000, 20121001},
    { 20121001, 20121021}, { 20121010, 22121010}, { 20121012,120121012}, { 20121100, 20121120}, { 20121102,120121102}, { 20121112,220121112},
    { 20121201, 21121201}, { 20121210, 21121210}, { 20121211, 22121211}, { 20122011, 20122111}, { 20122101, 20122111}, { 20122110, 20122111},
    { 20200011, 20200111}, { 20200101, 20200111}, { 20200110, 20200111}, { 20201001, 20201011}, { 20201010, 20201011}, { 20201011, 20201211},
    { 20201100, 20201101}, { 20201101, 20201121}, { 20201110, 20201112}, { 20201112, 20211112}, { 20201121, 20211121}, { 20201211, 21201211},
    { 20210001, 20210011}, { 20210010, 20210011}, { 20210011, 20210211}, { 20210100, 20210101}, { 20210101, 20210121}, { 20210110, 20210112},
    { 20210112, 21210112}, { 20210121, 20211121}, { 20210211,120210211}, { 20211000, 20211001}, { 20211001, 20211021}, { 20211010,220211010},
    { 20211012, 20211112}, { 20211021, 20211121}, { 20211100, 22211100}, { 20211102, 21211102}, { 20211112, 22211112}, { 20211120, 20211121},
    { 20211121, 22211121}, { 20211201, 21211201}, { 20211210,120211210}, { 20211211,220211211}, { 20212011, 20212111}, { 20212101, 20212111},
    { 20212110, 20212111}, { 20221011, 20221111}, { 20221101, 20221111}, { 20221110, 20221111}, { 21000000, 21000001}, { 21000001, 21000021},
    { 21000010, 21000012}, { 21000012, 21000112}, { 21000021, 21001021}, { 21000100, 21020100}, { 21000102, 21010102}, { 21000112, 21020112},
    { 21000120, 21010120}, { 21000121, 21020121}, { 21000201, 21001201}, { 21000210, 21000211}, { 21000211, 21002211}, { 21001000, 21001002},
    { 21001002, 21011002}, { 21001012, 21001212}, { 21001020, 21001021}, { 21001102, 21021102}, { 21001120, 21021120}, { 21001122, 21011122},
    { 21001200, 21001201}, { 21001210, 21001212}, { 21001212, 21011212}, { 21002001, 21002101}, { 21002010, 21002110}, { 21002011, 21002211},
    { 21002100, 21002101}, { 21002101, 21002121}, { 21002110, 21002112}, { 21002112, 21012112}, { 21002121, 21012121}, { 21002211, 21012211},
    { 21010000, 21010002}, { 21010002, 21010102}, { 21010012, 21010212}, { 21010020, 21010021}, { 21010021, 21010221}, { 21010200, 21010201},
    { 21010201, 21010221}, { 21010210, 21010212}, { 21010212, 21011212}, { 21010221, 21011221}, { 21011002, 21011022}, { 21011020, 21011022},
    { 21011022, 21011122}, { 21011200, 21011202}, { 21011202, 21111202}, { 21011212, 21211212}, { 21011220, 21011221}, { 21012000, 21012001},
    { 21012001, 21012021}, { 21012010, 21012210}, { 21012012, 21012112}, { 21012021, 21012121}, { 21012201,121012201}, { 21012210, 21012211},
    { 21012211,221012211}, { 21020001, 21020011}, { 21020010, 21020011}, { 21020011, 21020211}, { 21020100, 21020110}, { 21020101, 21020121},
    { 21020110, 21020112}, { 21020112,121020112}, { 21020211, 21021211}, { 21021000, 21021001}, { 21021010, 21021012}, { 21021012,121021012},
    { 21021100, 21021102}, { 21021102, 21021112}, { 21021112,221021112}, { 21021210, 21021211}, { 21022011, 21022111}, { 21022101, 21022111},
    { 21022110, 21022111}, { 21100000, 21120000}, { 21100002, 21100102}, { 21100012, 21100212}, { 21100020, 21110020}, { 21100021, 21120021},
    { 21100102, 21100122}, { 21100120, 21120120}, { 21100122, 21110122}, { 21100200, 21101200}, { 21100201, 21102201}, { 21100210, 21100212},
    { 21100212, 21101212}, { 21100221, 21101221}, { 21101002, 21121002}, { 21101020, 21121020}, { 21101022, 21111022}, { 21101122, 21121122},
    { 21101200, 21101202}, { 21101202, 21111202}, { 21101212, 21121212}, { 21101220, 21101221}, { 21102000, 21102100}, { 21102001, 21102201},
    { 21102010, 21102210}, { 21102012, 21102112}, { 21102021, 21112021}, { 21102100, 21102102}, { 21102102, 21102112}, { 21102112, 21122112},
    { 21102120, 21112120}, { 21102121, 21122121}, { 21102201, 21102211}, { 21102210, 21102211}, { 21102211, 21122211}, { 21110002, 21110022},
    { 21110020, 21110022}, { 21110022, 21110122}, { 21110200, 21112200}, { 21110202, 21111202}, { 21110212, 21112212}, { 21110220, 21110221},
    { 21110221, 21112221}, { 21112000, 21112200}, { 21112002, 21112102}, { 21112012, 21112212}, { 21112020, 21112021}, { 21112021, 21112221},
    { 21112200, 21112201}, { 21112201,221112201}, { 21112210, 21112212}, { 21112212,121112212}, { 21112221,121112221}, { 21120000, 21120010},
    { 21120001, 21120021}, { 21120010, 21120012}, { 21120012,121120012}, { 21120100, 21120120}, { 21120102,121120102}, { 21120112,221120112},
    { 21120201, 21121201}, { 21120210, 21120211}, { 21120211, 21122211}, { 21121000, 21121002}, { 21121002, 21121012}, { 21121012,221121012},
    { 21121102, 21121122}, { 21121200, 21121201}, { 21121210, 21121212}, { 21121212,121121212}, { 21122001, 21122011}, { 21122010, 21122110},
    { 21122011, 21122211}, { 21122100, 21122110}, { 21122101, 21122121}, { 21122110, 21122112}, { 21122112,121122112}, { 21122211,121122211},
    { 21200001, 21200011}, { 21200010, 21200011}, { 21200011, 21200211}, { 21200100, 21200101}, { 21200101, 21200121}, { 21200110, 21200112},
    { 21200112, 21210112}, { 21200121, 21201121}, { 21200211, 21201211}, { 21201000, 21201001}, { 21201010, 21201012}, { 21201012, 21201112},
    { 21201100, 21201102}, { 21201102, 21211102}, { 21201112, 21221112}, { 21201120, 21201121}, { 21201210, 21201211}, { 21202011, 21202111},
    { 21202101, 21202111}, { 21202110, 21202111}, { 21210000, 21210001}, { 21210001, 21210021}, { 21210010, 21210210}, { 21210012, 21210112},
    { 21210021, 21210121}, { 21210201, 21211201}, { 21210210,121210210}, { 21210211,221210211}, { 21211000, 21211002}, { 21211002, 21211102},
    { 21211012, 21211212}, { 21211020, 21211021}, { 21211200, 21211201}, { 21211210,221211210}, { 21211212,121211212}, { 21212001, 21212011},
    { 21212010, 21212011}, { 21212011, 21212211}, { 21212211,121212211}, { 21220011, 21220111}, { 21220101, 21220111}, { 21220110, 21220111},
    { 21221010, 21221011}, { 21221100, 21221101}, { 21221110, 21221112}, { 21221112,121221112}, { 22000011, 22000111}, { 22000101, 22000111},
    { 22000110, 22000111}, { 22001001, 22001011}, { 22001010,122001010}, { 22001011, 22001211}, { 22001100,122001100}, { 22001101, 22001121},
    { 22001110,222001110}, { 22001112,122001112}, { 22001121, 22011121}, { 22001211, 22011211}, { 22010001,122010001}, { 22010010,122010010},
    { 22010011,222010011}, { 22010100,122010100}, { 22010101,222010101}, { 22010110, 22010112}, { 22010112, 22011112}, { 22010121,122010121},
    { 22010211,122010211}, { 22011000, 22111000}, { 22011001,222011001}, { 22011010,222011010}, { 22011012, 22111012}, { 22011021, 22111021},
    { 22011100,222011100}, { 22011102, 22111102}, { 22011112,222011112}, { 22011120, 22111120}, { 22011121,222011121}, { 22011201, 22111201},
    { 22011210, 22111210}, { 22011211,222011211}, { 22012011, 22012111}, { 22012101, 22012111}, { 22012110, 22012111}, { 22021011, 22021111},
    { 22021101, 22021111}, { 22021110, 22021111}, { 22100001,122100001}, { 22100010,122100010}, { 22100011, 22100211}, { 22100100,122100100},
    { 22100101,222100101}, { 22100110,222100110}, { 22100112,122100112}, { 22100121,122100121}, { 22100211, 22101211}, { 22101000, 22111000},
    { 22101001, 22121001}, { 22101010, 22121010}, { 22101012, 22111012}, { 22101021, 22111021}, { 22101100,222101100}, { 22101102, 22111102},
    { 22101112,222101112}, { 22101120, 22111120}, { 22101121, 22121121}, { 22101201, 22111201}, { 22101210, 22111210}, { 22101211, 22121211},
    { 22102011, 22102111}, { 22102101, 22102111}, { 22102110, 22102111}, { 22110000, 22111000}, { 22110001,222110001}, { 22110010, 22112010},
    { 22110012, 22111012}, { 22110021, 22111021}, { 22110100,222110100}, { 22110102, 22111102}, { 22110112, 22112112}, { 22110120, 22111120},
    { 22110121,222110121}, { 22110201, 22111201}, { 22110210, 22111210}, { 22110211,222110211}, { 22112001,122112001}, { 22112010, 22112011},
    { 22112011,222112011}, { 22112100,122112100}, { 22112101,222112101}, { 22112110, 22112112}, { 22112121,122112121}, { 22112211,122112211},
    { 22120011, 22120111}, { 22120101, 22120111}, { 22120110, 22120111}, { 22121001, 22121011}, { 22121010, 22121011}, { 22121011, 22121211},
    { 22121100,122121100}, { 22121101, 22121121}, { 22121110,222121110}, { 22121112,122121112}, { 22201011, 22201111}, { 22201101, 22201111},
    { 22201110, 22201111}, { 22210011, 22210111}, { 22210101, 22210111}, { 22210110, 22210111}, { 22211001,122211001}, { 22211010,122211010},
    { 22211011,222211011}, { 22211100,122211100}, { 22211101,222211101}, { 22211110,222211110}, { 22211112,122211112}, { 22211121,122211121},
    { 22211211,122211211}, {100000000,100020000}, {100000002,100000102}, {100000012,100020012}, {100000020,100000120}, {100000021,100020021},
    {100000102,100000122}, {100000120,100000122}, {100000122,100001122}, {100000200,100000201}, {100000201,100000221}, {100000210,100020210},
    {100000212,110000212}, {100000221,100001221}, {100001002,100001202}, {100001020,100021020}, {100001022,100001122}, {100001122,100021122},
    {100001200,100001202}, {100001202,100001212}, {100001212,100021212}, {100001220,100001221}, {100001221,100021221}, {100002000,100002100},
    {100002001,100022001}, {100002010,100022010}, {100002012,101002012}, {100002021,100002121}, {100002100,100002102}, {100002102,100102102},
    {100002112,100202112}, {100002120,100002121}, {100002121,100022121}, {100002201,100012201}, {100002210,100012210}, {100002211,100022211},
    {100010002,100010202}, {100010020,100010022}, {100010022,100010122}, {100010122,100012122}, {100010200,100010202}, {100010202,100010212},
    {100010212,120010212}, {100010220,100010221}, {100011022,100011222}, {100011202,100011222}, {100011220,100011222}, {100012000,100012002},
    {100012002,101012002}, {100012012,102012012}, {100012020,100012021}, {100012102,102012102}, {100012120,100012122}, {100012122,100112122},
    {100012200,100012201}, {100012210,100012212}, {100012212,110012212}, {100020000,100020010}, {100020001,100020021}, {100020010,100020012},
    {100020012,100020112}, {100020021,110020021}, {100020100,100220100}, {100020102,100120102}, {100020112,100220112}, {100020120,100120120},
    {100020121,100220121}, {100020201,101020201}, {100020210,101020210}, {100020211,100022211}, {100021000,100021002}, {100021002,100021012},
    {100021012,100021212}, {100021020,110021020}, {100021021,102021021}, {100021102,100221102}, {100021120,120021120}, {100021122,100121122},
    {100021200,101021200}, {100021201,102021201}, {100021210,102021210}, {100021212,101021212}, {100021221,101021221}, {100022001,100122001},
    {100022010,100122010}, {100022011,100022211}, {100022100,100122100}, {100022101,100222101}, {100022110,100222110}, {100022112,100122112},
    {100022121,100122121}, {100022211,100122211}, {100100002,100100202}, {100100020,100100220}, {100100022,100100122}, {100100200,100100202},
    {100100202,100100212}, {100100212,102100212}, {100100220,100100221}, {100100221,100120221}, {100101022,100101222}, {100101202,100101222},
    {100101220,100101222}, {100102000,100102200}, {100102002,100102102}, {100102012,102102012}, {100102020,100102021}, {100102021,100102221},
    {100102200,100102201}, {100102201,100122201}, {100102210,102102210}, {100102212,101102212}, {100102221,100112221}, {100110022,100110222},
    {100110202,100110222}, {100110220,100110222}, {100112002,100112202}, {100112020,100112022}, {100112022,100112122}, {100112200,100112202},
    {100112202,100112212}, {100112212,102112212}, {100112220,100112221}, {100120000,100120200}, {100120002,100120102}, {100120012,100120212},
    {100120020,100120120}, {100120021,100120221}, {100120200,101120200}, {100120201,100120221}, {100120210,102120210}, {100120212,101120212},
    {100120221,100121221}, {100121002,100121202}, {100121020,100121220}, {100121022,100121122}, {100121200,100121202}, {100121202,100121212},
    {100121212,102121212}, {100121220,100121221}, {100121221,102121221}, {100122000,100122100}, {100122001,100122201}, {100122010,100122210},
    {100122012,100122112}, {100122021,100122121}, {100122201,101122201}, {100122210,101122210}, {100122211,102122211}, {100200000,100210000},
    {100200001,100220001}, {100200010,100220010}, {100200012,110200012}, {100200021,100201021}, {100200100,100220100}, {100200102,101200102},
    {100200112,100202112}, {100200120,100210120}, {100200121,100220121}, {100200201,100201201}, {100200210,100201210}, {100200211,100220211},
    {100201000,100201002}, {100201002,100201012}, {100201012,100221012}, {100201020,100201021}, {100201021,100201221}, {100201102,100221102},
    {100201120,100221120}, {100201122,101201122}, {100201200,100201201}, {100201201,100201221}, {100201210,100201212}, {100201212,110201212},
    {100201221,100211221}, {100202001,100212001}, {100202010,100212010}, {100202011,100222011}, {100202100,100212100}, {100202101,100222101},
    {100202110,100202112}, {100202112,100212112}, {100202121,100212121}, {100202211,100212211}, {100210000,100210002}, {100210002,101210002},
    {100210012,120210012}, {100210020,100210021}, {100210102,102210102}, {100210120,100210122}, {100210122,101210122}, {100210200,100210201},
    {100210210,100210212}, {100210212,110210212}, {100211002,100211022}, {100211020,100211022}, {100211022,100211122}, {100211122,102211122},
    {100211200,100211202}, {100211202,100211212}, {100211212,120211212}, {100211220,100211221}, {100212000,100212001}, {100212010,100212012},
    {100212012,101212012}, {100212100,100212102}, {100212102,101212102}, {100212112,102212112}, {100212120,100212121}, {100212210,100212211},
    {100220001,100221001}, {100220010,100221010}, {100220011,100220211}, {100220100,100221100}, {100220101,100220121}, {100220110,100222110},
    {100220112,100221112}, {100220121,100221121}, {100220211,100221211}, {100221000,101221000}, {100221001,102221001}, {100221010,100221012},
    {100221012,100221112}, {100221021,101221021}, {100221100,100221102}, {100221102,100221112}, {100221112,102221112}, {100221120,110221120},
    {100221121,120221121}, {100221201,101221201}, {100221210,101221210}, {100221211,102221211}, {101000002,101000022}, {101000020,101000022},
    {101000022,101000122}, {101000122,101002122}, {101000200,101000202}, {101000202,111000202}, {101000212,121000212}, {101000220,101000221},
    {101000221,101002221}, {101001022,101001222}, {101001202,101001222}, {101001220,101001222}, {101002000,101002002}, {101002002,101002012},
    {101002012,101002212}, {101002020,101002021}, {101002021,101002221}, {101002102,101002122}, {101002120,101002122}, {101002122,101012122},
    {101002200,101002201}, {101002201,101002221}, {101002210,121002210}, {101002212,111002212}, {101002221,101012221}, {101010022,101010222},
    {101010202,101010222}, {101010220,101010222}, {101012002,101012022}, {101012020,101012022}, {101012022,101012122}, {101012200,101012202},
    {101012202,111012202}, {101012212,121012212}, {101012220,101012221}, {101020000,121020000}, {101020002,101020102}, {101020012,121020012},
    {101020020,111020020}, {101020021,121020021}, {101020102,101020122}, {101020120,121020120}, {101020122,101120122}, {101020200,101020201},
    {101020201,101020221}, {101020210,121020210}, {101020212,111020212}, {101020221,101021221}, {101021002,121021002}, {101021020,121021020},
    {101021022,111021022}, {101021122,121021122}, {101021200,101021202}, {101021202,111021202}, {101021212,121021212}, {101021220,101021221},
    {101022000,101122000}, {101022001,101222001}, {101022010,101222010}, {101022012,101122012}, {101022021,111022021}, {101022100,101222100},
    {101022102,101122102}, {101022112,101222112}, {101022120,101122120}, {101022121,101222121}, {101022201,111022201}, {101022210,111022210},
    {101022211,101222211}, {101100022,101100222}, {101100202,101100222}, {101100220,101100222}, {101102002,101102022}, {101102020,101102022},
    {101102022,101102122}, {101102200,121102200}, {101102202,111102202}, {101102212,121102212}, {101102220,101102221}, {101102221,101122221},
    {101112022,101112222}, {101112202,101112222}, {101112220,101112222}, {101120002,101120022}, {101120020,121120020}, {101120022,101120122},
    {101120200,121120200}, {101120202,111120202}, {101120212,121120212}, {101120220,111120220}, {101120221,121120221}, {101121022,101121222},
    {101121202,101121222}, {101121220,101121222}, {101122000,101122002}, {101122002,101122012}, {101122012,101122212}, {101122020,101122120},
    {101122021,121122021}, {101122200,111122200}, {101122201,121122201}, {101122210,121122210}, {101122212,111122212}, {101122221,111122221},
    {101200000,101200002}, {101200002,101200102}, {101200012,121200012}, {101200020,101200021}, {101200021,101200221}, {101200102,101200122},
    {101200120,101200122}, {101200122,101201122}, {101200200,101200201}, {101200201,101200221}, {101200210,101200212}, {101200212,111200212},
    {101200221,101201221}, {101201002,121201002}, {101201020,101201022}, {101201022,101201122}, {101201122,101221122}, {101201200,101201202},
    {101201202,111201202}, {101201212,121201212}, {101201220,101201221}, {101202000,101212000}, {101202001,101222001}, {101202010,101222010},
    {101202012,101212012}, {101202021,101212021}, {101202100,101222100}, {101202102,101212102}, {101202112,101222112}, {101202120,101212120},
    {101202121,101222121}, {101202201,101212201}, {101202210,101212210}, {101202211,101222211}, {101210002,101210022}, {101210020,101210022},
    {101210022,101210122}, {101210200,101210202}, {101210202,111210202}, {101210212,121210212}, {101210220,101210221}, {101211022,101211222},
    {101211202,101211222}, {101211220,101211222}, {101212000,101212002}, {101212002,101212012}, {101212012,101212212}, {101212020,101212021},
    {101212200,101212201}, {101212210,101212212}, {101212212,111212212}, {101220000,101221000}, {101220001,101222001}, {101220010,101222010},
    {101220012,111220012}, {101220021,101221021}, {101220100,101222100}, {101220102,111220102}, {101220112,101222112}, {101220120,111220120},
    {101220121,101222121}, {101220201,101221201}, {101220210,101221210}, {101220211,101222211}, {101221000,101221002}, {101221002,111221002},
    {101221012,121221012}, {101221020,101221021}, {101221102,121221102}, {101221120,121221120}, {101221122,111221122}, {101221200,101221201},
    {101221210,101221212}, {101221212,111221212}, {102000000,102000001}, {102000001,102000021}, {102000010,102000012}, {102000012,102001012},
    {102000021,102000121}, {102000100,102000102}, {102000102,102100102}, {102000112,102002112}, {102000120,102000121}, {102000121,102002121},
    {102000201,102010201}, {102000210,102010210}, {102000211,102020211}, {102001000,102021000}, {102001002,102101002}, {102001012,102021012},
    {102001020,102011020}, {102001021,102021021}, {102001102,102201102}, {102001120,102201120}, {102001122,102101122}, {102001200,102011200},
    {102001201,102021201}, {102001210,102021210}, {102001212,102011212}, {102001221,102011221}, {102002001,102002011}, {102002010,102002011},
    {102002011,102002211}, {102002100,102002101}, {102002101,102002121}, {102002110,102002112}, {102002121,102012121}, {102002211,102012211},
    {102010000,102010002}, {102010002,102011002}, {102010012,102012012}, {102010020,102010021}, {102010102,102012102}, {102010120,102010122},
    {102010122,102110122}, {102010200,102010201}, {102010210,102010212}, {102010212,102011212}, {102011002,102211002}, {102011020,102011022},
    {102011022,102111022}, {102011122,102211122}, {102011200,102011202}, {102011202,102011212}, {102011212,102211212}, {102011220,102011221},
    {102012000,102012001}, {102012010,102012012}, {102012100,102012102}, {102012120,102012121}, {102012210,102012211}, {102020001,102020101},
    {102020010,102020110}, {102020011,102020211}, {102020100,102020101}, {102020101,102020121}, {102020110,102020112}, {102020112,102120112},
    {102020121,102120121}, {102021000,102021100}, {102021001,102021021}, {102021010,102021210}, {102021012,102021112}, {102021021,102021121},
    {102021100,102221100}, {102021102,102121102}, {102021112,102221112}, {102021120,102121120}, {102021121,122021121}, {102022011,102022111},
    {102022101,102022111}, {102022110,102022111}, {102100000,102100002}, {102100002,102100102}, {102100012,102100212}, {102100020,102100021},
    {102100021,102100221}, {102100200,102110200}, {102100201,102120201}, {102100210,102100212}, {102100212,102101212}, {102100221,102110221},
    {102101002,102101022}, {102101020,102101022}, {102101022,102101122}, {102101200,102121200}, {102101202,102111202}, {102101212,102121212},
    {102101220,102111220}, {102101221,102121221}, {102102000,102102001}, {102102001,102102021}, {102102010,102102012}, {102102021,102102121},
    {102102201,102112201}, {102102210,102102211}, {102102211,102122211}, {102110002,102112002}, {102110020,102110022}, {102110022,102110122},
    {102110200,102110202}, {102110202,102111202}, {102110212,102112212}, {102110220,102110221}, {102112000,102112002}, {102112020,102112021},
    {102112200,102112201}, {102112210,102112212}, {102120000,102120100}, {102120001,102120201}, {102120010,102120210}, {102120012,102120112},
    {102120021,102120121}, {102121000,102121200}, {102121002,102121102}, {102121012,102121212}, {102121020,102121120}, {102121021,102121221},
    {102122001,102122101}, {102122010,102122110}, {102122011,102122211}, {102200001,102200011}, {102200010,102200011}, {102200011,102200211},
    {102200100,102200101}, {102200101,102200121}, {102200110,102200112}, {102200112,102201112}, {102200121,102210121}, {102200211,102210211},
    {102201000,102201001}, {102201001,102221001}, {102201010,102201012}, {102201012,102201112}, {102201021,102211021}, {102201100,102201102},
    {102201102,102201112}, {102201112,102221112}, {102201120,102201121}, {102201121,102221121}, {102201201,102211201}, {102201210,102211210},
    {102201211,102221211}, {102202011,102202111}, {102202101,102202111}, {102202110,102202111}, {102210000,102210001}, {102210010,102210012},
    {102210012,112210012}, {102210100,102210102}, {102210102,102211102}, {102210112,102212112}, {102210120,102210121}, {102210210,102210211},
    {102211000,102211002}, {102211002,102211012}, {102211012,122211012}, {102211020,102211021}, {102211102,102211122}, {102211120,102211122},
    {102211122,112211122}, {102211200,102211201}, {102211210,102211212}, {102211212,112211212}, {102212010,102212011}, {102212100,102212101},
    {102212110,102212112}, {102220011,102220111}, {102220101,102220111}, {102220110,102220111}, {102221001,102221101}, {102221010,102221110},
    {102221011,102221211}, {102221100,102221101}, {102221101,102221121}, {102221110,102221112}, {102221112,112221112}, {102221121,112221121},
    {110000002,112000002}, {110000020,112000020}, {110000022,110000122}, {110000122,110002122}, {110000200,110000202}, {110000202,110000212},
    {110000212,110002212}, {110000220,110000221}, {110000221,110002221}, {110001022,110001222}, {110001202,110001222}, {110001220,110001222},
    {110002000,112002000}, {110002002,111002002}, {110002012,112002012}, {110002020,110002021}, {110002021,110002221}, {110002102,112002102},
    {110002120,110002122}, {110002122,110102122}, {110002200,110002201}, {110002201,110002221}, {110002210,110002212}, {110002212,110012212},
    {110002221,110012221}, {110010022,110010222}, {110010202,110010222}, {110010220,110010222}, {110012002,112012002}, {110012020,110012022},
    {110012022,111012022}, {110012122,112012122}, {110012200,110012202}, {110012202,110012212}, {110012220,110012221}, {110020000,112020000},
    {110020002,110020102}, {110020012,112020012}, {110020020,110020120}, {110020021,112020021}, {110020102,110020122}, {110020120,110020122},
    {110020122,110021122}, {110020200,111020200}, {110020201,112020201}, {110020210,112020210}, {110020212,111020212}, {110020221,111020221},
    {110021002,112021002}, {110021020,112021020}, {110021022,110021122}, {110021122,110221122}, {110021200,112021200}, {110021202,111021202},
    {110021212,112021212}, {110021220,111021220}, {110021221,112021221}, {110022000,110122000}, {110022001,110222001}, {110022010,110222010},
    {110022012,111022012}, {110022021,110122021}, {110022100,110222100}, {110022102,110122102}, {110022112,110222112}, {110022120,110122120},
    {110022121,110222121}, {110022201,111022201}, {110022210,111022210}, {110022211,110222211}, {110100022,110100222}, {110100202,110100222},
    {110100220,110100222}, {110102002,112102002}, {110102020,110102022}, {110102022,110102122}, {110102200,112102200}, {110102202,111102202},
    {110102212,112102212}, {110102220,110102221}, {110102221,110122221}, {110112022,110112222}, {110112202,110112222}, {110112220,110112222},
    {110120002,110120022}, {110120020,110120022}, {110120022,110120122}, {110120200,112120200}, {110120202,111120202}, {110120212,112120212},
    {110120220,111120220}, {110120221,112120221}, {110121022,110121222}, {110121202,110121222}, {110121220,110121222}, {110122000,110122002},
    {110122002,110122102}, {110122012,112122012}, {110122020,110122021}, {110122021,110122221}, {110122200,111122200}, {110122201,112122201},
    {110122210,112122210}, {110122212,111122212}, {110122221,111122221}, {110200000,110200002}, {110200002,110200012}, {110200012,110200212},
    {110200020,110200021}, {110200021,110200221}, {110200102,112200102}, {110200120,112200120}, {110200122,111200122}, {110200200,110200201},
    {110200201,110200221}, {110200210,110200212}, {110200212,110201212}, {110200221,110201221}, {110201002,112201002}, {110201020,112201020},
    {110201022,111201022}, {110201122,112201122}, {110201200,110201202}, {110201202,110201212}, {110201212,110221212}, {110201220,110201221},
    {110201221,110221221}, {110202000,110212000}, {110202001,110222001}, {110202010,110222010}, {110202012,110212012}, {110202021,110212021},
    {110202100,110222100}, {110202102,111202102}, {110202112,110222112}, {110202120,110212120}, {110202121,110222121}, {110202201,110212201},
    {110202210,110212210}, {110202211,110222211}, {110210002,110210022}, {110210020,110210022}, {110210022,111210022}, {110210122,112210122},
    {110210200,110210202}, {110210202,110210212}, {110210220,110210221}, {110211022,110211222}, {110211202,110211222}, {110211220,110211222},
    {110212000,110212002}, {110212002,110212012}, {110212020,110212021}, {110212102,112212102}, {110212120,110212122}, {110212122,111212122},
    {110212200,110212201}, {110220000,111220000}, {110220001,110222001}, {110220010,110222010}, {110220012,111220012}, {110220021,111220021},
    {110220100,110222100}, {110220102,111220102}, {110220112,110222112}, {110220120,111220120}, {110220121,110222121}, {110220201,111220201},
    {110220210,111220210}, {110220211,110222211}, {110221000,112221000}, {110221002,111221002}, {110221012,112221012}, {110221020,111221020},
    {110221021,112221021}, {110221102,112221102}, {110221120,112221120}, {110221122,111221122}, {110221200,111221200}, {110221201,112221201},
    {110221210,112221210}, {110221212,111221212}, {110221221,111221221}, {112000000,112000002}, {112000002,112000012}, {112000012,112002012},
    {112000020,112000021}, {112000021,112020021}, {112000102,112002102}, {112000120,112200120}, {112000122,112100122}, {112000200,112010200},
    {112000201,112020201}, {112000210,112020210}, {112000212,112010212}, {112000221,112010221}, {112001002,112001202}, {112001020,112001220},
    {112001022,112001122}, {112001122,112201122}, {112001200,112001202}, {112001202,112001212}, {112001212,112021212}, {112001220,112001221},
    {112001221,112021221}, {112002000,112002001}, {112002001,112022001}, {112002010,112002012}, {112002021,112002121}, {112002100,112002102},
    {112002120,112002121}, {112002121,112022121}, {112002201,112012201}, {112002210,112012210}, {112002211,112022211}, {112010002,112010022},
    {112010020,112010022}, {112010022,112010122}, {112010122,112012122}, {112010200,112010202}, {112010202,112010212}, {112010220,112010221},
    {112011022,112011222}, {112011202,112011222}, {112011220,112011222}, {112012000,112012002}, {112012020,112012021}, {112012120,112012122},
    {112012200,112012201}, {112020000,112020100}, {112020001,112020201}, {112020010,112020012}, {112020012,112020112}, {112020021,112020121},
    {112020100,112220100}, {112020102,112120102}, {112020112,112022112}, {112020120,112120120}, {112020121,112220121}, {112021000,112021200},
    {112021002,112021102}, {112021012,112021212}, {112021020,112021120}, {112021021,112021221}, {112021102,112221102}, {112021120,112221120},
    {112021122,112121122}, {112022001,112022011}, {112022010,112022011}, {112022011,112022211}, {112022100,112122100}, {112022101,112222101},
    {112022110,112022112}, {112022121,112122121}, {112100002,112100202}, {112100020,112100220}, {112100022,112100122}, {112100200,112100202},
    {112100202,112100212}, {112100212,112102212}, {112100220,112100221}, {112100221,112120221}, {112101022,112101222}, {112101202,112101222},
    {112101220,112101222}, {112102000,112102002}, {112102020,112102021}, {112102021,112102221}, {112102200,112102201}, {112102201,112122201},
    {112102210,112102212}, {112102221,112112221}, {112110022,112110222}, {112110202,112110222}, {112110220,112110222}, {112112020,112112022},
    {112112200,112112202}, {112112220,112112221}, {112120000,112120200}, {112120002,112120102}, {112120012,112120212}, {112120020,112120120},
    {112120021,112120221}, {112121002,112121202}, {112121020,112121220}, {112121022,112121122}, {112122000,112122100}, {112122001,112122201},
    {112122010,112122012}, {112122021,112122121}, {112200000,112210000}, {112200001,112220001}, {112200010,112220010}, {112200012,112210012},
    {112200021,112210021}, {112200100,112202100}, {112200102,112201102}, {112200112,112202112}, {112200120,112200121}, {112200121,112220121},
    {112200201,112210201}, {112200210,112210210}, {112200211,112220211}, {112201000,112201002}, {112201002,112201012}, {112201012,112221012},
    {112201020,112201021}, {112201021,112221021}, {112201102,112201122}, {112201120,112201122}, {112201122,112211122}, {112201200,112211200},
    {112201201,112221201}, {112201210,112221210}, {112201212,112211212}, {112201221,112211221}, {112202001,112212001}, {112202010,112212010},
    {112202011,112222011}, {112202100,112202101}, {112202101,112222101}, {112202110,112202112}, {112202121,112212121}, {112202211,112212211},
    {112210000,112210002}, {112210002,112210012}, {112210020,112210021}, {112210102,112212102}, {112210120,112210122}, {112210122,112211122},
    {112210200,112210201}, {112211002,112211022}, {112211020,112211022}, {112211022,112211122}, {112211200,112211202}, {112211202,112211212},
    {112211220,112211221}, {112212000,112212001}, {112212100,112212102}, {112212120,112212121}, {112220001,112220011}, {112220010,112220011},
    {112220011,112220211}, {112220100,112221100}, {112220101,112222101}, {112220110,112222110}, {112220112,112221112}, {112220121,112221121},
    {112221000,112221100}, {112221001,112221201}, {112221010,112221210}, {112221012,112221112}, {112221021,112221121}, {112221100,112221102},
    {112221102,112221112}, {112221120,112221121}, {120000000,120000100}, {120000001,120020001}, {120000010,120000012}, {120000012,120000112},
    {120000021,120010021}, {120000100,120000102}, {120000102,120010102}, {120000112,120200112}, {120000120,120010120}, {120000121,120020121},
    {120000201,120001201}, {120000210,120000211}, {120000211,120020211}, {120001000,120021000}, {120001002,120101002}, {120001012,120001212},
    {120001020,120011020}, {120001021,120021021}, {120001102,120201102}, {120001120,120021120}, {120001122,120011122}, {120001200,120001201},
    {120001201,120001221}, {120001210,120001212}, {120001212,120011212}, {120001221,120011221}, {120002001,120002011}, {120002010,120002011},
    {120002011,120002211}, {120002100,120002101}, {120002101,120002121}, {120002110,120002112}, {120002112,120102112}, {120002121,120012121},
    {120002211,120012211}, {120010000,120010002}, {120010002,120010102}, {120010012,120010212}, {120010020,120010021}, {120010102,120010122},
    {120010120,120010122}, {120010122,120011122}, {120010200,120010201}, {120010210,120010212}, {120010212,120011212}, {120011002,120211002},
    {120011020,120011022}, {120011022,120011122}, {120011122,120211122}, {120011200,120011202}, {120011202,120111202}, {120011212,120211212},
    {120011220,120011221}, {120012000,120012001}, {120012010,120012012}, {120012012,121012012}, {120012100,120012102}, {120012102,120112102},
    {120012112,122012112}, {120012120,120012121}, {120012210,120012211}, {120020001,120020011}, {120020010,120020110}, {120020011,120020211},
    {120020100,120020110}, {120020101,120020121}, {120020110,120020112}, {120020112,120120112}, {120020211,121020211}, {120021000,120021010},
    {120021001,120021021}, {120021010,120021012}, {120021012,120021112}, {120021100,120021120}, {120021102,120121102}, {120021112,120221112},
    {120021201,121021201}, {120021210,121021210}, {120021211,122021211}, {120022011,120022111}, {120022101,120022111}, {120022110,120022111},
    {120100000,120100002}, {120100002,120100102}, {120100012,120100212}, {120100020,120100120}, {120100021,120120021}, {120100200,120110200},
    {120100201,120120201}, {120100210,120100212}, {120100212,120101212}, {120100221,120110221}, {120101002,120101022}, {120101020,120121020},
    {120101022,120101122}, {120101200,120121200}, {120101202,120111202}, {120101212,120121212}, {120101220,120111220}, {120101221,120121221},
    {120102000,120102001}, {120102001,120102021}, {120102010,120102210}, {120102012,120102112}, {120102021,120102121}, {120102201,120112201},
    {120102210,120102211}, {120102211,120122211}, {120110002,120110022}, {120110020,120110022}, {120110022,120110122}, {120110200,120110202},
    {120110202,120111202}, {120110212,120112212}, {120110220,120110221}, {120112000,120112002}, {120112002,120112102}, {120112012,122112012},
    {120112020,120112021}, {120112200,120112201}, {120112210,120112212}, {120112212,121112212}, {120120000,120120100}, {120120001,120120021},
    {120120010,120120210}, {120120012,120120112}, {120120201,120120211}, {120120210,121120210}, {120120211,122120211}, {120121000,120121020},
    {120121002,120121102}, {120121012,120121212}, {120121200,120121201}, {120121201,120121221}, {120121210,122121210}, {120121212,121121212},
    {120122001,120122101}, {120122010,120122110}, {120122011,120122211}, {120122211,121122211}, {120200001,120200011}, {120200010,120200011},
    {120200011,120200211}, {120200100,120200101}, {120200101,120200121}, {120200110,120200112}, {120200112,120201112}, {120200121,120210121},
    {120200211,120201211}, {120201000,120201001}, {120201001,120201021}, {120201010,120201012}, {120201012,120201112}, {120201021,120211021},
    {120201100,120201102}, {120201102,120201112}, {120201112,120221112}, {120201120,120211120}, {120201121,120221121}, {120201201,120201211},
    {120201210,120201211}, {120201211,120221211}, {120202011,120202111}, {120202101,120202111}, {120202110,120202111}, {120210000,120210001},
    {120210010,120210012}, {120210012,120210112}, {120210100,120210102}, {120210102,121210102}, {120210112,122210112}, {120210120,120210121},
    {120210210,120210211}, {120211000,120211002}, {120211002,120211012}, {120211012,120211212}, {120211020,120211021}, {120211102,122211102},
    {120211120,120211122}, {120211122,121211122}, {120211200,120211201}, {120211210,120211212}, {120211212,121211212}, {120212010,120212011},
    {120212100,120212101}, {120212110,120212112}, {120212112,121212112}, {120220011,120220111}, {120220101,120220111}, {120220110,120220111},
    {120221001,120221011}, {120221010,120221011}, {120221011,120221211}, {120221100,120221110}, {120221101,120221121}, {120221110,120221112},
    {120221112,121221112}, {120221211,121221211}, {121000000,121020000}, {121000002,121000102}, {121000012,121000212}, {121000020,121010020},
    {121000021,121020021}, {121000102,121000122}, {121000120,121020120}, {121000122,121010122}, {121000200,121000201}, {121000201,121000221},
    {121000210,121000212}, {121000212,121001212}, {121000221,121001221}, {121001002,121001022}, {121001020,121001022}, {121001022,121001122},
    {121001122,121021122}, {121001200,121001202}, {121001202,121001212}, {121001212,121021212}, {121001220,121001221}, {121002000,121002100},
    {121002001,121022001}, {121002010,121002210}, {121002012,121002112}, {121002021,121012021}, {121002100,121002102}, {121002102,121002112},
    {121002112,121022112}, {121002120,121012120}, {121002121,121022121}, {121002201,121012201}, {121002210,121002211}, {121002211,121022211},
    {121010002,121010202}, {121010020,121010022}, {121010022,121010122}, {121010200,121010202}, {121010202,121010212}, {121010212,121012212},
    {121010220,121010221}, {121011022,121011222}, {121011202,121011222}, {121011220,121011222}, {121012000,121012002}, {121012002,121012102},
    {121012012,121012212}, {121012020,121012021}, {121012200,121012201}, {121012210,121012212}, {121012212,121112212}, {121020000,121020010},
    {121020001,121020021}, {121020010,121020012}, {121020012,121020112}, {121020100,121020120}, {121020102,121120102}, {121020112,121220112},
    {121020201,121021201}, {121020210,121020211}, {121020211,121022211}, {121021000,121021020}, {121021002,121021012}, {121021012,121021212},
    {121021102,121021122}, {121021200,121021201}, {121021210,121021212}, {121021212,121121212}, {121022001,121022011}, {121022010,121122010},
    {121022011,121222011}, {121022100,121122100}, {121022101,121022121}, {121022110,121222110}, {121022112,121122112}, {121022211,121122211},
    {121100002,121100202}, {121100020,121100220}, {121100022,121100122}, {121100200,121100220}, {121100202,121100212}, {121100212,121102212},
    {121100220,121100221}, {121100221,121120221}, {121101022,121101222}, {121101202,121101222}, {121101220,121101222}, {121102000,121102200},
    {121102002,121102102}, {121102012,121102212}, {121102020,121102120}, {121102021,121122021}, {121102200,121102201}, {121102201,121122201},
    {121102210,121102212}, {121102212,121112212}, {121102221,121112221}, {121110022,121110222}, {121110202,121110222}, {121110220,121110222},
    {121112002,121112202}, {121112020,121112022}, {121112022,121112122}, {121112200,121112202}, {121112202,121112212}, {121112220,121112221},
    {121120000,121120020}, {121120002,121120102}, {121120012,121120212}, {121120200,121120210}, {121120201,121120221}, {121120210,121120212},
    {121120212,121121212}, {121121002,121121022}, {121121200,121121220}, {121121202,121121212}, {121122000,121122100}, {121122001,121122021},
    {121122010,121122210}, {121122012,121122112}, {121122201,121122211}, {121122210,121122211}, {121200000,121200001}, {121200001,121200021},
    {121200010,121200012}, {121200012,121200112}, {121200021,121201021}, {121200100,121220100}, {121200102,121210102}, {121200112,121220112},
    {121200120,121210120}, {121200121,121220121}, {121200201,121200211}, {121200210,121200211}, {121200211,121202211}, {121201000,121201002},
    {121201002,121201012}, {121201012,121201212}, {121201020,121201021}, {121201102,121221102}, {121201120,121221120}, {121201122,121211122},
    {121201200,121201201}, {121201210,121201212}, {121201212,121211212}, {121202001,121212001}, {121202010,121212010}, {121202011,121222011},
    {121202100,121212100}, {121202101,121222101}, {121202110,121222110}, {121202112,121212112}, {121202121,121212121}, {121202211,121212211},
    {121210000,121210002}, {121210002,121210102}, {121210012,121210212}, {121210020,121210021}, {121210200,121210201}, {121210210,121210212},
    {121210212,121211212}, {121211002,121211202}, {121211020,121211022}, {121211022,121211122}, {121211200,121211202}, {121211202,121211212},
    {121211220,121211221}, {121212000,121212001}, {121212010,121212012}, {121212012,121212112}, {121212210,121212211}, {121220001,121221001},
    {121220010,121221010}, {121220011,121222011}, {121220100,121220101}, {121220101,121220121}, {121220110,121222110}, {121220112,121221112},
    {121220211,121221211}, {121221000,121221001}, {121221010,121221012}, {121221012,121221112}, {121221100,121221120}, {121221102,121221112},
    {121221210,121221211}, {122000001,122000011}, {122000010,122000011}, {122000011,122000211}, {122000100,122000101}, {122000101,122000121},
    {122000110,122000112}, {122000112,122100112}, {122000121,122010121}, {122000211,122010211}, {122001000,122001010}, {122001001,122021001},
    {122001010,122001012}, {122001012,122101012}, {122001021,122011021}, {122001100,122001102}, {122001102,122101102}, {122001112,122201112},
    {122001120,122011120}, {122001121,122021121}, {122001201,122011201}, {122001210,122011210}, {122001211,122021211}, {122002011,122002111},
    {122002101,122002111}, {122002110,122002111}, {122010000,122010001}, {122010010,122010012}, {122010012,122011012}, {122010100,122010102},
    {122010102,122110102}, {122010112,122012112}, {122010120,122010121}, {122010210,122010211}, {122011000,122011002}, {122011002,122111002},
    {122011012,122211012}, {122011020,122011021}, {122011102,122211102}, {122011120,122011122}, {122011122,122111122}, {122011200,122011201},
    {122011210,122011212}, {122011212,122111212}, {122012010,122012011}, {122012100,122012101}, {122012110,122012112}, {122020011,122020111},
    {122020101,122020111}, {122020110,122020111}, {122021001,122021011}, {122021010,122021110}, {122021011,122021211}, {122021100,122021110},
    {122021101,122021121}, {122021110,122021112}, {122021112,122121112}, {122100000,122100001}, {122100001,122100021}, {122100010,122100012},
    {122100012,122100112}, {122100021,122100121}, {122100201,122110201}, {122100210,122110210}, {122100211,122120211}, {122101000,122101002},
    {122101002,122101012}, {122101012,122101212}, {122101020,122101120}, {122101021,122121021}, {122101200,122111200}, {122101201,122121201},
    {122101210,122121210}, {122101212,122111212}, {122101221,122111221}, {122102001,122102011}, {122102010,122102011}, {122102011,122102211},
    {122102211,122112211}, {122110000,122110002}, {122110002,122110102}, {122110012,122112012}, {122110020,122110021}, {122110200,122110201},
    {122110210,122110212}, {122110212,122111212}, {122112000,122112001}, {122112010,122112012}, {122112210,122112211}, {122120001,122120101},
    {122120010,122120110}, {122120011,122120211}, {122121000,122121100}, {122121001,122121021}, {122121010,122121210}, {122121012,122121112},
    {122122011,122122111}, {122200011,122200111}, {122200101,122200111}, {122200110,122200111}, {122201001,122201011}, {122201010,122201011},
    {122201011,122201211}, {122201100,122201101}, {122201101,122201121}, {122201110,122201112}, {122201112,122211112}, {122201121,122211121},
    {122201211,122211211}, {122210010,122210011}, {122210100,122210101}, {122210110,122210112}, {122210112,122211112}, {122211000,122211001},
    {122211010,122211012}, {122211012,122211112}, {122211100,122211102}, {122211102,122211112}, {122211120,122211121}, {122211210,122211211},
    {122212110,122212111}, {122221011,122221111}, {122221101,122221111}, {122221110,122221111}, {200000001,200000101}, {200000010,200000110},
    {200000011,200000211}, {200000100,200000101}, {200000101,200000121}, {200000110,200000112}, {200000112,200010112}, {200000121,201000121},
    {200000211,200001211}, {200001000,201001000}, {200001001,202001001}, {200001010,200001210}, {200001012,200011012}, {200001021,200011021},
    {200001100,202001100}, {200001102,200011102}, {200001112,200021112}, {200001120,200011120}, {200001121,202001121}, {200001201,200101201},
    {200001210,200001211}, {200001211,200201211}, {200002011,200002111}, {200002101,200002111}, {200002110,200002111}, {200010000,200010001},
    {200010001,200010201}, {200010010,220010010}, {200010012,200010112}, {200010021,200011021}, {200010100,202010100}, {200010102,200010112},
    {200010112,200012112}, {200010120,200011120}, {200010121,202010121}, {200010201,200110201}, {200010210,200110210}, {200010211,200210211},
    {200011000,200211000}, {200011002,200011012}, {200011012,200011212}, {200011020,200011021}, {200011021,200011221}, {200011102,200011122},
    {200011120,200011122}, {200011122,200111122}, {200011200,200111200}, {200011201,200211201}, {200011210,200211210}, {200011212,200111212},
    {200011221,200111221}, {200012001,200012011}, {200012010,200012011}, {200012011,200012211}, {200012100,200012101}, {200012101,200012121},
    {200012110,200012112}, {200012112,201012112}, {200012121,201012121}, {200012211,210012211}, {200020011,200020111}, {200020101,200020111},
    {200020110,200020111}, {200021001,200021011}, {200021010,200021011}, {200021011,200021211}, {200021100,200021101}, {200021101,200021121},
    {200021110,200021112}, {200021121,201021121}, {200021211,201021211}, {200100000,200100001}, {200100001,200102001}, {200100010,202100010},
    {200100012,200110012}, {200100021,200101021}, {200100100,202100100}, {200100102,200110102}, {200100112,200102112}, {200100120,200110120},
    {200100121,220100121}, {200100201,200101201}, {200100210,200110210}, {200100211,202100211}, {200101000,200121000}, {200101002,200111002},
    {200101012,200121012}, {200101020,200101021}, {200101021,200101221}, {200101102,200121102}, {200101120,200121120}, {200101122,200111122},
    {200101200,200101201}, {200101201,200101221}, {200101210,200121210}, {200101212,200111212}, {200101221,200111221}, {200102001,200102011},
    {200102010,200102011}, {200102011,200102211}, {200102100,200102101}, {200102101,200102121}, {200102110,200102112}, {200102112,200112112},
    {200102121,200112121}, {200102211,200112211}, {200110000,200112000}, {200110002,200110012}, {200110012,200110212}, {200110020,200110120},
    {200110021,200112021}, {200110102,200110122}, {200110120,200110122}, {200110122,200111122}, {200110200,200110210}, {200110201,200112201},
    {200110210,200110212}, {200110212,200111212}, {200110221,200111221}, {200112000,200112001}, {200112001,200112021}, {200112010,220112010},
    {200112012,201112012}, {200112021,200112121}, {200112100,202112100}, {200112102,201112102}, {200112112,202112112}, {200112120,201112120},
    {200112121,202112121}, {200112201,200112211}, {200112210,210112210}, {200112211,220112211}, {200120001,200120011}, {200120010,200120011},
    {200120011,200120211}, {200120100,200120101}, {200120101,200120121}, {200120110,200120112}, {200120121,210120121}, {200120211,201120211},
    {200121000,200121001}, {200121001,202121001}, {200121010,200121012}, {200121021,201121021}, {200121100,200121102}, {200121120,200121121},
    {200121121,220121121}, {200121201,201121201}, {200121210,200121211}, {200121211,202121211}, {200122011,200122111}, {200122101,200122111},
    {200122110,200122111}, {200200011,200200111}, {200200101,200200111}, {200200110,200200111}, {200201001,200201101}, {200201010,200201110},
    {200201011,200201211}, {200201100,200201101}, {200201101,200201121}, {200201110,200201112}, {200201112,200211112}, {200201121,201201121},
    {200210001,200210101}, {200210010,200210110}, {200210011,200210211}, {200210100,200210101}, {200210101,200210121}, {200210110,200210112},
    {200210112,200211112}, {200210121,201210121}, {200211000,200211100}, {200211001,200211201}, {200211010,200211210}, {200211012,200211112},
    {200211021,201211021}, {200211100,202211100}, {200211102,200211112}, {200211112,202211112}, {200211120,201211120}, {200211121,202211121},
    {200212011,200212111}, {200212101,200212111}, {200212110,200212111}, {200221011,200221111}, {200221101,200221111}, {200221110,200221111},
    {201000000,201000001}, {201000001,201000021}, {201000010,201000210}, {201000012,201010012}, {201000021,201000121}, {201000100,201000102},
    {201000102,201010102}, {201000112,201020112}, {201000120,201000121}, {201000121,201002121}, {201000201,201001201}, {201000210,201100210},
    {201000211,201200211}, {201001000,201001002}, {201001002,201011002}, {201001012,201001212}, {201001020,201001021}, {201001102,201021102},
    {201001120,201001122}, {201001122,201011122}, {201001200,201001201}, {201001210,201001212}, {201001212,201011212}, {201002001,201002101},
    {201002010,201002110}, {201002011,201002211}, {201002100,201002101}, {201002101,201002121}, {201002110,201002112}, {201002112,201012112},
    {201002121,201012121}, {201002211,201102211}, {201010000,201010200}, {201010002,201010012}, {201010012,201010212}, {201010020,201010021},
    {201010021,201010221}, {201010200,201110200}, {201010201,201210201}, {201010210,201210210}, {201010212,201110212}, {201010221,201011221},
    {201011002,201011022}, {201011020,201011022}, {201011022,201011122}, {201011200,201211200}, {201011202,201111202}, {201011212,201211212},
    {201011220,201011221}, {201012000,201012010}, {201012001,201012201}, {201012010,201012012}, {201012012,201012112}, {201012021,201012121},
    {201012201,201112201}, {201012210,211012210}, {201012211,201212211}, {201020001,201020011}, {201020010,201020011}, {201020011,201020211},
    {201020100,201020101}, {201020101,201020121}, {201020110,201020112}, {201020121,201021121}, {201020211,201021211}, {201021000,201021001},
    {201021010,201021012}, {201021100,201021102}, {201021120,201021121}, {201021210,201021211}, {201022011,201022111}, {201022101,201022111},
    {201022110,201022111}, {201100000,201102000}, {201100002,201110002}, {201100012,201120012}, {201100020,201101020}, {201100021,201102021},
    {201100102,201120102}, {201100120,201120120}, {201100122,201110122}, {201100200,201101200}, {201100201,201102201}, {201100210,201102210},
    {201100212,201110212}, {201100221,201101221}, {201101002,201121002}, {201101020,201101022}, {201101022,201111022}, {201101122,201121122},
    {201101200,201101202}, {201101202,201111202}, {201101212,201121212}, {201101220,201101221}, {201102000,201102001}, {201102001,201102021},
    {201102010,201102210}, {201102012,201112012}, {201102021,201102121}, {201102100,201122100}, {201102102,201112102}, {201102112,201122112},
    {201102120,201112120}, {201102121,201122121}, {201102201,201102211}, {201102210,201102211}, {201102211,201122211}, {201110002,201110022},
    {201110020,201110022}, {201110022,201110122}, {201110200,201112200}, {201110202,201110212}, {201110212,201112212}, {201110220,201111220},
    {201110221,201112221}, {201112000,201112200}, {201112002,201112012}, {201112012,201112212}, {201112020,201112120}, {201112021,201112221},
    {201112200,201112201}, {201112201,201112221}, {201112210,221112210}, {201112212,211112212}, {201112221,211112221}, {201120000,201120001},
    {201120001,201122001}, {201120010,201120012}, {201120021,201121021}, {201120100,201120102}, {201120120,201120121}, {201120121,221120121},
    {201120201,201121201}, {201120210,201120211}, {201120211,201122211}, {201121000,201121002}, {201121020,201121021}, {201121120,201121122},
    {201121200,201121201}, {201121210,201121212}, {201122001,201122011}, {201122010,201122011}, {201122011,201122211}, {201122100,201122101},
    {201122101,201122121}, {201122110,201122112}, {201122121,211122121}, {201122211,211122211}, {201200001,201200101}, {201200010,201200110},
    {201200011,201200211}, {201200100,201200101}, {201200101,201200121}, {201200110,201200112}, {201200112,201210112}, {201200121,201201121},
    {201201000,201201001}, {201201010,201201012}, {201201012,201201112}, {201201100,201201102}, {201201102,201211102}, {201201112,201221112},
    {201201120,201201121}, {201202011,201202111}, {201202101,201202111}, {201202110,201202111}, {201210000,201210100}, {201210001,201210201},
    {201210010,201210210}, {201210012,201210112}, {201210021,201210121}, {201211000,201211200}, {201211002,201211102}, {201211012,201211212},
    {201211020,201211021}, {201212001,201212101}, {201212010,201212110}, {201212011,201212211}, {201220011,201220111}, {201220101,201220111},
    {201220110,201220111}, {201221010,201221011}, {201221100,201221101}, {201221110,201221112}, {202000011,202000111}, {202000101,202000111},
    {202000110,202000111}, {202001001,202001011}, {202001010,202001011}, {202001011,202001211}, {202001100,212001100}, {202001101,222001101},
    {202001110,202001112}, {202001112,202011112}, {202001121,212001121}, {202001211,202011211}, {202010001,212010001}, {202010010,212010010},
    {202010011,222010011}, {202010100,212010100}, {202010101,222010101}, {202010110,222010110}, {202010112,212010112}, {202010121,212010121},
    {202010211,212010211}, {202011000,202111000}, {202011001,202211001}, {202011010,222011010}, {202011012,202111012}, {202011021,202111021},
    {202011100,222011100}, {202011102,202111102}, {202011112,222011112}, {202011120,202111120}, {202011121,222011121}, {202011201,202111201},
    {202011210,202111210}, {202011211,202211211}, {202012011,202012111}, {202012101,202012111}, {202012110,202012111}, {202021011,202021111},
    {202021101,202021111}, {202021110,202021111}, {202100001,212100001}, {202100010,202100011}, {202100011,202100211}, {202100100,202100101},
    {202100101,222100101}, {202100110,202100112}, {202100112,202101112}, {202100121,212100121}, {202100211,202101211}, {202101000,202111000},
    {202101001,202121001}, {202101010,202121010}, {202101012,202111012}, {202101021,202111021}, {202101100,202121100}, {202101102,202111102},
    {202101112,202121112}, {202101120,202111120}, {202101121,222101121}, {202101201,202111201}, {202101210,202111210}, {202101211,202121211},
    {202102011,202102111}, {202102101,202102111}, {202102110,202102111}, {202110000,202111000}, {202110001,222110001}, {202110010,222110010},
    {202110012,202111012}, {202110021,202111021}, {202110100,202112100}, {202110102,202111102}, {202110112,202112112}, {202110120,202111120},
    {202110121,222110121}, {202110201,202111201}, {202110210,202111210}, {202110211,222110211}, {202112001,212112001}, {202112010,212112010},
    {202112011,222112011}, {202112100,202112101}, {202112101,222112101}, {202112110,202112112}, {202112121,212112121}, {202112211,212112211},
    {202120011,202120111}, {202120101,202120111}, {202120110,202120111}, {202121001,202121011}, {202121010,202121011}, {202121011,202121211},
    {202121100,202121101}, {202121101,222121101}, {202121110,202121112}, {202121121,212121121}, {202201011,202201111}, {202201101,202201111},
    {202201110,202201111}, {202210011,202210111}, {202210101,202210111}, {202210110,202210111}, {202211001,202211011}, {202211010,212211010},
    {202211011,202211211}, {202211100,212211100}, {202211101,222211101}, {202211110,222211110}, {202211112,212211112}, {202211121,212211121},
    {210000000,210000001}, {210000001,210000021}, {210000010,210020010}, {210000012,210010012}, {210000021,210000121}, {210000100,210000120},
    {210000102,210010102}, {210000112,210020112}, {210000120,210000121}, {210000121,210002121}, {210000201,210100201}, {210000210,210010210},
    {210000211,210020211}, {210001000,210001200}, {210001002,210011002}, {210001012,210021012}, {210001020,210001021}, {210001021,212001021},
    {210001102,210021102}, {210001120,210021120}, {210001122,210011122}, {210001200,210001201}, {210001201,210201201}, {210001210,210021210},
    {210001212,210011212}, {210001221,210101221}, {210002001,210002011}, {210002010,210002011}, {210002011,210002211}, {210002100,210002110},
    {210002101,210002121}, {210002110,210002112}, {210002112,210012112}, {210002121,210012121}, {210002211,210012211}, {210010000,210010020},
    {210010002,210010012}, {210010020,210010021}, {210010021,210010221}, {210010102,210010122}, {210010120,212010120}, {210010122,210011122},
    {210010200,210010210}, {210010201,210210201}, {210010221,210110221}, {210011002,210011022}, {210011020,210211020}, {210011022,210011122},
    {210011122,210211122}, {210011200,210211200}, {210011202,210011212}, {210011220,210111220}, {210011221,210211221}, {210012000,210012010},
    {210012001,210012021}, {210012021,210012121}, {210012100,210012102}, {210012102,210012112}, {210012120,211012120}, {210012121,212012121},
    {210012201,210012211}, {210020001,210020101}, {210020010,210020011}, {210020011,210020211}, {210020100,210020101}, {210020101,210020121},
    {210020110,210020112}, {210020121,210021121}, {210020211,210021211}, {210021000,210021001}, {210021001,212021001}, {210021010,210021012},
    {210021021,211021021}, {210021100,210021102}, {210021120,210021121}, {210021121,212021121}, {210021201,211021201}, {210021210,210021211},
    {210021211,210221211}, {210022011,210022111}, {210022101,210022111}, {210022110,210022111}, {210100000,210100020}, {210100002,210110002},
    {210100012,210120012}, {210100020,210100021}, {210100021,210102021}, {210100102,210102102}, {210100120,210102120}, {210100122,210110122},
    {210100200,210110200}, {210100201,210102201}, {210100210,210120210}, {210100212,210110212}, {210100221,210101221}, {210101002,210121002},
    {210101020,210121020}, {210101022,210111022}, {210101122,210121122}, {210101200,210121200}, {210101202,210111202}, {210101212,210121212},
    {210101220,210101221}, {210101221,210121221}, {210102000,210102001}, {210102001,210102021}, {210102010,210122010}, {210102012,210112012},
    {210102021,210102121}, {210102100,210102102}, {210102102,210102112}, {210102112,210122112}, {210102120,210102121}, {210102121,210122121},
    {210102201,210102211}, {210102210,210112210}, {210102211,210122211}, {210110002,210110022}, {210110020,210112020}, {210110022,210110122},
    {210110122,210112122}, {210110200,210110202}, {210110202,210110212}, {210110220,210111220}, {210110221,210112221}, {210112000,210112020},
    {210112002,210112012}, {210112020,210112021}, {210112021,210112221}, {210112102,212112102}, {210112120,212112120}, {210112122,211112122},
    {210112200,210112210}, {210112201,210112221}, {210112221,211112221}, {210120000,210120001}, {210120001,210120021}, {210120010,210120012},
    {210120021,210120121}, {210120100,210120102}, {210120120,210120121}, {210120121,210122121}, {210120201,211120201}, {210120210,210120211},
    {210120211,212120211}, {210121000,210121002}, {210121020,210121021}, {210121021,212121021}, {210121120,210121122}, {210121200,210121201},
    {210121201,212121201}, {210121210,210121212}, {210121221,211121221}, {210122001,210122011}, {210122010,210122011}, {210122011,210122211},
    {210122100,210122101}, {210122101,210122121}, {210122110,210122112}, {210122121,211122121}, {210122211,211122211}, {210200001,210200101},
    {210200010,210200110}, {210200011,210200211}, {210200100,210200101}, {210200101,210200121}, {210200110,210200112}, {210200112,210210112},
    {210200121,211200121}, {210201000,210201100}, {210201001,210201201}, {210201010,210201210}, {210201012,210211012}, {210201021,211201021},
    {210201100,210201102}, {210201102,210211102}, {210201112,210221112}, {210201120,211201120}, {210201121,212201121}, {210202011,210202111},
    {210202101,210202111}, {210202110,210202111}, {210210000,210210010}, {210210001,210210201}, {210210021,210210121}, {210210100,210210102},
    {210210102,210210112}, {210210120,211210120}, {210210121,212210121}, {210211000,210211200}, {210211002,210211012}, {210211020,210211120},
    {210211021,210211221}, {210211102,210211122}, {210211120,212211120}, {210211122,211211122}, {210212001,210212011}, {210212100,210212101},
    {210212101,210212121}, {210212121,211212121}, {210220011,210220111}, {210220101,210220111}, {210220110,210220111}, {210221001,210221101},
    {210221010,210221011}, {210221011,210221211}, {210221100,210221101}, {210221101,210221121}, {210221110,210221112}, {210221121,211221121},
    {211000000,211000200}, {211000002,211010002}, {211000012,211020012}, {211000020,211000021}, {211000021,211002021}, {211000102,211020102},
    {211000120,211020120}, {211000122,211010122}, {211000200,211000201}, {211000201,211200201}, {211000210,211020210}, {211000212,211010212},
    {211000221,211001221}, {211001002,211001022}, {211001020,211001022}, {211001022,211001122}, {211001122,211021122}, {211001200,211001202},
    {211001202,211001212}, {211001212,211021212}, {211001220,211001221}, {211002000,211012000}, {211002001,211202001}, {211002010,211022010},
    {211002012,211012012}, {211002021,211002121}, {211002100,211022100}, {211002102,211012102}, {211002112,211022112}, {211002120,211012120},
    {211002121,211022121}, {211002201,211102201}, {211002210,211012210}, {211002211,211202211}, {211010002,211010022}, {211010020,211010220},
    {211010022,211010122}, {211010200,211010220}, {211010202,211010212}, {211010220,211010221}, {211010221,211210221}, {211011022,211011222},
    {211011202,211011222}, {211011220,211011222}, {211012000,211012002}, {211012002,211012012}, {211012020,211012120}, {211012021,211012221},
    {211012200,211012210}, {211012201,211212201}, {211012221,211112221}, {211020000,211020001}, {211020001,211022001}, {211020010,211020012},
    {211020021,211021021}, {211020100,211020102}, {211020120,211020121}, {211020121,211022121}, {211020201,211021201}, {211020210,211020211},
    {211020211,211220211}, {211021000,211021002}, {211021020,211021021}, {211021120,211021122}, {211021200,211021201}, {211021210,211021212},
    {211022001,211122001}, {211022010,211022011}, {211022011,211222011}, {211022100,211022101}, {211022101,211222101}, {211022110,211022112},
    {211022121,211122121}, {211022211,211122211}, {211100002,211100022}, {211100020,211100022}, {211100022,211100122}, {211100122,211120122},
    {211100200,211100202}, {211100202,211100212}, {211100212,211120212}, {211100220,211100221}, {211100221,211102221}, {211101022,211101222},
    {211101202,211101222}, {211101220,211101222}, {211102000,211102020}, {211102002,211112002}, {211102012,211122012}, {211102020,211102021},
    {211102021,211102221}, {211102102,211122102}, {211102120,211122120}, {211102122,211112122}, {211102200,211102201}, {211102201,211102221},
    {211102210,211122210}, {211102212,211112212}, {211102221,211112221}, {211110022,211110222}, {211110202,211110222}, {211110220,211110222},
    {211112002,211112022}, {211112020,211112220}, {211112022,211112122}, {211112200,211112220}, {211112202,211112212}, {211112220,211112221},
    {211120000,211120002}, {211120020,211120021}, {211120021,211122021}, {211120120,211120122}, {211120200,211120201}, {211120201,211122201},
    {211120210,211120212}, {211120221,211121221}, {211121020,211121022}, {211121200,211121202}, {211121220,211121221}, {211122000,211122001},
    {211122001,211122021}, {211122010,211122012}, {211122021,211122121}, {211122100,211122102}, {211122120,211122121}, {211122201,211122211},
    {211122210,211122211}, {211200000,211200001}, {211200001,211200201}, {211200010,211200210}, {211200012,211210012}, {211200021,211200121},
    {211200100,211220100}, {211200102,211210102}, {211200112,211220112}, {211200120,211200121}, {211200121,211202121}, {211201000,211201002},
    {211201002,211201012}, {211201012,211201212}, {211201020,211201021}, {211201102,211221102}, {211201120,211201122}, {211201122,211211122},
    {211202001,211202011}, {211202010,211212010}, {211202011,211202211}, {211202100,211212100}, {211202101,211222101}, {211202110,211222110},
    {211202112,211212112}, {211202121,211212121}, {211210000,211210200}, {211210002,211210012}, {211210020,211210120}, {211210021,211210221},
    {211211002,211211202}, {211211020,211211220}, {211211022,211211122}, {211212000,211212010}, {211212001,211212201}, {211212021,211212121},
    {211220001,211221001}, {211220010,211220011}, {211220011,211220211}, {211220100,211220101}, {211220101,211222101}, {211220110,211220112},
    {211220121,211221121}, {211221000,211221001}, {211221010,211221012}, {211221100,211221102}, {211221120,211221121}, {212000001,212000011},
    {212000010,212000011}, {212000011,212000211}, {212000100,212000110}, {212000101,212000121}, {212000110,212000112}, {212000112,212010112},
    {212000121,212001121}, {212000211,212010211}, {212001000,212011000}, {212001001,212001201}, {212001010,212021010}, {212001012,212011012},
    {212001021,212001121}, {212001100,212001120}, {212001102,212011102}, {212001112,212021112}, {212001120,212001121}, {212001121,212021121},
    {212001201,212001211}, {212001210,212011210}, {212001211,212021211}, {212002011,212002111}, {212002101,212002111}, {212002110,212002111},
    {212010000,212010010}, {212010001,212010021}, {212010021,212010121}, {212010100,212010120}, {212010102,212010112}, {212010120,212010121},
    {212010121,212012121}, {212010201,212010211}, {212011000,212011002}, {212011002,212011012}, {212011020,212111020}, {212011021,212211021},
    {212011102,212011122}, {212011120,212211120}, {212011122,212111122}, {212011200,212011210}, {212011201,212211201}, {212011221,212111221},
    {212012001,212012011}, {212012100,212012110}, {212012101,212012121}, {212012121,212112121}, {212020011,212020111}, {212020101,212020111},
    {212020110,212020111}, {212021001,212021101}, {212021010,212021011}, {212021011,212021211}, {212021100,212021101}, {212021101,212021121},
    {212021110,212021112}, {212021121,212121121}, {212100000,212110000}, {212100001,212100021}, {212100010,212120010}, {212100012,212110012},
    {212100021,212100121}, {212100100,212100102}, {212100102,212100112}, {212100112,212102112}, {212100120,212100121}, {212100121,212102121},
    {212100201,212110201}, {212100210,212110210}, {212100211,212120211}, {212101000,212121000}, {212101002,212111002}, {212101012,212121012},
    {212101020,212111020}, {212101021,212121021}, {212101102,212121102}, {212101120,212121120}, {212101122,212111122}, {212101200,212111200},
    {212101201,212121201}, {212101210,212121210}, {212101212,212111212}, {212101221,212111221}, {212102001,212102011}, {212102010,212102011},
    {212102011,212102211}, {212102100,212102101}, {212102101,212102121}, {212102110,212102112}, {212102121,212112121}, {212102211,212112211},
    {212110000,212110002}, {212110002,212110012}, {212110020,212111020}, {212110021,212112021}, {212110102,212112102}, {212110120,212112120},
    {212110122,212111122}, {212110200,212110201}, {212110201,212110221}, {212110221,212111221}, {212112000,212112010}, {212112001,212112021},
    {212112021,212112121}, {212112100,212112102}, {212112120,212112121}, {212112201,212112211}, {212120001,212120101}, {212120010,212120011},
    {212120011,212120211}, {212120100,212120101}, {212120101,212120121}, {212120110,212120112}, {212120121,212121121}, {212121000,212121001},
    {212121001,212121201}, {212121010,212121012}, {212121021,212121121}, {212121100,212121102}, {212121120,212121121}, {212122011,212122111},
    {212122101,212122111}, {212122110,212122111}, {212200011,212200111}, {212200101,212200111}, {212200110,212200111}, {212201001,212201101},
    {212201010,212201110}, {212201011,212201211}, {212201100,212201110}, {212201101,212201121}, {212201110,212201112}, {212201112,212211112},
    {212201121,212211121}, {212210001,212210011}, {212210100,212210110}, {212210101,212210121}, {212210121,212211121}, {212211000,212211010},
    {212211001,212211201}, {212211021,212211121}, {212211100,212211120}, {212211102,212211112}, {212211120,212211121}, {212212101,212212111},
    {212221011,212221111}, {212221101,212221111}, {212221110,212221111}, {220000011,220000111}, {220000101,220000111}, {220000110,220000111},
    {220001001,221001001}, {220001010,221001010}, {220001011,222001011}, {220001100,221001100}, {220001101,222001101}, {220001110,220001112},
    {220001112,220011112}, {220001121,221001121}, {220001211,221001211}, {220010001,221010001}, {220010010,221010010}, {220010011,220010211},
    {220010100,221010100}, {220010101,222010101}, {220010110,222010110}, {220010112,221010112}, {220010121,221010121}, {220010211,220011211},
    {220011000,220111000}, {220011001,222011001}, {220011010,220211010}, {220011012,220111012}, {220011021,220111021}, {220011100,222011100},
    {220011102,220111102}, {220011112,222011112}, {220011120,220111120}, {220011121,222011121}, {220011201,220111201}, {220011210,220111210},
    {220011211,220211211}, {220012011,220012111}, {220012101,220012111}, {220012110,220012111}, {220021011,220021111}, {220021101,220021111},
    {220021110,220021111}, {220100001,221100001}, {220100010,221100010}, {220100011,222100011}, {220100100,220100101}, {220100101,220100121},
    {220100110,220100112}, {220100112,220101112}, {220100121,220101121}, {220100211,221100211}, {220101000,220111000}, {220101001,222101001},
    {220101010,220121010}, {220101012,220111012}, {220101021,220111021}, {220101100,220121100}, {220101102,220111102}, {220101112,220121112},
    {220101120,220111120}, {220101121,220121121}, {220101201,220111201}, {220101210,220111210}, {220101211,222101211}, {220102011,220102111},
    {220102101,220102111}, {220102110,220102111}, {220110000,220111000}, {220110001,222110001}, {220110010,222110010}, {220110012,220111012},
    {220110021,220111021}, {220110100,222110100}, {220110102,220111102}, {220110112,222110112}, {220110120,220111120}, {220110121,222110121},
    {220110201,220111201}, {220110210,220111210}, {220110211,222110211}, {220112001,221112001}, {220112010,221112010}, {220112011,222112011},
    {220112100,221112100}, {220112101,222112101}, {220112110,222112110}, {220112112,221112112}, {220112121,221112121}, {220112211,221112211},
    {220120011,220120111}, {220120101,220120111}, {220120110,220120111}, {220121001,221121001}, {220121010,220121011}, {220121011,222121011},
    {220121100,220121101}, {220121101,220121121}, {220121110,220121112}, {220121211,221121211}, {220201011,220201111}, {220201101,220201111},
    {220201110,220201111}, {220210011,220210111}, {220210101,220210111}, {220210110,220210111}, {220211001,221211001}, {220211010,220211011},
    {220211011,220211211}, {220211100,221211100}, {220211101,222211101}, {220211110,222211110}, {220211112,221211112}, {220211121,221211121},
    {221000001,221000011}, {221000010,221000011}, {221000011,221000211}, {221000100,221000101}, {221000101,221000121}, {221000110,221000112},
    {221000112,221010112}, {221000121,221001121}, {221000211,221001211}, {221001000,221001001}, {221001010,221001012}, {221001012,221011012},
    {221001100,221001102}, {221001102,221011102}, {221001112,221021112}, {221001120,221001121}, {221001210,221001211}, {221002011,221002111},
    {221002101,221002111}, {221002110,221002111}, {221010000,221010001}, {221010001,221010021}, {221010010,221010210}, {221010012,221010112},
    {221010021,221010121}, {221010201,221011201}, {221010210,221110210}, {221010211,221210211}, {221011000,221011002}, {221011002,221011012},
    {221011012,221011212}, {221011020,221011021}, {221011200,221011201}, {221011210,221211210}, {221011212,221111212}, {221012001,221012101},
    {221012010,221012110}, {221012011,221012211}, {221012211,221112211}, {221020011,221020111}, {221020101,221020111}, {221020110,221020111},
    {221021010,221021011}, {221021100,221021101}, {221021110,221021112}, {221100000,221100001}, {221100001,221100021}, {221100010,221100012},
    {221100012,221110012}, {221100021,221101021}, {221100100,221120100}, {221100102,221110102}, {221100112,221120112}, {221100120,221110120},
    {221100121,221120121}, {221100201,221101201}, {221100210,221101210}, {221100211,221102211}, {221101000,221101002}, {221101002,221111002},
    {221101012,221121012}, {221101020,221101021}, {221101102,221121102}, {221101120,221121120}, {221101122,221111122}, {221101200,221101201},
    {221101210,221101212}, {221101212,221111212}, {221102001,221102101}, {221102010,221102110}, {221102011,221102211}, {221102100,221102101},
    {221102101,221102121}, {221102110,221102112}, {221102112,221112112}, {221102121,221112121}, {221102211,221112211}, {221110000,221110002},
    {221110002,221110012}, {221110012,221110212}, {221110020,221110021}, {221110021,221110221}, {221110200,221111200}, {221110201,221112201},
    {221110210,221112210}, {221110212,221111212}, {221110221,221111221}, {221112000,221112100}, {221112001,221112201}, {221112010,221112210},
    {221112012,221112112}, {221112021,221112121}, {221112201,221112211}, {221112210,221112211}, {221120001,221120011}, {221120010,221120011},
    {221120011,221120211}, {221120100,221120101}, {221120101,221120121}, {221120110,221120112}, {221120211,221121211}, {221121000,221121001},
    {221121010,221121012}, {221121100,221121102}, {221121210,221121211}, {221122011,221122111}, {221122101,221122111}, {221122110,221122111},
    {221200011,221200111}, {221200101,221200111}, {221200110,221200111}, {221201010,221201011}, {221201100,221201101}, {221201110,221201112},
    {221201112,221211112}, {221210001,221210101}, {221210010,221210110}, {221210011,221210211}, {221211000,221211001}, {221211010,221211210},
    {221211012,221211112}, {221212011,221212111}, {221221110,221221111}
};

/* given a int p, returns 10^p */
int zeroes(int p)
{
    int r=1;
    while (p--)
        r *= 10;
    return r;
}

/* true if 'turn' won, false cc */
int win(int turn, int terno)
{
    int magic[]={2, 9, 4, 7, 5, 3, 6, 1, 8}; //magic square: all directions sums 15
    int x1, x2, x3, t1, t2, t3;

    for (x1=0; x1<7; x1++)
    {
        t1=terno/zeroes(x1);
        if (t1%10==turn)
            for (x2=x1+1; x2<8; x2++)
            {
                t2=t1/zeroes(x2-x1);
                if (t2%10==turn)
                    for (x3=x2+1; x3<9; x3++)
                    {
                        t3=t2/zeroes(x3-x2);
                        if (t3%10==turn)
                            if (magic[x1]+magic[x2]+magic[x3]==15)
                                return 1;
                    }
            }
    }
    return 0;
}

/* print the table in a nice text format */
void printtab(int terno)
{
    int i, j, tab[3][3];
    for (j=0; j<9; j++)
    {
        if (j%3==0)
            printf("\n");
        printf("%c ", terno%10==EMP?'.':terno%10==XIS?'x':'o');
        terno /= 10;
    }
    printf( "\n" );
}

/* find and return the next board after the given board terno */
int move(int terno)
{
    int i;

    for (i=0; i<TOTAL; i++)
        if (suc[i][0]==terno)
            return suc[i][1];
    return 0;
}

/* return true if the position p is occupied in the given board terno */
int occupied(int p, int terno)
{
    while (p--)
        terno /= 10;
    return (terno%10!=EMP);
}

int main(void)
{

    int p, turn=XIS, terno=0;
    char op;

	printf("\nProgram: Tabled Tic Tac Toe! (TTTT version 0.1)\n");
	printf("Author: Ruben Carlo Benante (Dr. Beco)\n");
	printf("Email: %c%c%c@beco.cc\n", 'r', 'c', 'b');
	printf("CC BY-NC-SA 3.0 License ( http://creativecommons.org/licenses/by-nc-sa/3.0/br/ )\n\n");


	printf("What do you want to be? 'x' ou 'o'? ");
    scanf("%c", &op);
    do
    {
        if ((op=='x' && turn==XIS)||(op=='o' && turn==BOL)) /* human play */
        {
            do
            {
                printf("Type position to play (1 - 9): \n");
                scanf("%d", &p);
                p--;
            } while (occupied(p, terno));
            terno += (turn*zeroes(p));
            printtab(terno);
            if (win(XIS, terno)||win(BOL, terno))
            {
                printf("Congratulations, you won! {%d}\n", terno);
                break;
            }
            printf("Human played. {%d}\n", terno);
        }
        else /* computer play */
        {
            terno = move(terno);
            printtab(terno);
            if (win(BOL, terno)||win(XIS, terno))
            {
                printf("Congratulations to me! {%d}\n", terno);
                break;
            }
            printf("Computer played. {%d}\n", terno);
        }
        turn=(turn==XIS?BOL:XIS);
        if (move(terno)) /* more moves? play again, or else the it is a draw */
            printf("Now it is %c turn.\n", turn==XIS?'x':'o');
        else
            printf("Draw...\n");
    } while (move(terno));
    printf("\n");
}