JOIN
Get Time
long_comps_topcoder  Problem Statement
Contest: Marathon Match 93
Problem: CrossStitch

Problem Statement

    You are given a pattern which has to be embroidered by means of cross-stitch. In this technique, pixels of the pattern are embroidered with pairs of diagonal stitches that cross each other to form an X on the front side of the canvas. The shape of the stitches on the back side of the canvas doesn't matter. The pixels of each color are embroidered using a single thread (without cutting it between stitches). Individual stitches can be done in any order as long as all necessary stitches for the color are done eventually.

Your goal is to embroider the given patten correctly using minimal possible length of thread.

Implementation

Your code must implement one method embroider(String[] pattern). The pattern is a square image of S x S pixels. pattern[i][j] describes the pixel of the pattern in row i and column j: '.' denotes an empty space (doesn't need to be embroidered), characters 'a' through 'z' denote pixels of various colors. If the pattern uses C different colors, they will be denoted with the first C letters of the alphabet.

The return from the method will describe the points (corners of pixels) in which the needle will pierce the canvas for each thread color. Each element of the return is
  • either a single character which marks the beginning of a section describing the next color (the first section starts with "a", the second with "b" etc.),
  • or a string formatted as "ROW COL" which gives the row and column coordinates of the point at which the needle pierces the canvas ("0 0" and "S+1 S+1" correspond to the top left and bottom right corners of the pattern, respectively).
The returned stitches must satisfy the following constraints (see visualizer code for a detailed implementation):
  • For each stitch, its starting point must differ from its ending point (i.e. the needle can't pierce the canvas in the same point two times in row). Several different stitches can share endpoints.
  • Each stitch on the front side must be a diagonal of exactly one pixel.
  • Each stitch on the front side of the canvas can be done only once (i.e. there should never be two stitches over the same diagonal on the front side). It is allowed to have repeating stitches on the back side of the canvas.
  • In the end each colored pixel in the pattern must have both its diagonals embroidered on the front side in correct color. There should be no extra stitches on the front side.

Scoring

For each test case we will calculate your raw score. If your solution produced an invalid return (not all pixels were embroidered, some invalid stitches were done etc.), raw score for this test case will be 0. Otherwise, raw score will be calculated as follows. The total "useful" length of thread (i.e. thread visible on the front side of the canvas) L doesn't depend on your return and equals (number of embroidered pixels) * 2 * sqrt(2). The total "wasted" length of thread (i.e. thread used on the back side of the canvas) W is calculated based on your return. The raw score is calculated as max(0, ((5 - W / L) / 5)^3).

Your overall score will be the average of your raw scores over all test cases, multiplied by 1,000,000.

Tools

An offline tester is available here. You can use it to test/debug your solution locally. You can also check its source code for exact implementation of test case generation and score calculation. That page also contains links to useful information and sample solutions in several languages.
 

Definition

    
Class:CrossStitch
Method:embroider
Parameters:String[]
Returns:String[]
Method signature:String[] embroider(String[] pattern)
(be sure your method is public)
    
 

Notes

-The time limit is 10 seconds per test case (this includes only the time spent in your code). The memory limit is 1024 megabytes.
-There is no explicit code size limit. The implicit source code size limit is around 1 MB (it is not advisable to submit codes of size close to that or larger). Once your code is compiled, the binary size should not exceed 1 MB.
-The compilation time limit is 30 seconds. You can find information about compilers that we use and compilation options here.
-There are 10 example test cases and 100 full submission (provisional) test cases.
-The match is rated.
 

Constraints

-The size of the pattern S will be between 10 and 100, inclusive.
-The number of colors C will be between 2 and 20, inclusive.
 

Examples

0)
    
seed = 1
Size of the pattern S = 10
Number of colors C = 2
Pattern: 
.ab...aaa.
bab.a.aaa.
ababaabaa.
bbbbbbaaa.
.bbbabaab.
abababaaa.
.aaabaaab.
b.aaaaaab.
a.aaaaaabb
..baaaaab.
1)
    
seed = 2
Size of the pattern S = 100
Number of colors C = 20
Pattern: 
.....m....beeeeee.....es....j....o...r..ai.n....eeeeaeeceeeeeeeeeeee...k..p......k.......r..m.t.i..n
k..........temekeee..q.g...odeedieqeeeoeebheeeideqemseceeleeeeeeieee...........g...........p..r..b..
..j.........eeeeeeeea.h.o....eeeeeeebeneeceeeeeee....o..hkjjljm...l...............qc.ggg....ktpt....
.....p...f....aeeeerqbe....s.......iii.g....cpo..........qqbjjjjjj.........m......tgjrdp.i..ttlo....
se..h...g.......eeeeeetet..c.......iiii.o..........ppatt.qqnjrjjojjj.j.....e.kr..fggggggr.rltttt.hbb
....pb..........k.eeeaegte..i......hiiid..o........pp.....qqjjkjjfjjjddd..ffqiohfhgggirrf.c.tttt.bba
..t.bbd...qgggpggnckeeeeeeee...s...iitio..b....o..hppk....qjq.tjlledddddffcfffffgppggg...e.ltkttbbib
.b..bcb....gggglgnggggggggjeeen.g..iigi...c..ffff...pp.f...rqqflldddddifffe.hp.gpppgip..t..ttetbbbbb
.o.s.bb..g......q..ggjggggggjggggggiiii..i...ffffd...ppfffqrqftddddqjjjjjjehbhggppgg...rf..nitjbbbf.
.....bbb...d...rhhhhhh.i.snkggggkggggdggpgg..ffffffffpppfrrrqqqdddl..jjjjhmhjggpsggpn..ta.tttotbbb..
....g.bb.d...a.lhhrhhhsmhhhslseeebbgggggggggggffffdlffppbrrddqqqlk..lh.hhohcggppp.cll....rjtttbbb...
.fc..fbbk....l..hhhhhjfdhhhhhhgsfffffffffffhgogfjqfffffpmgddddqql...hmmhhpdggdpijlfll...m.tthtnbd.b.
.....f.bb..o..iimhmhhhihhhhhhhhhhjjjffffo..kge..hfffffkfdddallbqqgtrmmmmgggggppjjillcj.qeqttotb.....
..t...nbb...i.iiimt.e.htbhhhhhhhnjjjjlhhee..q.qq..ffdfifff.lllllqqggmmmmmmgappjjllllljjj.ttitb..t...
........bb....hiim......a.hhmhahijjjjhhhhhhhhmqqq.t.gpffofflkklhqqhggmmbmmmpnp.llllljjajjtttt.......
.....s..bbe.bmmcti.a...........jhjjjmjnhhhhhehhhhgdhhffffffcfllqhqqka.mmjfcpqltlolljjjjjtfttt...bn.r
..fk..co.sb...mmiii.c...n..r..l..ipjjnmhhhahhhehdbihhhhfffffqfrhhqqqmgkhmpppmlllqlld.jjgttkrjom.j...
......ii.bbi..mnmfak....e........ijjjjishhhhhhddddhhhhhhhtffhfffaamomgggmppmmlllplb..bbjtttrnqqjjm..
lk..s.ei..bb..mmmmii..aha...a......jipjhf.ssodddhhbhhhhhllffftfffamqqgggptsmmllldl..bqffoffsffjjojj.
.o.hh.gie.ba..mmmm.irjkrjc..o..nnnnejlj..lddddsqehhrhhhhllllfffffffqqqhpipmmlllelsffhfffbfafffjtjjjr
...hahhcii.ah.mmmmmiiiaamae...knnnnljdjjdddd..ossserhhhhmllhpbfffffsqqqppfkjllillffffjfffifffdjjjjjj
.....hhhiiibb.mmmd..pbicaaaa...nnnnnljjjgdnnnnnrssrlehhchol.pppfffffqqqpfkfllljlafffffffffeff.h.jjjj
......hhdnq.bbmmrmqdhiiaaaaaa...nnsnjjjjlnnnnnqbnrrrbhhhsleqspppfffffqqqffjlllhffffffftitt.....dp...
......gephhihbmmmmqqq.riakaaahd...dbfjjjjnnnnnrnnrrnehhhhhffbpbpphffppqqqjhlllllmjmmm.tttt....k.....
.sassiggghhhbbbmmmqnqriiiaaaaa..ddsdipjcjjnnnnlnffofkldhthffkfppfpppppfqqfddlllmbmmhmqottt....i.....
.sfsnssgoghhhhbmmhqgqcfiiiaaaadmdd.iiabijjffffffffjlllhhhhhfffpppfpppqfiqqffslllhmlmmmmqt......f....
ohq.q..ssggfhhhemmqqqflfigsgdddddfogffjjjjjffffefffllllhhhhffagpphgpqdbfqqqffbllbbmfjmsmt.t.....l..r
.i.s.d...rgcghhhhmqqnsfffiddfddfmffffffjjjjhmfffflllrllhnhhbagdapprdcdddbqqfffflb..jmmmmm.p.........
j....j..qrrgggbhhhqqqbskdddddfffffffforjjtjlffffclllllpbbhhmalblpppddddddhmrffffna..mmmmim....k....h
...l.p....krgggbhhhfffnqrbgfffffffqffffjjjjjhrbdellelgbdhhhqhdjppmdgddjlllqqqfffffnntmmmmmh.......pt
..........t.rmgfnhhhhddddfffffffmfffifiijjjdrhrekhhslegbahddnddppdjdcjlllllqqkfffffttprlmmmrm..s.qfq
.b..........k.mfhffhhhdfffeffimaaaaaiieijdljnrtlmllglggddlddddspddcpjllllllbqqfffffffttnmmmmmitn....
..............mjffffhhhbrdr..ii.aaaaaihhhjdjjbmllllgggkddddlhpapc.pjjblllsooqqkfffffpemnnmmmmmdhnnnn
...b..c........mmgggqqhhhrrkriiiaaallhhh.jjjjjlllllgddddidddhppcffjjjlllqsssoqqqmffffffanjmmamcqnnnn
..i...h.b.a....h.bgtgpqpkhhrcrggiaaiaahieejjjjllldddldsdqddcbphoonjjplllobsdseqql.fprsffgf.ommmmmnnn
.f...q.....o......lgccg.hhhhrrggaraaaakekrjsjjjmddddeldddccpphhhhjjhqkdaaaaaaafqjaamncfffef.mmmmkman
..d........e...q..blkggg..hhhrrgggkaaaaaerqjjddddaddddrcccipphqbjjjmbpaagaaataaqqmaaaffffffffaalmmm.
...j..........sssd.bbqggg..hhhhhhgggaasbaredddddddddocckfprbhhhijjbcclpphhhoaqqlqqtiaaaffffpffaammmm
......h.......shls.bbqqmgg..phhhhiggaaaaddddcjddddocccc.appbhhjjjbbbbapphhlhoqqlldqttss.ffflffd.mnmf
nd...m..f....assss.qbbqiggg.hhhhhhpeeadddddtddde..cccsa.ppbbfhjjjbbbo.pppihhoffmlqrqtsssl.fffff..mmm
.......q......jsss.mbbqi.kggkh.ghhhqsdfdkndddtbjmcccba.sp.bbnjjjahbb...iphhihs.ollqq..ssfqqffffpp...
...p..........lssssqqbbpiqhgggggghhhhddddddllacjccaaaopdl.nbnjjhthb.....pphhho..ppamq...qqjss.pplk..
.........to...issss.qbbhhnh.gggddhhhhhdddlllccctjjaaapppcr.njjoehhh.rrr.ppphhhitpptqkfffffffsss.....
..s.......h....ssstsqqhhhip..dddddddhhsllllccccijjaaappp..njjjshhhhrrrr.ddphhhffifgfqqqfqfffsss...f.
h......t.lt.d..qsssihhhr.jiddddhhqdddheqhccccajjpjjabtr..nnjjbbqphcrprefffffffffffffjqqq.....f.....t
..l.hjr.l.......fspshhbbbddndddhhhmrhglthlcjaaajjjjrppaannjjbbb.htffhrffrncfffttbpttjqqqqq..gi....s.
c.r...r...o......esesqddmddddddhhhhgrlccdhhhgaaojjpppraaajffffffffpffffdd.mpphqtsp.qqpoqqsq.......g.
...k..b....m.m..tsssddddddadddehhhhhhcanllthhaaajppfffffflflfffrfhhhhrdd...lohttppqqqkiqkqq.........
......b......phbgsddddddddddeeeehhhncrlggiphhhfofohffffffffbarrk.hphbbd...o.pptppqqqiig.aqpg..q...s.
.ffffff.....khhhddddddjddeeeeeeghhddhrffffffhhhhlffjaibojbbafabrmhhpddd.d...ppppqqjiiid.qqo..d...g..
.fffffffffffhrdtdsddddtreedergggfhhhhfffsffffhghhnjajddjjblriaacrrqhddr...o..ppqqqlii..o......cg.c..
.......fsffddddddddgdssfeffhffffehdhkhkgggmiiiphjhhjjjjjb....rgabahddhnlnb..rpqqqlok........r.......
.non....hhhdddddddffbffdfolfgjfqalhhnhitgggmmappahthjjjm..s....raadddhher...tqqqpll..q...m..b.ci....
.nnnnnn.hddefcmffffffafffesffgraalhhhhhhhgggmpphhashhhjg.......f.dddrhhhrrr.qqtplllh.d..............
....ffffffffflffff..sseeefefoaaamlchlhhhhmgnppnikaahhhhggs....k..ddthifhrpnhqtpppllh..n.....drp.....
....hfgffcfqqqqqqqq.lsssqgpnaaallllhhhhhhmmpgpgiibajjhhhgg.....fdddthhhhhpqqttppnlllh.e.kkkjqkkkkkkk
.........anqqqoqqqqrhssssgaaaahllbllhhhhffppmaggiijjjjhhhhgg..edhdttthhhqqkbttppspqlkkkkkkmkkkkkgkbk
........g..nnsqqqqqcqqqqkqaarrlalrbhhchhhfppammggjjjjjjjhhkggpqndtlcchhqqqtsmtppeflsckkk...k........
n........d..e.mbqqqqqqqaaaarrllldrttthhhjppamffggjjfjjjjjalggedhttttthqaqhthttbprilrhhm......g.k....
......i...m.....nnqqqqmasqqmqllpllhtthdfhhllkkkajjggfjjljaaffdddnprtpqqqhhttttpptrllhhhorjj.....g...
....q...p.......gg.naraaqqiqellllttttohhhsattntjjjftgkjjbjaffddffftrqqphhhhttnp...llphhrrrrr.k.....i
.......gt..rd..gg..aarsqqqmqllllqcttttghahrctttjjttkggjjjmaaddfffffqqqdhhhhmtpp.j.llphhhrrrrrr.n..e.
....i.........ggs.ata..ssqqljlllqqqbpnfhhhhnnnjjtmttggsjjjgerdjttgqqqdfhhhhfspp.m.elpphhrrirrre.....
.jk....fff...epgaaaq.hnnnnlltllqqqnqqpphhhhfnjjnttrltggjthjddktt.qqqiiifhhhffppfffllfpphsrrrrrr..tj.
.......ffncrnnnaaannndnnnnllllqqqqqqiipaihhhjjjdtttttetjibddaaatgqqttti.tttt.rpffffbsppfg..rrrr..r..
..b......nsnnngaannnnnjjslllllgnkqqppsaahhhhhjmmeebbfttpjkegaaaqhqttttfttttt.pp...fllfppfqtifa...j..
......f.....aaafff...jocllhll.o..bbppqaaqhhhqmmmerbbbb.njddjaaqdqtlgttttttspppst...la.pafffffffffffj
p.e.b..n..apac.sffff.jjglllsk...mbppnbeaqbhhhhqq..bbbb.idopjjqqqaktttdtlttthpptthttll.hpphh.nfffffh.
.........amao..g.qffjkfllllss...gpppnaajqnqhlhhqqq.bbbbdpdjjqeqaaairrttcdttnpettttttlttdptti........
...r...aaaa.........jjlltllkssrrphpbaaa..nqhhhhaqqqqbbrddjkjqqggabarrlll.pttpptntttlntttpptt..q...h.
......aaa......h...jejllllssssrrppprflrrrnrhpehhqftqjqdd.ijjjqgggaaabllll.glpp.htttlltttppktph...a..
.....aaa..........djjlflllsssssporraarrrrrrkhhhkqqqqqqddq.ajjjjrggaarlllfl.gppg....llhtttppth.....g.
mdsaaaa..f..s..q..gjlllllrrersppnrrsarrrrrrrhphnhqqqqdbeqqqjjjjrgggaelllollppggg.se.ll...tpph.......
d.aaa........c..h.jjlllc.qqsdpppddaafrrrrrrrrhhhfrrqcdqqtqqjjjjjrgggorrrarrpp.ggg.s.ll...kpfhh.d....
aaan.pfd..........jilkllkqqqdpplddaadbfl.....drhhhrdddqqqqgfjjjjrragggrtrerpbrrgkgrillrr.ihpph.mo..p
aa...j..o........jlllal..qgqppdddaadddadb..bs.hmhh.agbbiqqqqtkjjqqqrggerrrmpgrnrggggllrrr.hppih.g...
l.....f.....n..qjjcfll...eqqodddaaadqqdcdddid.hkchhd.bneiiihjjjjjqqqqgggrqrsperrrfggllrrc.odppp....c
.....t.t.......qjlplclj.tqpppsesaadddddddddddddhhhhk.iihkq..mnjjtqqqqqggb..pprrcrrrellrrr..rpphh....
dt...o.n.....m.qllllliqqqppplq.aaa...mrdddddtddihhhhkiirkka..jjkjgqcqq..jgpp.llllll.klgg..p.hhhhd...
.j...o.....mj.a.lomoqqqqqppqqi.aaq.a...bididddddhhhhdekkkf..qssjrjqqqqj..gppielllglbllglg...hhhh....
........ib.....lllllqqqqppqqqqaai.....tbbs...qddhfjhhbkkdmmmmmjjjjjemmmnmsppjmgmmmmmlllggcj..hml..c.
g.....p.......mllll..qqmppmqqqaamjqmmmmmmmmmamdnlhhphkmmemmmmmmjjjjmmmdmmmppmgfmmmpmljlsggg.ceoi...m
....aq..sq.b.lnlll..eepppqqqqaaammmnmmhmmkmmmmddmhhhhhmmmmmpmmmjjjjjmmmmmmppmmmstmmmllll.ggg...oor..
........jj...lfllf.eeeppnmqqmaimmmmmmmjmmjmmmfdmmkrhhhmnmmmmmmmmjjjjmmmmmmplmpmmmotrtlll..pggg.oo...
.........r.gllllleeeeppnne.qcamhmjnmmmmmmmmmdmdmkkhhhhhmmfffkdddgjledddddppd.....p...kll....ggg.oo..
j..........tlllklee.pppn...qaaq.qqqqqqqqqqbbdcikkkdhhehii.j.fffpdjjtjddddpprdddd.rq.l..ph...cgn.oo..
.....p.c...lllllee.pppg...aaaqqr..qkqqqqqqbddikkkmmhifhhig....frrtjbjddddhhoddddb...g....f.......ols
........k.lanlle..ppf.c....aaqq...f..tqqqqddjqpkmmmmhhohiie.e.dmrjjjjjmmshhdddddda..g.c........f.oo.
.......o..lllll...pp...sfsaaqqq......grqqdbnkiigiiiihhhhiiiidihrrrjejjdhhlpdddddd....sp....j..o..ooo
..m....q.llllbasnpp.f..ffaaaqqqq....b....ddkkiiiiiiidhhhdiiiiiirqrjjjjhhhppfi.q........tbi.s......oo
i......elllkl...ppd....ffaa.qqqb.......ilddkkiiiiriiiiiidiiiiijqrorjhbhlmfp......m...c.i.........koo
...f..eilllna..pbp.....ffhabqqqq.....mmbbkkkbbmpqqmmjmm........rktrhkhmmmtg......t.......p..........
...reeeellll...pp...c..jqfe.qqqqh..mmsmddqik.bb.faqmmfm........lrrhhh.rmmm....jn.p......r.b...q.....
....ee..llf...pp....p.kffff.qcqq.rimmrnkki...bbb...mmmmg...i..irrrhhe.j....n........m.....l...j...co
.............pdp....nb.ffff.qqqq.mmm.jcki.creks....mmmm....s......c........k.g.o......hgo..t...h....
......o..cp..opd.o.t...ffff.qqqq..itkkk......l...i.mmmmfr.m.....i....qj.........ap...........gq..ok.
....i.s........j..gsp..fftf..qqqdri.kk.bj........f..mmmp..rg....r.b...s..p...o.jn....l......r.l.r...
b.......n....bd.....a.dfiff......o.........hm.........s.p.r.fstssobssssss............klh..m..e..oor.
.k............ot....mm.ffff.qp..d.....g.rlp......sssssssssssstassssskssss...s.........l.eag........k
............i......s...fffe...fb..h..rsnsssssfsssssshcssspgss........................c...c..m..fp...
2)
    
seed = 3
Size of the pattern S = 99
Number of colors C = 19
Pattern: 
..mjjjjbqfjjbjjjj...l.srjddd...gs.r..hs...l.i...aq..f.......g...k.....o..i...bsesp.g..op.....k.....
..jgjjjjjjjcjjjjjdjjjjsbbbndii..a..s.h.........ln.jkkkk...............no..gi.soss...nd....rq...r...
...jajjjjpgkjsjjjijjjlrjjjjjioic...a.r.c.g....b.i..kokkakk..ck....f..........qsss.gs.prgg..........
.bh....k..jjjjjjjjagjjjjjjjjfjfhdjfj.l...hq..d.....h..kjkkkkk.....h..c...o...ssssr..se.b.........n.
.f.....q........jjjjjjnjjjjjjemjjjjjjjdjjjj....j..cm......kkkmnkr..hsc.g...eiidipiiii..q......d....
.j......e...p.....mmmmmjjjjjdjjjpjrjjjjpkjjbmrjjj.mmd..bnn...knkiqk.........iiiiiiiiiiieiiaiiih....
....e..d.d..ki...s.mrmmmmp.mljjjjijjjjjpojjjljjjjjqjjjfg..o.....kdkkkkoc.h.dssss.hm..iiidiiiia.....
..............h......mmmmipmmmcceciijjjljjcjjjjbjjhmjjcmpijjjjqqqqccjrfkfihqssss..gh..l..s...ifnf.e
............fh........mmmapormcfcccpiibb..jsjdjjjjpjkjjjcjjjjdjjjjjjj.kkksksskskm......i....ffff...
......f................ppplpmclcsajkilimgb.b..gjmjkjjjjkjjbjjpjljijjjjjjljjqassk.........k..fhhf...
..s..b...dk......fp..sppqppppmkccrcmmiiimmmb...him..dd.ijjjjjjfjijjjjjjjejjjjjjrfj..e.g.emsoffkf...
....n.rrrb....p....kpafppprmmmmcccccmmiiemirmmchmm..ddmmmm.r..jjjpjojdjsnjhjjjjjjom........frff....
......eb........kjjmppppprl.mmmmccccdmmmiiimmmmmmh.h.dbmmm...f.bbb.qjjjsjjjajjjjjjj...qq.b.ffff.d..
l.....rrc....k..jjjjdpppp.....mmccccddlfmrrcmmmmmmmm.dammm.....bbbb.....cssjjajjpjjd.qqq..ffffgc..r
k.d...rhb..l....jjjjjjsggoliil.mcdcscfdkjrriimmmmmammmkmms...g.bbol..k....ssssfsg..pqqq...flgfm.q..
......gr......gppjjjdgjlllolll...cccqidpdrriikmmpmmmmmgmmmel...bbbe..ssscsshssss.r..fq.g.ffffb....o
......orr...n..ppljjrjjdlllllga..ccccceeddrripmmnmmmlmrmmgmnm..hmsirsssssssssdjj.a.qq....ffff..pc..
n...gkgng.....rklfjjkkrlllllll...jcccceeddnrhmmibblmmmlmmdmmmmmsssssnssdsssssasn..qqrj..qffff......
...k.pggggi..o.jlllljjjjjjggg.....cccceeddhrrmeiigbkbbmdmmmsmmcmmmssssshssnndnn..nnn.a..fffffpgcd.s
....q.ggpgggl...clllljqdqjjsgg....cccccerddrhcmiini.bbmmmmjmmmmmmmmmms.knnnonnnnonnn..c.ffffbgrckc.
g...n.pgggggqh.o....m.jenjjogg.....ccrcndddrrghmeiiqcsmmmmbbmmmmdmamnnnnnnonmnnnnq.....ffffcphqccc.
...kecf.ggggmgg........jjjjdjjs...pcccrgbdhhrnhsqqmiismmmmbbbbbmmnnninnnnnnnnnnqqc..j..fffiqp.cccc.
..q.....rgggggqg.........jjcjjjg.seccrcpsshmrrsqgglcisgggbgggpnnngnrqnnnnlnnnmqqi....m.fpffppdccccg
......b.rr.lhgqggs.d......qjqjjjgggdggggrggfmcqgggggijiggggnnnnnnnnnbqninnommirif..n.nffpffpc.cecc.
.....s..rr.jggiggggqggcgcggjjjjjjggscggglgmmmrrgdmqmmmiiscnennnnnnjnqnnnmmmmfffffm..e.ndsfplllcccc.
...gggggsggogggeggdggggggnggjjjiiieesmcbchmmhrcrdbmmmdsnlnncnnnnnnqinabhgsfffjfmmmldlkofffllblcccc.
...gggggggggkggggggggsssssgssjjiiiiesccmchmmeqqrddnnnknnqbnnnnnnfsonbrgggffffqmmmmilpfeffollllcccc.
.........rr.....gggggggsssssksjiiiiigmiccmehqqrrnnnnnnnnnnnn.snnnnbggggffffbnlslllllpffcfjllllclcc.
.........rr.nalssqmggggossssssejiiisd.cccmshnnnrennnnbnnnmiiinrdllgggfffnqqdbolllclpffflsnd...elcci
.....g.ssosmsssssssggggggsms.eeeiiicbjjcmmmnnnnareninnmnnnniiiqlggpffffqqmsbnnlj..kaffhf.....fcccc.
n.....sssssssmssssssggggjfgmbbeseioiiijjlmnkepghrredmmqnnnndiiiggffffbqbqsdbln.rappfffqf..r...qccq.
kj...gsssssssssss.o..lgfgggmehedeliiiiljppninnnhrroammnnlmddbggffcfbjjqcmd..enjn.pgfdff.i.e...cccc.
jhjm..fssses..a.a...lsnggaggeeeennjiiiiijjbknlnkrrfmlnmmmimgrfqff...jjsssd..nnbbbifffjfl......cccc.
.njjj.....cra.....qssssogggeenqnnnnnaaijfsjnnnnncrmmmqmmmmfjfmfigi..jjsssd.rnn.rggfffc..c.....ccri.
...bljl....rr..efisdshlllgnnnnnennnniniiifjjnnnnhrmmddmmgffffmmsmiiiqgssle..nngggbfomf..ma....cccc.
d.n.rjj.o.hpr...essslllnnhhbnnnnnngejiiiiijjjnnnfmmrqdmffffddemmmmiiimsdb.o.nggbpfffff........cccc.
.....jjlg..frr.ssssbnnnnnhghnndnngcehhiiiiijsjnnmmmrbffffidcdffmmmqiiisso...ggglpcfffb........acac.
....h.jjjj.kr.ssdnjjnannndhhhngggggadmminieijjjjmjhfjfffmmodjpfc.mmmiisso.gggnrpfalfneb.n.b...cccc.
dd..s.n.jjj.rrnncenlnnnnnsnhhhngginggimkiisiijjpmffoffrmmmdfffccccmssssghhhhhhpplffiabbb......cccc.
.........ejnfnnnnnnsnqnneennhhh.ggggmmqq.liibimffaffrrmmlmffhcdccjhhhhhihhhhhhaaffcfa.bbbb..d.ccacd
.s.i....nnnpnnnpnfngn.heeensqhhhigggomqq.hiiibfpbfjhrjmmmhffahhhghhhphhhgmkanmafdfffd..qbbk...cccc.
..a.kb.nnnndnecnno...cheeennnnhhhiggmmqlgniiffffgjjjrpjhhohhhogmdpdssgggbbphnn.ffffa..l..bb...cccce
......ennnhnnqcb..qhhheeeennndihhsimmqggijlfffghihhhhhhhhshqddgdrbssgggbbbbmanfffffa..........bccc.
p......ndnnnooeobohhh.eerfnqan.ihihmmqggffffaahhfhnohhhmfmbbddddrasggqakbsbmhpffffaaf...r.....ckcc.
pa.k.h....iooooooosh.eeeee.nnpcfihdhqhffffhhhhhhhijqjjsfggbbbddddgggispbbbbmnnffffa......s..m.cccc.
pk.......ppeooqdooofheeeej.nncnphhhhnffirhhmciiiiiijjjjkjmmaaaljooglsdpbbbsanffffcgg..g..n....fiqc.
.....a...ppppoaooooreqeaeohhhhhhhhbfffgngkmmkkkiiiifljjjjnmmaaqgggssqpppapaaaffsfjh..d.i...h..cccc.
.qb........rpprdoooehhhdhhhhhhhhflefhbhnidmkkkciiififjjjjjjimgggmssssppaaaaaflffbccjk.........cpccb
......r.....pphhhlmhhhhhhhonaqfffqggghhhamf.gcocmiihfhlpjqjjgggddsssslaapaaaffffqccccji......ecccc.
.h......bdhhdhahhkhheeeopkkkfdffggrgoihhmmik.kcccbiiiiojjjjjjgmmdssscsaaaralfflfffffffff.j....cccc.
oa....smhhhhhhrpeppiklkkkkfgffngngoooonhhhiikancgkiiiiimjjjjijmmssssaaaaaabfkfnffffmffffgfffdfffff.
......i...dlkckckpppkkkkhfjsbggggmoooommhhhiikcffciiiiiireojjsjmssssaeaa.bbcarf...roccmcqffnffffff.
.......p...ikabgkkppppffhffgegnmmhooolmmmhhhiiffccciiiidrrjqjjjjssdgmaaddlffqff..jo.ccccccccb.crcc.
.mncs......k..ggeeeeppfff.ggqgjmmaaaammgmihhhffcdccoiiiiirrjojjjjjsnmdpdddjfffn.rj.s.icccccdccncccb
kimccgbg......gaeeee.pdppggiicmmaaaammm.olihhhkcscccoibiiikrajjjjjjmmmdddffrffk.a.......ccccjscc...
.cceic.a..kk..ggeeeeo.bpppaanmmmpccqmna..ppfhhhqpcccseiipiiranjpjjjjlmjadfffink...e..p.g..ccksccccg
.ccobc......b.ggeee..gggppgainmlncmmopnsm.fffhheekcccririiilraajehjjjmmmdffqfsk.....m.....sccccclca
..mcpcc....ag.egge.ggggaaaappmmnfghomnn..fff..hqqcccakhiioiirhssjjjjjjmmoffffnml...ee......p.cicccc
...ccqkck..ggeegreggegq..l.ppppnnjmgnn..rff.co.qsgccckkhaieiiesssjjjjjjmffffdnk...m.......nmmmmmmbc
.njacccs...gqeeqgqgeqqq....qmpppnmrmnn.fffj...gqshhcsckhhikiiisssljjjjmgfffkdncc....mqmmnmmmmmmmle.
s.ddccccc..mogegggrqqqq...nqkmppkpminnpff....jgqqhhhcaihhciiiiissjsjjjjjqfnmmrjmmmfnmmmmmm.lllhl...
..dd.knccc.geeeeggrqqqq.jsqhmmlnfrp.nfff....ggfqqahhdcrihrliiiiipgidjhjjmmpmmmmmmmmmnnn..lllll.mf..
..dd.flcccieeeeegmrqqqq..qqmmnnmmapkpffj..gpga.qqgcnhscghhkibiiiigmmdmmmmcmmmmkddodninbllllg..i....
pkgd..ccjceeeee.ggr.mqq.rqqmm.lmmn.pppjpagggp.aaqqkchchihhkkmrmqmibmmmmdjjjjjmsjnnnnnlglalfn.g.....
..ddh..cccqgrds.gggr..smqnmm.jscnnfeppppggc.aagaqqccrqmnmmmmmmmmmmggddffjjjijjdmmmkillllc...j..k...
..dl.l..ceeeeb..oghrs..qqqnm.hmqfeffl.pprhjbaaaaqqopnhmmmmmmsskiiiigsifdfjnojjkmmllkolagof.....al..
.ldd....sdree....hgr...qmmmenmmhdffn.agppppmmmjmqqemmmphhphishsiiiiigdd...djdjdjdalld.gg.....l.....
.lsd.....eeeec..pggf..qqqmm.mmnfffnnmmmmpmfpmjmmqq..hbcadhhisippiqiiikp.nnnjjjijjlmmmdgn..l........
.gdd....resegcc...grr.qm.mmompfffnfnmmmgmmppipjoqq.qpcbcmhhcssssiiiiikknnnnljjijjjgmmmpga...c..n...
..dbbbbsbbsbpbbbcbggbqqrmmbhmfnfsnnngbbbbbbapcpjaq.ppmemmdhhhsci.iipiikkngllljkjjjjfnmmmg...a.e.pe.
..dcbbbbpbrjsbblbqggbbqbhmmlfffnnnnbbjbbbbb..lpppjpkpmcimohhhsjii.iiaiibllll..kjjjjcjmmmm......s.h.
...dd.d.fhhohhhhhsgghl.mmmmmff.noenafaaaa....rrkpirnemmmmdihhhhilmniiiiillk...nnjjjajjmmmm..m......
g..dd.o.hhhmhshhhhhgghbgmmmffhhqnnlaaka.b....s..pppppmmmldshhmhhiridiiiiikbgk.ksojjjjjjmmmm..fsff..
.srdc...m...eccncc.gghgmkmffhhhnmnnfhrhhhhhhhhq.pppppmmmmashhshhhllkiisiiikkcbkn..mjjjjjmffffffff..
l.nde..n......ccccqggrmphmfgggadnnafifffhhhhnhhhhahhahhhihrhhk.hhhleniliiikkkkkk.fajjjjjmffffm.jr..
...dd...jo..d..cccnqgimfmjgggaabsnnnfffnfff..fhhhhfhhlhhhhhhhhhkhhhnnniiiiiekkkkm.ffjjjcjnfmmmm....
.o.dd.........e.cqnqgmmmfgggaralnnnhcsaffgffaffhpp..dmlnmshhhhchnahennnieiirhhfhhhhhfjjjjjjmsmmm.o.
.a.dd.........f.cjqqgmemgrraaha.qnnqmmmmm.rfffffffdhbmmmmllqhhcnnnhqhnahmiiiiakhhhhh..jjjbjmmqmmm..
b.fdd..qg.labpebqekcgmmggbsbaa..nnnn.lpmmmmme.fffkfffmmmmlmlhhnnnnnrhh..iniiiimkkkkik.s.jjjdmkmmmm.
p..dr.......bqbbbbccmaggn.g.j...nnnn.q...mkmmmmfq.fffffffsspnnnngon.hhhffieiiiknkkkbkkk..ggedmmmmm.
...dd.s...a.pbfbbbbmmmg.....s.c.nnnn.j.r.r..mmm....ddfoffikfnnnnqfffmnph.oejeikngkklkkkk.gg....pmmd
...jdm....a..bbbbbfmnbg......b..ennn.o...e.e..q.....qmmmnfffffffffffi.hkiddiiiigggekkikgkghg...m.dd
....oij....cafqabfombcci.d...r...nnnnq...o.aqb.....kqmmnnapnlafcfff.gb.hmhdqiniggkggkkikikngh...pdd
....rd...bj.qqqqfmmmabmab.....k..kenn..l...j.......smnnnfnlnjnnnkffffff.hhhj....gggggknkkkek....kd.
....dd....d..qqffmmbbbbcbbbr.....nkdnpe...c.c...n.ffnnnhnniaannn...pfffffhah.....gggggnkkkkkkk.bddo
....fdk.....qsffmmmqobpbbbbkbjm.nnnnnrih.....adfsfnnonnnnssjcmknd.qa...nffhhhf.f.fggggg.kkkkkkbds..
r...da......qfffmmmmj..blbbbbbb..nnnn.ognd.ffffffnnnjnnnsnsaea..jch.......lhhcpskd.gggggd.rkkndd...
.l..dd.....qlffa.mm....gbbbkbbbbbnnnn...mfsanff..nnnbmsssssaaa..d..........dhhhfgqfffggrg..kddjj..m
hhhhddhhhhhfffhhhmmhhh.gg.bahbbbhbbqncfbifj.h..a.nnpnmssssaaael...........sgdhhh.offffffgk.gdmsk...
hhhkdqqkcbffbhhfmmhhhphmg.i.bbbbbbbbbnff.n...nn..ah..mssnhaaca...r...k.....gdihhh.i.fbifhofddd....p
hhhhddkhqffnhhnnqdhchhibnh.b.fbbbbbbdbb...g..........mssdjaaoa....p.....n...dd.hhhbn..ggffdgdgb..ri
hhhgddhhfffhhhhjmmhhhhh.ggfbafdcsbbbbbbbb...p.b.r.....smckjaaa....k......g..dd..hh.....gggddhfll..c
....dp.fffq....j....m...gggfl.....bsbbbbbb....q..g....bqs.amaa....bg....nh..ddk.dlfdc.s.gkdigg..d..
j.ce..qfrqsb.h..........gglg.....lnnbkjbbbjb..s..q.....k..aaaa.....h...k....spd..i......lldggg.....
.j.j.fffhq........e.ig.p..fj......nnnndobbbbbg......bcek...raa....nhr........ed.l......ddlgggg....l
.k.rcfol..o...............s........nnn..bbbhbbbb...f.....j........a.o...k.i..db.....c.bdd.c.agg...c
...fmfi.....j.b.......r.piq...r......r....bjbebsbb....fb.....q..........m...m.dd.....and.....gg....
.o.ff..pks.......j....d...e.....e...hb.c.p.bnbbbbbbbr...d...........q..e.g..s.dd.j...ddk.....bg....
o.l....g..m.........cdf....clsg...l..m....e..bbbbbebb.....g..q.........i......dg....dgd...h.jgg.k..
3)
    
seed = 4
Size of the pattern S = 52
Number of colors C = 13
Pattern: 
i..ala.......j....h.bf....g.l..ed.eddddm...a...l.gg.
f....iii..f..f......f.i.......a..ijddddmk.....f..l..
.....iiici...g.h....j..ikkc...j..ldddddh.bl..l......
...ediijiii.....k.l..a........h..kdddemme.h.d....b..
hhhhhkiiiiii......jlfgb..e..ah.i.ddddcm......dg.d...
hhhhlh.iihiiii.h...c.i......m...adhddme....i........
jde...f.iiiicii.k....m.e......fdfdddfmm....l..g..i..
dd.a.i....iiiiii.....i.jj.fjag.dddddmmm.......cf.ggc
bdc.a...a.iiiiifii..aaeeleeeckdddddejdmeeecc.fegggcg
dd.kieeeeeimmkibiiibjaeeeeeeggldcdmmmmlceeceggggjggg
ddeebheeebiiefaibiiceaaeceeegdjdgdkmmmeeeefhgkgcgcgg
fdeeeeeeebiieekiiiiiigcfeeegdddgdcmkmaeefggggggggmef
ddaeeaeeefiieeeeiiaiiiaa.gjjmddddggmggkmgggggcgekeeg
dd..d...gcii....m.iiiiiaa.jkddddfggggmmdgagggaaceeee
dd.......eihf......ieigaak.dhddgggcgmmiggagaaeeeeek.
dd....mhgeiie..g....mailaadaddgglcbmmmgd.aaheaieakj.
ddbbk.e..edie..c.e...iilidddgggggmmmeggaaaadddike..e
diccb....jihj.df...fl.cgidilggggmmmbkjjaadddddee....
ddicjjge.eiiee........lbdggggjjkhmmglaaaddcdce......
dhbbccccceicee.......gggigggggbmemmeaadhbdcce.......
kdebb.ecmkkieeggbg.ggigdgggggfmmmaaadhddfbgcb.......
ddcjbcc.ekkkjgggdggggcglgglfcmfmaaddddgggggg...f.b..
dacbhcccg.gkkhggkgggmggkddllhamagdddeeieggggg...ei.i
dd.bbdcccggkgkklgggggjjkdmllllddedicibedlhdggg......
aaadlbcgiggjggkkkgggdjjjdmllhldimmiidddcdddgggg.....
aalabgggggggkggdkkecdjhfkjlalldmmmddlddldddfggci..kk
mabgkaggggggggckhkkkkdjjjjjllllmdgggagmdfecccgggjkkk
aaaaaaadgcchbfcmhekkkfijjbjjgggggggggggkiimc.gckkkk.
ddaabaakimccdlccb.damhmdmdgggggibggjgigiihccd.kkk..g
ddgeaaaahaiccccccddgagggggmggfgggjgghgiiiidcikkkcccj
dlggaaahaaaaccamggggggegggggggggmjaajkjcccckkkkccccc
ddlkfbdajagiggggggggcggegggggjjlcccbccchcckkkkbbbhbb
dg.jmgegkgggggggggcgagggddikhjmlcciccccabbkkbbifbgbb
id..gglggggegggglggaddhdgccckllalbbbbbbbbbhbgbjjiib.
md..ggmgggggcggcgddjddmeehebbllllbbbmbbc...ccjjjibil
ddgbbgggggdmddcdddiddbbbbbbkbllalieeheeeeiebcjjiiiih
fdbhhdhhdiaddjddbdbbbdbhhbaeglllleeeeeeeedeeejjglmi.
hdhhldmdddddiddddbbbjceekebeeelllbeefeeeeeeeej.ag...
dfbdddbdeddddkgeaakaacbaccdeeeefeeeeeegebekelj.dl..f
.dddddaigddfggkgeeaaaaaaacmkmmjbffkkkkkbkkgkc.......
.jdddgkabgiiljggeeeaaaaaaaafmmcibbkfkkkkhkekki.....g
..ddddgjgggijjjggeikkaabaaaameccccg...kkkkkkgkkk..f.
gg...jgggjiijjjeggikfkaiafaaaacccjc....gjkkkkkegklkb
....lejgjafjl.aagfgkkekdaadaaaaccccee..jjjjkkkgedkkk
l...jjcjjj..g.aaeggdebkddmmaaaaaacgfccjjjjacckkkckkk
....jjjji.i..f.kbkggkjmdmmmaafajiacccccjjd.ac.amkmkk
...g.k.h........eekmgkdimmfiaaaaifaaaccchjmcc.kjcgkk
l...k..ff...i..l.edggkadlmmmmmjmmmmmmgjmmc.jc....h..
dmgfg...........mmimmmmmmmbmmmmmmmmmmmmmmjcccmmmmmmm
...bmmmmmmmmmmmmmmmmmmmmmmmmmmmmmaiaaacccccmgmkmmmbm
..l.mmmmmmmmmmmmmkkkkkmmlmdmmmmmmhahaajcccccckf..c.g
m....c.....blb....kkeg...a..h..ag..ikjj.cccccjd.....
4)
    
seed = 5
Size of the pattern S = 83
Number of colors C = 13
Pattern: 
mkaga...e..lab...gl...h.bfm.b.c.e....j...l......a..j........h...b..............d...
..aaaa..j.ic.......kf.....e.j....a..iie.....k...g.a.....f.....h.....jee............
..aaaaa........d......b..ik.k.......lgg.......i.......am.......ib........g...fgh..j
.ahaadaa...kd....ec..........j.......d........gcj..............a.........g.....g..j
...aajaa.b....jj........m..f...e..c............lg.g..m.................i....ilj..jj
.f..aiaaa..e.f...jk.............fd.mhh...bb........c..f....ab...d......h....bh..jmj
.....aaaaa....a.f.i..b.............hhhh.c..........d...f...k..l....mjjj.bh..aa..jj.
....k.aaaaaie..f........b..........hlhh..d....a.....l.......b.m..f.jjjaggi...m.fjjk
.....caaaia....bbl.e......g.....g..hhhh...k..cl...m........haa...jjjk..ge.e.dc.jj.c
k..jl..aaaea...bebfe.........ei.l.fhgbhj....i...d..hl.ie.gaiai.jjef..i.gg..ic.jj...
dg......aadaa..bbbbbh..j..........mghhh...h.........g.al.kaaaajjjch..k.ge....jji.h.
l...i..f.faaaa..bbbbie............mmhhhh.....bd..ce...cc.aaaaaj...h....gg....ga.e.a
.........daaaaakbbbbbee.h..e.d.b..emhhhh..f.....b......gaaacajk.m....m.ggg..jjj..h.
.h.mm.f...aaaak..bbbbbe...g..c....mmhhih.........fm.b.gcaaaa.bm....aid..ggc.jjd..f.
...k.......aaaaa..lbbbbifk.....b..mmeeah...f.....jg...kagala..c.e.h.a...kg.ejjm....
i.f..c.jjj.jaaaaaddbbbfbedkddidedmmdhhhhddddddddfffdjjjkkkkdeeddddddddddecjejdddddd
.....a..a..dcaaabkdbjabbeeddlaammehdlhhhadddddddfbjabjakekkgkkdfddedddddggdjddldddd
i..g...ddd.dkaaagaddbbbbbeedllmmmmmddhhhhddadddkfjfjjaajkkkceeddkgddddddggglddddded
.......dddd...aalaa..abbbbe.dlmbmmm..hhhh.....fhfjj..alikkkceellll....i.jggddd....c
i......dddd....aaafa..bbbbbbbcmmmmm..hdha..ccjffddd.aakkmj..cemlll......lggdddhhb..
.ff....dddd.d...aaaaa.bbdbgee.mmmm.m.hhkh..jjffiddddakdjkk..eecllf...f.jiigdddhhghe
f..h..kcdddgbl..ajaaaa.bbbbgeeimmdijc.hhhhjjjffcdddaakkkkk.eeeccm......eeicdddbh.j.
..i..hikdid......bhaea..bjbbdebmmmb...hhhhj.bff.ddagakkekbleeehceh..a.jiibggdhhia..
....f.hedddla.....aaaaa..bbbbbecmmm...chhf.lff.aldaakkkhkbdeellcc....jmikgggdhhgi..
.......mddgm.......aaaaa.bbebbemmmd.bjhhhh.ff.b.haabkkkk.lbeel..ccgggdiigigddhhgg..
.g.f....dddd.a..a...iaaaa.bbbbbmmefmjjhhhhmffjaa.aaakkkkllkeeggmccdgjiiigggkbhhg.b.
.k..e..addddd.k.m...akgda..bbljmmmmm...hhhkf....aaakckkggckeebgdgcccjfmggghgchd....
...i.l..dmdd.........akaaa..bgbmmkmm...hhhhf..maafakkkkgggcbebbgggajgik.e.gggld....
jk..j...dddbmdb.cf..k.aaaaafibemmmmm...hhhhmikgcaakkmekegkkeebbgk.eiii..accgggd....
..j.....dfldmmmm..am.dhbaaaajbbmmmmmh..khjhgggagaajkkhmddkeee.bbc.jaij...cjggdd..k.
........dfadmmim....ddgaafaam.mmbmmmmlghhhggggaaahkkkfhdkkeeggbbbjijicb.fc.ggdd.e..
.....d..bddddcmmh..ddd.jaacaa.mcblmmmlgdhhhhgckaakkkkbmdfmaembgbjmeimcccca.ggddd..l
d......b.ddddmdmmhdjdejjjaaaaadmbmmmmmhfmhhhiaaaakkkkedkkdee....jii..ecceahgagdd...
......lf.ddfdmmmmddjjbi...kaeammbbmmmmgfhhbhaaaakkkkkldfkdee...jiih...cch.mhmgdd...
m........ddddmmmmmjeji.c..iaaamm.mmmmillhhhkaaaakkkkl.dkhdem...jdibb.cccfcahggdd..i
.e.....b.dddd.bmjbjjhhha..maiaaadgmmfmbliihhhaajkkkk..kkddee.mjiiibbccc.chh.madd.h.
.a...b...ddddbjkjj..gbgeggggaaafagmmhmmiiiehhbakkkkfhkk.deeefjjii..bcc...hh.ggedlg.
.ke......ddddjjgamm.kgggigghkleaaa.mmmiiibhhhalkckk..kk..ee..jii...chb..lhhcgggb.j.
...f......dddd.mcmmm....f.ehhhaaamakmihibhhhhckkkk..kkk..le.jiii.fcccbb.hbcccghdd..
e.........ddhf.mmmmj.......hahaahilmiiibbhhhhldkkk..ke...ee.jii...cc.bbcijcjcglhd..
..c..c..l.ddddjjmmmj.........ahihdfiiimmahlhhhfkkk.kkkkg.ehjii...hc...kibh..cggdd..
....ed....bkddjjdjjdj......b..ahhfiiimmmbdhghhkkaf.kk..bbeeiii..ccc....ibhi.cfgdd..
.fc.....ljfddfjhj.ij......b.a...hiiimmbmbbhahhkakmkbk.bbbbeiia..gc.b.chhbdb..ddmd..
m.ea..a.jjkddddj.bj....m.......biiehmmmmbbhhhhkk.bakbebbeemii..cc..i.e.hbbbi.ljgd..
.c....jejjjdddd..h...i.........diihcmbmmmbhahhkm.kkkbb.feeiki.ccc.hhh.hdhbjb.dkgcd.
...b.jbfjjjdddi.........e..k..iadahhgmmmmbfhhhh..kgdb...eei..acchhhhh.hhm.bb..ggcda
cl...jjmjjhdddd.d.a...h......eeffgmhammmmhhlhhh.lkhbb..jlei.hcchhmhh..ha..cbk.ggdd.
.e...jjjd..flddgc....d...j..iief.agaamhimmkhhghbkkblkl.jee.gccchh..m..hle..cbbggbdm
..c........ddddk...f......iiifhfgggaabmmimkhhhhbkklllljiaehccch......hhf....bbbddd.
....lggb...dcda.....gh...iii.mfgigaabamhbmkhhhklklllljjieehfcddhddeddhhdddmddbbdddl
b..j.ggg...edddd.....c..iii.fffggghabhmmmmkkmhhkkj.flbiebecc..d....m.hhd......bbdll
..b...ggg...eddd.....g.iji..ffgghaaaaammmmmihhggll.mhhbecbbbbbbjbbbfbb.......dbbbll
.......ggm..hdddk...leaiig.ifgggmafaa.hmmdmkhhkll.hhhiiemmbbgbbbbibbbbbbbbbjbbbbbbb
.m.j....ggggdddlfgbfjiiiggigggggaaaa...meammbkkhhhhciiieibmbbbfbbebbbblbjbdbbbbbbbb
.d......jggghdid....iciggggggggglhaielkmmmllkkhhklhjii.eebbkbbbbcbbaedbbfbbbkbabbbi
.......c..ggdddd...miikggfgggighaggfkkkkmmmmhhhhhkkiiakeejjlilglllljjhbbbbjbbbihbbf
.....h.e.g..jddkd.eiie....ggbgggggggggghmmhmhhlckkijikkeekckkkbkmllljjckmjjm...lllb
........f...fdddilhf......dggggfggggjgggmmjmhkhhhjiijjjeekkkkkakklllljjjij....lllcl
.b....fg.....ddmdii......gjggaaagggglghfmmmmkghhciijfhjjjjjjjjjmlklll......da.ledbk
...a.a....b..dddmg.gjjjjjkjjjhdaabbbhdhlhmlmmgggiicjjjjj...h....elljg.....a..llllld
..fk.........dcddggjjjkjjjjjjaaagbhhhahglmmdmgggiig.........f....dhkkkkkkhkk.hilldd
......k......ddddbbbgbbbhbbbbbbbhhhjhkkkkmmkmggiiigbbbbbbebbbmebbmbabbbbbbbjllllldd
......l.a..b.ddddbbbbcabbblibbihhhhkkgkkbmmmmmgaimgbbbbbhbbbbbbbbbblcbbcbbbblllhdcd
..a..bh.f.....ddd..gggggggb.hhhhf.j.kkkkkkimmmcihhhkkkckkkd.....hlh.....a.illllldld
g..ce.c..f..b.......ggggggdbhhh....jkhkdikmmmiiihhh...i.f..h.a.ehcd.l......lllf.ddd
.......j....ab......lgggmbbb....a..kkkklhkmmaiihlhh..d........f.hh.b...idb.llllf.dd
.......c....i.....hlggggbbcdg....k.kkkkbk.mmiiihhhh.m.j...jk...lhh......ballll..bdd
....g.i....dj..c..bggcfbbbi..j.....kfklkkg.mie.hhhhh........e.c...g.g....fllll..dcg
..jk.....cgl......lggglbbggg.h.h...lllmk..jii.chhbhch......j.......c...h.lllll..ead
.e.ga...b.......j.ggbabb.aggg...kd.lllhb..ihh..hihbhh....a...b...m.khddf.illl....dd
......a..........ggbbb..l.gggc....elbkk...ii.b..hhhhch.b........gdm..ff.elllj.j..dd
.a...............gbbbg.....hgg.ba.e..gk..iiia...ejhhejjj..fje.g...f.lb...dll.c.e.dd
......a..b......hbbbg......i.ggg....kk.jebik......hhjjkjjj.c.......fef........m...d
a.i.l......j...kbbbg..m......egie...kk..ii...f.a...hdjjjjjjj...........h.........c.
..e.g...k.e..kbbbggg....m.e....ggg.lac..ii...i....e.ljjjjjjjjk...dcg...........e...
..gd.d..f.....bjgbg.g...........jigkk..i........k.g.hhhaljhjjjd...j...c......hd...c
......k......ffggbl...i...k..m..gbkbkf...............hhhhljjjjjjj.....b....c.......
j..k........iggggg.....g.h...a....kkg.k......i..cg..mhfchh.ajjjjjjl........d.......
l..fe..d....gggig.ikkkkkkkkkkkkedkbkg.................hhhhh..jijjjcjjd...m.i...m...
...j.......ggggg...kckkkkkkkkkkikkkkkkkdek.ibm.....a...hhfg.fb.jjjjjjjj............
......l....gggcg...kkkkkkkkkkkkkkkkkkckekkkkkkgkkkkkkhfhhhh....khbjdjjjjj...f..d...
.........f.gggb..k.dkkkkkafkkmkkkkkkikkkkfkcbckkkkkkikkdkkkkkkck..jjjjdjjg.......mi
.c.....d..lgcg....bm....k....d.chkkkkbkkkkkkjkkbkkkackkkkkkjkjdka...jjcmdli.l.m.c..
5)
    
seed = 6
Size of the pattern S = 34
Number of colors C = 12
Pattern: 
..biblc.ke.....b.....d....al...jbj
...i..lbc.i.e......h.g.....i..a...
.....l..d..fd.lhg...h.h...klgk.g..
cd.e..e..l.e.kll..lj.hl.kkkkkd..g.
kd..g.eaf.jblcl.aedca.kklkkkaki...
.h.e..ck.l.llldel.aaafkkkkkkkjdg.h
...g.....kldlddfijaikkkkkkklll.hdf
..c..ii..lll.ddddkjkkgkkfcllblffff
....jjjjjbjjjjikkkkkkbkklldfc.fffd
.i.kjjejjbjjjkkgkkkkkkdiaaddd.ffdf
ki..jcjjjllcjkkjkkjkhllaaaddcffcaf
l..f.jfjdlkkkgklkkhell.abadddhfff.
...blel.kkakakkkddlkllf.aadddffffa
.a.bllkkkkkikhdddbiic.jjjadddfaff.
a.lfldkkkbkkkjdddiidhbjdjjdcdfffa.
.lll.gakkhkdjldddi..h.jjjjbhdaba..
.ig..kekk.jjgdddgh...hjjjjkddaaah.
.d....c...jjidddd.ch...jjajdbaaba.
.l..i.bi...hkddddjjdfe.jjjjjjlaaf.
d....b...ckkiilicjjjl..kjgjbd.i..k
ja.e..g...ciiicidjjajjk.jjcje.e...
...bk...iijkiiiiafljjjjj.jeije...f
..i.ij.ifiiiifhed.jjejijajjfj....b
..ag..iiiiiiiiddd..ajjjjbfjjlj.j..
gigf.iaiibiiiidid...ijjhjjjjjj....
i...iiiifiiielddd....i.gejjlblk...
....iiiiiiii.addd.e.k.a.jjjjjjjeb.
..ef.jikiiijf..l.........hjjjkjkj.
.i..liiijgh.e....i.....c.h.ejfjjj.
..eiliibic..j..bc.......c..cejjdj.
..kkiilik...j....ejg....bk.fhjjj..
g.ieidd.ljb....l.........e.....h.f
diiiieg...c..g.........l..i.da..i.
.iikij...k..d..i......l..a...k..c.
6)
    
seed = 7
Size of the pattern S = 98
Number of colors C = 4
Pattern: 
db.c.b.....aad.......d.c.....ddd.......dc...ddd...d.....abb.....a.cbd.b.....a.c.....d.d.a..acc....
bcc....c..bcc..dac.d...db.a.dddada....b..ba..a......d.abbbb................dc..d...cdc...c.ad.d.a.
bb.............dc....b....c.cdddd.b...ac.ab.....d.d....bbbb.c.d.a.......ab..b...a.....d..c.a..c...
bbc.d.c....b...aa...aa..acd..dbddddc.a...bbc....c...cd.bbcb....a.a.......a.....b....ac........a..b
.bba....a......aa..........b..daddd.c.c.bd...aaaa....ccbbdddddddaa.ab....d.........a.c......dbd...
.bbb..c.a......aad.bcba.a.bc...dddd.c...bbb.aaaca..bacbbbdcdddcdddddcabda..b.............dddddbcc.
.bba...c.abb.d.aa.b..b.c..a.a.adadbdb.c.bbb.caaaa...ccbabaddddddddddddddddbdddb..dacc.b..baddad..b
..bb.....bbab.aa..d..a....dd..addddc...bbbbb.baad...acbbbbdddbddadadddddddddddddddddd.b..ddddbb..c
.abb...a.bbbbaaabb.d......dd..cadddddbbbb.ccdaaba.d.ccbbbb.ccdcbcddbbddddaddddddcdaddddddcbddcd.c.
.abb.....bbcbcaa.a..ab....dd..aaadddbdbbbcadbaaa....cbcccb.ddddcdddcdcddddaddddddbcaddcddddddddadd
badbb.b..bbbbcaa.....a..b.ad.c.aaaddddbbbc.baaaa..b.ddbdddddddcddddabddaadddaaddcddddddcdddddddbdd
bbabb.a..bbbbbaacdbccc..d.cdbbbbaadddcbbbc.baaaa.bddddcdaddbdcdcdcddddc..dacaaabcabb.dddddddcdddcd
babbb.....bbbbacacddcccc.bddbbd.adaadababcaacdddddadddddddddddddbccdc.....aaaa..abbb....bd.ddbddad
cabbbbbbdbbabbadbcdcccccccdabbd.aaaddbbddddddcdacdddbdddcdddcabcbacc......aaaa..bbab.b.....dddd.b.
bbbadbbbbbbbbbdccbccccccccddccbcdaddbbbddcbddcaddddddddcac...dbdcccc.c..a.aaaba.bbbb....c..daddd.d
dbcabbbbbbabbcbcbcccbccccaddcadddabdbbddbddddddbdd.bbbcca...ddddbccdcd...ddaaaa.adba.....aaacddd.d
bbbadbbbdbbbbcbbccacccaddbdadbddddddbbdddddddabcb.ccdbccdc.adddddbccdc..dddaaba..babc.bccadadbd...
bbba.bb.b.dabbbbdbaadddddcdddddbdddbbdddddaaaabb.ccabcccdcbdddadcaccccc.dd.baadaabdbaaaaa.bddc.c.b
bbba.bb.c..dbbbddddddbddddddddddddabbcdddaaaba.bbdcdbbcccbbcdddaaacccccddd.aaca.baadaaabd.ddddb...
bbbbbbcbccddddbcccccdaddbddddbcccccbdcccdadaabbabbbbbbbbbbbddccaaa.bccdc..ccaaaaacdab..b..dddd.ba.
ddbbadabddddaddacccccccdcdabbbcbcccbccccccadabbbbaddbbbbbddddbdaad.cabcca..acaaaaabdbbd...dddda.aa
bbbbddbbddbddddbcccccccdccbbdbcbbdbaccccabccd...abcabbbccddddc..ca..cdccc.adaaaabddcacdccbadbb..b.
bbbbdddbbddbdabbbcccccdcbaccbbbbbdbbbcccccccacd..cdbbbbcddcdd.cdda.cdcddadbaaaadbdddaacddbdddd....
bbbbddabb..acbbbd...dcccbbaccccbbbbbbddccccccccccbbbbbdddadd....caaadaadaaacaaaabbcddcbbbbdddaca..
bbbb..cbb.aaabbdbc....ccccccccaccddbbddddccccbcacccbbbacdcdc..a.badaabaacccbcaccbddddbbcbbdddd..a.
bbcb..abbb.aaabba.......dccdbccccaccbddbddddcccccccabbdddddca...aaaaaa.ccccbaaaacdbdcbab..ddbd....
bbbbd...ad.aabcbbb...b.adcbbccccccbcacdaadddcdcccacccbddddccc.c.aaba.a.cccddabacaaadcbb...dddd....
bdbbdd..bbcaaaacbb.adaa.dd.bbbccdccbcccbcaddddddccccaccdbbccb.dbddaaa...ccccccccaaaadbc...dcdd.ca.
aabadddbbdbaaabbbb..c...dd.bbbdbbcdcccccccccdddddbbcdddddcdccc.bbd.aa....acccccdaadaabbaaaaddbc..b
caabadd..bbaabbabb....b.dd.bbcbbcccccccdcccaccddddbbddbddcaccc.ddbbba....cccccababaadbabaacdd.....
b...d.dd.cbaaadbbbb.....dd.bbdbbbacccdcccccccacccdbdadddcbccccccbbdcacc.ccccbaaaaaaaaacadbadd...b.
..d...bddcbaaaabbbb..d..ddcbbbbbcccccdaaacacadccccccdddbdcccccccbccbacbbcccccaaad.daacaaaaddd.c...
......cddabbaabbbba.d...adcbbbbb.caccccaabbcdaccdcdcccddd.bacccccccccbbcbcbcccaaaadaadac.bbdda....
...a....daabaaabbbba.d.dd.abbab.a.ccccccabbbcccccccccccccccccdccccccccccabb.ccaaaadacaaa.dadd..b..
.........abaacc.bbbb..dad.bbbba..cb.dcccccbbcccccccccccccccbaaaaccacccdbbb..cdaaabdaaacaadbdd.c...
b.......cbabbaa.bbba...ddbdbbbb...a.accccccdbcccccccccccccccccaaabcccccbb..cabaaaadbbaabaaadbac..b
d...b....dabba..bbbcc..ddbbbbb...a..addcccccaaacccccccccccccccacccccbbdbb..aaccaaadddacbaaadd.c...
d..cb.dacaabdd..bbbb...dcdabbb..b.d.aaaccccccaadcccacccccabccccabcabbacbaaacaaaaaacdddcaaaacb.....
.b.....caaaabb...bcdc..ddbbbbb...dbbabadccccccadddcccccccdacccaccccccccaabaaaaaaabcdddaaabadd.....
.a......aaaabbd..bbbb..dabbbbbbcbbbbbbddaccbcbddddddcbcccccaccccccddccccaababbbaaaadcddbaada.....b
........daaadbdb.bbbb.ddabbbabdbbbbbbacbbbcacddadddddcccbccccaaadccccccccccadbcaaadddddbadaabc....
.b......aaaaabcddbdbbbbdabbbbbbabbbbbbbbbbbcaddaddcbddccccccacbaacdacccccacbccdaaaabdbdbdaaccc.cc.
..cd..a.aaaaadbdacbbbbbbbbbbbbadbabb..dbbbbbdaabdaabaddbcccccdcaaaddbcccccccccccaaaddcabddaaaaa...
..c..d..aaaaabbaddbbdacdbbbbbb..bbb.babcbabdbcdcdcdbbddaaacccccccadabdccdccccccccacddddbddaaaaad..
......dab.acaabb.dbdbbdddbbbbbcbbbbbbbbbbbbddddddcccdcdaadddccccacdaa.ccd.cacccccccbcddcdddaaaba.b
a.d.b.cac.adaabd.dbbbbdddbbbabaddbddddddbdbadadccdccccaaaddddccccccdd.ccc.aadccdccbcccccddddacc...
.....b.aa.acaadbdddbbbdd.bcbbbbdddcddabddddddddddcccccbcddadddabccdccc.ca..adbbdcccacccdcccdb.....
..dc...caaaaa..bbccabbbd..bbbbbbbcbbdaa..dddddbcdccccaaadaaabddaccccccacd..aabbccabacccdcccdc.d...
.c..c..aaaaaa..bbcbbabdd.dbbbbbbdb.bada.ddddbbbbccccdaaacabaddbdbdcdcccccd..aabdbaaaccacaccccccc..
...bc.aaaaaaa..ccccbccdddbbbbbbb...aaaabbdddbbcccdabbdcccdaaaddddccccccccddddabc.aaadbdccccdcaccc.
...d..aa.adaad.bbbccdbddaaabbb..aa.caabddcddbaccddaaabcabccaddbdddcccccccdd.abbdaaacdddcddccccccca
.....dcaaaaaaa.dbbbccbbacccdcc...a..bbadcddccccdb..baabbddccdddbcdbcc..ddddddbbd.badcdadbddc.ccdcc
ad...bca.aaaaaabbbbbbbdbacbcccdc..bbbcddbbbcabdaaa.aaaaccaccbddbbdbcad.ccdddddbb.adadddbdddbc..a..
..d..daa.caabbaabbbbbcbbbbcccccccdcbbdacddcabcbaaaaacaaaccccccddddddcd..addaddbb.daadadddddccb....
....aaa..aabacaaabbaacbbbbbaccbccccbadddddcdbdbcaaaaaaadaccccdcdddddd...cbddddbb.abadddddddcccd...
d.d..ad..aabbbbbabbdbbbbbbbabccdccccdddddbabbbbdaacaaaaaddcccbcccbbddd..cdddddbaaaaaddddcddccaaa..
.....aa..bbdbbbbbbbabbbbdabbbdbaacccddddccdbbbbaacadddddaddcccbccdb.ddbdccddddaaaaaaaadcdcaadaaa.b
....aaabbbbbabbbbbcba.bbbbabbbbbcbcaaddddacabbb.aadddddabb.bbcccddbb.dd.cc.daabaaaaaaa.dabaaaccc..
.....aabbbbabbbbbdbbadbbabcbcbdb.adacddcccccacbaaaddcbdbbbbbb.cccbdb...bccaaaaabcaaaabaadadbcdccc.
...bcaabccbb.bdbbbdbaabbbbbabbadccdbdabcdccacccaa.bbbaadcababc.bdddb...dcaaaadbbacaaaaaadddcbcbcc.
abbbabbbccdabbbcdb.cbbbbbabcbbbccdddaddddcccccaaaccbbaacbbbbdb.dddcdb.dbaaaaddbbacdaaa.ddddbbaccbb
bcbbaabbcacabbbbbd.bbbbbbbbabccacadcddddd.accdbaccccccaaabbbbaadaddadaaaacdddbaaaaa.c.dbddbbb.dcc.
bbbbab..aaabcbbb.babdbbcbbb.cccdddbdd.dd..cbbaaccccccabcadbbdbbbaddaaaaa.daaaaacbbaddcdddabcbd...a
bbdbda..aaabbbbbbbcbbbbbbcccdcddddddcdc....abcdbccaccdcccacbbcbbbbbaba..aaaaaddbb.aaadadddabb.b..a
..d.aac.aaabbbbbbbbbbb.bdbbbcddddbddddd...daaaaabbcacccabaaaabbbaaaadaaaacacdcdbd..aa.ddddbabb.d..
a..aa...aabcbbbbbbcbbaaadadbaddccdd.dda..d..aabbabddbccccaaaaaaabaabcaaaddccdddbb..aa.ddddbcba..b.
a..aac..dbbbbdbbbb..abcdbddddcddddbbd......aabbba..bcdbba.aabaaaaaccbcddabaadddbb..aabdbdbbbba.dc.
...bac..bbcbbabbb....bbdddddddabddbba.....aaabcbadbddbbba.acaacaaccabddaaaaaaaabc...aaddddbbdbb...
...aa..bbbbbbcb.b..ccdbdbcbbddddcbbbbda.b.aabbbbbbdd.bb..cacdaaccccdbddaaaaaaacaadd.aaddddabbba...
...ac.dbbbbbb.....ccccac.ddddddcdddbbad..accbbbbaaa.bbbbabaaaaccca.a.dddaaadaaaacaaaaaddddabbb...b
..aabbbcbabb.b..accc..bbcdbddddddddbdbbb.aaaabbbaaa.bdaaaaa.cbccaaa....dddcaaaaaaaacabaadd.bbbb..c
b.babdcbbbba.c.cccc...bbadbadcdddcddcddaacaaabbbbaaaaaaaa..cccaaaaaa..dddddddcaaaacaaaaaaaadbab...
.aaabbdbbab...cccdc....abbddcadbdddddddbddaaabbbcaabaaa..cccabaacabdabddddb.dbddaaadcaaaabaaaab...
..ccb.bbbb.bcdcd..db.dddbbddddcd..dddddbcdcddaaaaaaaa...cca.a.aaaaaaaaddddb.ddbdbb.ddacacaaaababad
abaa.bdbcb.dccc.....cddbaddddd...dddcdbdddddddaaaadda.cbcc....aaadaaaadddbbbddbdab..abdaaaaaacabaa
cbaa.bbbbdccc......adddbbbdaab.dddda.baddabddadaadbaaccc...a..daaaadaddbdcbbcdddbb...ddddbaaaaaaba
bbb.bbbbccccb..c...cbd..bbddabbdddd..aaaaadaabaddddbccc...c.a..bdaaaaddddcbbbdddbb..bbdddadadaacaa
....bbbdcc....c..d.dd.dbdbddbbbc.c.aaadabaabccddddcccaa......a.aadaadddccc.bbddabd...dddddbddddbdb
..ababbba.c..a.c..dd.b.dbdabbdb.aaaaadaaaaaaddddccccbdddaaba....aabacdddaaabbdddaadddaddaddbdddddd
...bbbb.....c..c.ddd..dddddbbbbaabaaaacaadbbdd.accdddadadd....b.cacaadddaccaddddabdddddcdddddbcca.
..bbbdb.....ddd.dbcbaddddd.abbbb..baaaacabbbbacbc.bddbdddd.......aaadddbadddddaddbdaddddcdbddbab..
.bbbbb....bb...ddddddddddaabbbbb..aaaaa.dbbbcccdddabaddddd.......aabadbddaddcdddddcbdaddb.ab.bbb..
..bbbb...a.cabdbddddbdbbdaa.bbbbaaaaca...bccccada....aaaa.d.bdbca.dddddddbadddddacd.bdadddaaac.db.
bdbbbda......dddda.adabddddcbbbaadaaaa...ccbbbbddba..aaaaaa..ddddbddcbddbddddddd.bb.ddddac.ca..dd.
........b....dd.ddddddddadd..caaaadac..ccdcbbbbbdd....acaaddddbddddddddddddccaba.daadddd...da..dc.
.b.........ddddcddddadb....aaaacddaa.acbc..cbbbbdddc.ddddbdddddacddaddadcd.caaaaadc.dddd..ccaa.dd.
..b.a....a.ddcdadacdddab.ccaaabadaa.cccc..cbbbbbbdddddaddadddbddccdddbaa.a..daacabb.dddb.c..abdbdc
..........ddc.d..cdddd..caaa.adbdb..cb....dcbbddcdbdddbddddadddccddddddaa.dcddacaabbdddd.....dadd.
.d...b...caad.cc.dddd.caaac..caadd..a..a.cddddadddddddddcdddcccc..ddddaab...dbdddbbadddd.a...acbdd
..d.....bcd.dcddddddddddddcddadbad.d..dddddbadddbcdddddbbbcca.c.bdddddaaba..dddcabbbcddd.....aacdd
.dd.a...ab.dcbdbdadddddbdccddbdd.d..aaddddddddddcddcbbbbdbcaaab..dddc.aadc.bdddd....adddad....abda
....c.cddd.ddddddddddddddbdddddd.ab.dddaddcddddbbbcccccbbbbbad.a.dddd.aaaad.dddb..c.ddddd.....aadd
..db..dad..ddddddddabddddbddcdd......dddddd.cbbcabbcdcbbbbdbaa...cddd..daaa.dddc..ccdddd.bb...dddd
..ad.bda..a..aaacd........aaabd....d.b..ddcccaccc.dacac.bcabca.bdddd...aaaaaddda...ddddd...a..aaad
...a.dd......aaadd.d..d...aaba..a.....cbcdcca..c.....ccc........cdddbaa.aaaacdddc...dddbd.c..a.bad
.c..dd...ddcddcdddbddddddddbddcdddddddbdd.......b.d..cccc...aaa.dddd....aaabaddca...ddd.......b.ad
..ddd..baddddbddddddddbddaddccdddddddddddbdbdddadddadddcddddddddddbdada..aabadac.c........a......d
.cddcc...dddddaccddddddddddddddddddddbdddddcddddbdadadddddddbddddddbdbbd.aaacdddd..c....c......bbd
7)
    
seed = 8
Size of the pattern S = 49
Number of colors C = 20
Pattern: 
.es.r..i..l.dt......m..era....n.ddddi.....g......
....kkk...g.dom.....j.rrrr.....nkapd...g.g..bdr..
...kkkk..c..ip.a......rrrrm...h.kdcd...h....rtqpi
...kngk....rbb..jjjf..rrrrjap...csddddd...h.rra.m
...kkkk..bnibbliiciiiasrr.t..g..kdldddmd.j.snn..f
kktmkkkkkkmibriiiiilnifioiiiin..kdddend.rp..nl.nm
ktcikkrkkkkkbliijqjjjdiiiiqiikigiijiiiiicpjjqnkkm
kcckkkkcktkibnijjjskjjceeljjjjgiiiiriigiajjnnrkjj
tccckepccccibbjhjjgjjjseeajmjjftjjjjjjjbjjjnesjjj
..rpikkhceccbhkjjjjjjtfeetqbnjjjjjjjjbjlornnrrcjh
..oknnkcnccccstcjjjmjjjremjjgjdeqdddfddjrrnnrrjej
ggjknfkcccccclbccqhldfrpeeppppppkddddddrrnnnrjpjg
ggotakkgggcccbnoecllllseeftqpppppir.dmhmrchsrjjk.
tgbkkkomggrggbmccclllekceeepepmppppimmomrnnrrjmmo
ggggdodogdgjgbbcaarlnlcccfogmprpocpmmgmmnrljrhkm.
.mtofooooggggbbaakashfmaceeccebpppmmtmmrnnlrrmmh.
.....okdo.ieibbbhaalillcjebccccccjmmamlnnnlormmfh
.b...ooooo.kiicbasjblcarbeecdeccmmmmjrpnnlbrlmdjn
jdq..loooookkatbaasslplnnegcklcmmmkmrpjnnfcglmmg.
.r.i.kkjkookafbbarrro...ffdndcmmimmpciikplccsbiji
k...pccohooomtbbrarttttttttttmmmfmcggcnacfrcccc..
l...likqooobaabbtrkttotdttttmrmmmlgmgnocggrclacc.
...igkgaoojahabbmgrrtktttttnmmmlrgggcnnccjirlrcc.
.t.d.cdjkqaaaarbbirpfhsssrrrmmrrgrg.qstddjrrlll.d
.....akjtaaacfibbrrptsggdprgglngggjjjjgdadcrlls.i
.pi.iiiisiiiiiibkaggpgssgggidjgggojjjlgqdaaalol..
....iciisiiiiiibbiiminiiiifggigmijjjjbjppamaalldd
..s.mibiiiiiiiibfciiiiiiqipiiiiiiibcpiiniiaaadll.
ccsggiiiiiqiiiicbhiqiisiniiimoiiiriiipionaaaallgf
cggggaaaaagdgggbbgiiikgiiaiiiiiciidiqiiinaoaallll
cglgaaaaaggddoobbrhrrrrrjnoannigqiffiipiialaarjll
jgreanaaajjjacrorrrtermsnnmnbntqrmrrbrrppraaaalll
cjjjakapjjjjjbjcrrrrfjffflfffffffffffcfffraaaalel
hjjjaaajoljqjjerrrrrifffffftlffjpoffffffblaajsbdl
.nbeeeteelrjhgrlrrrjffofqfqfffefftffifffffgaaa.q.
..rpeeskjgeeeqerrrjnnffoffffjhffcfnfrfffnhaaaaag.
.rraarkk.jgeeejefqcfennnerrjjtjjjjqmdimprr.akaaj.
qraiarkk.rrrrrrjttckeehhceegqqqqqqrfqddprrjiaaar.
crjargnrrarcrrrnnnntnhehleeleotqqqqqmddmrr.iaoa.p
rmob.kkrrkrorennkfjnishggcrrtteeoqoqqddmcnhaacas.
rraa.krrrcrrnhnncmeihhi..ggrrfttlooooddtmq..akaa.
rrr..glrirrntnnnnibthhi.sh.rdrtttomooodbmde.taaa.
rrr.rrrrkmnnnnnndbhch.e...i.rtmq..oooqmmddegaaaag
c..rrrlrrnnnnnkdqcht..q....prrnr..eohomnddggasbse
j..rrrrnnnnnnnddhjh..tn.....trr.abrfoommdgggmbta.
...rradndnnnnckkjhkbkkkkkkkmkkkkhkkt.nmmbggggqia.
lt.skbnpfnngbl.ji..p......a..ieejs....sooagg...jg
.j..nqnknngbp.hih.k...trbhe...rrhf.th..nooo..sl..
....nnnjntbb..hd..e..sh....d.ferr.......oao....mp
8)
    
seed = 9
Size of the pattern S = 55
Number of colors C = 9
Pattern: 
.....d.cd.i.a...d..................f......aaf.bed...d..
i.d..ccdcdcc.....d...h.aa....gh..c..e..deaicih.........
.....cacdffcfffhc...h.h.i.ee...bgc.i.e.bdieiif.e......h
aa...fabfeffbfdfhcccccc.eeecdea......ibdbiaa.b....c...a
f......bfbfhdgfi.iebhgchccceee...giiibbba.afhd.g.......
...b.d.bbfffifffgd...iegccdcaeeaihiicib.c.aai.b..ddgh..
.c..b.bbbcfciffd.c.a..f.geeheeeeeefeaeeefgaae..a.dcc.df
..ib...deeceeeeggediegeaeefeeeebbcecaeeebeea..i..dd...d
c...hb..eheeeeefggfeeedeeieiiidcbiicceeebgaig.ggifdhhed
h.....dc.bacffeffgighedeiichb.ibgfacebeb.ficf..a.ddfddd
.ca..fbg..bbcffffcbabgaiibbbfgafbfhceebe.ghcceb..dddfaf
.dg..bc..idbccfgfdibggg.bebbafdbccaaeeeh.geiceiedhdfddd
h.bef.h..c.ihcbieiiieigggdibdbbcbcaabefa.gaechbdddddidh
...e.i..ch.cihiiiihfff.egbdbcbcfcchgeeeh..eeccdddddd.d.
....gb.....diaigbfifeff.bbbbdaiic.iegefhe.deccdidifdf..
dd...gbec.h.bcegc.hffffbibbbiace..ieeeebhheacdddbdbd..d
fb.f.....a.b.cihfcfggffbibbabac...eecaehccdddcfd..dd.d.
hdb.c.cd.....cccbfffffbbbbfadhcic.eeaeehacgdfggci.ddg..
.bb.c.h..hc.g.chffef.begggiabca.iieaeehhifffeffccaede..
..ceh..e.a..fbeeefheibghggdaaaa.aiiedefdfbcfffibcbdggc.
eebecggbd...hhfhfcfibbggggfheaa..iicecffdfgfhfccdaaigi.
c..babggg.hdhdecffbbbbgcgbfhcab..fedeefffafccdcccadddda
.e..bbbhghhhhhcfffbbbcggdahcffiffeeeefifbgcgceaceeedbd.
g.a..bihhhh...daabfibagefggdffdffeeeeficccbcaegcfeedda.
..g..gbhh.ddaiccbcfbbbggggffgffffeeeecccdccccdgcccedfd.
.e..cgbbb...fbbbhffabbeggdafdffbeeegehhidccdcabgacedddd
.....hgbgaeiahbaiffbfgggfifgiffdeeebhhbdd.ebgacgccgfad.
f...c.bgbb.bbb.afdiciggggicffaceeehehhcibcacacchhbedde.
gi.ihiiggbbbiegafgeffggggfccebfeeeeghhffhhbcccgchcdddh.
h...igiiggbb.hfffffffgbgbcdccieeigdfhhbhidfecccchhhdcd.
.c.fifiidbbfgffbfffbfgegggdccbbeaeehhhiffchhcbhghaicdb.
c..afibbfffffffffffcafgdgigdceeeeiehhhiifhhbhhehhhhhddc
ab.eifbfbafbifgfdgacggggggggcedeeeehgifehihefhdehhdedd.
....agaffefcffaccchbgggidgggceefeeehaedhiehhhfhghceedd.
i..bbfaffifccbcebbdfhgcgfiahaaiaeehgiahhihhbhhhccchddda
...ebccchcciccagcabcgggfgcdideeeeefhhehhhhhhehfdcdeedf.
.hacecfcacafaahiibbeggggabdegceifehhhhhhhbhgeeicgciedd.
.cccccecccagaaabbbfffgbgddcdeieifbhhihahgaeieeafccfeded
.hcfcfciigg.cchifaffdggbgdheeeefhhhhhghii..ebhfhcachedd
.eccgbiiih.chhbaffgaggggdcddbehfhhchhiicdehahhhhhccefhg
e..cggiiiiccchhgfffdggf..ceehhhhhhhfhe.hhhehhd.bfchbedi
...eggiiiiccfccgffggfgg.cedhhhdbhihaeahhbbbbegihcbbefdd
.ahiggiiiiiiccgffffgcdb.feehhhhhhhhhgbibbdbbebbiddceeda
.ggagg.iiiiccfggfffeggghiaehgiheghhhibbdiag....dbh.eifc
gagigf.iiic...ffffffghhheefhfceefhhhee.becihi.cdddbeedd
ggeg.i.iiii.edddfdghhbheehheeeeebhhbfeh..h.e..ebbbbiehd
geg..h.iicibagdafchhihhegfbheeccahhhcefh.biebbabbbbeefd
gh...cd.iafh.daacihhhhheebbeeeghhhhhbbcccbbbbbbbbbheecd
......c.ibiaaaaihhhadhc.bbbeedicdhhbfadfbbfecdbbbbded.c
ggghdgfeieaaaahcehhhgee..fbeaieccbbffcffbbbbbaidahceeid
fgggaaebdaaigcdhffgghibfcccieeccefbfffgfbb..i.dd.d.ef.d
idacfaaagciiigbbbbabggbbcfieeecbffhfffffd.....dhe.hhefh
gaaahgcicbbbbabccegggbbacceeedegcffffee....b..id..dch.h
f.ebgfaibbbbbabbabbbbbbcecefeeebhfefieg..i...i..haced.a
dcbbgbbbbabgbbbbbbfbgggccceecfiadbi.de.be.e...h.a......
9)
    
seed = 10
Size of the pattern S = 84
Number of colors C = 2
Pattern: 
..ba..b.......bbbb........b..baaabaaaaaaaaabbaaaaaaabaaa...b.b..abaaa.a.....aaaaaaa.
a....b.....b..bbabb..bb....aaaaaaaaaaaaaaaaaaaabaaaabaaaaaaabaaaaaaaaaaaabaaaaababa.
bbbb..a..b....bbbbbaabba....aaaaaaaaaaaaaaaaaaabaaaaaaabaaaaaaaaaaabaaaaaaaabaaaaaab
b.....ba..b.a.bbbbbaaaa.....aaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaabaaaaaaaaa.b
...a.b...ab..bbbbbabaaa....aaaaa.....a...........b..b...aaaaaaaaaaaababbaaaaaaaaa..a
b....b.a......bb.bbbaaabb.baaaa.........b..........aaaaaaaaaaaaaaaabaaaaa....ba...ba
......abb.bbabab.babaaaaa..aaab.........ba....aaaaaabaaaaaaaaaaaaaabaab.a......b....
.b.....bba..b.bba.bbaaaaa.aaaaa........aaaaaaaabaaaaaaaaaaaaaaaa..aabaa.....a.....b.
...b..abbbab.bb....bbaaaaaaaaa......aaabaaabbabaaaaaaaaabaabaaaa.baaaaaa.....a...a..
.......abbb..bb.b...bbaaabbaaaaaaaaaaaabaabbbbabaaaabbaaabaaabbbabaababab...........
..b.a..aaaba.bb.....abaaaabaaaabbbbbbbbbababbbaba.bbbbababaabbbbbbaaabbba.a...a.....
...baaa.bbbabbab..a.abbaaaaaabbbbbabbbbbbbaababbb.bbbbbbbabbbbbbbababbbbb...a.b...b.
....aaa.aabbabb....baabaaaaaaabbbbbbbbbbabaaaaabbabbbbbbabbbbbba..aaabbbbb........b.
...b.aaa.abbabb...aaaabbaaaaababbbbbbbabbbaaaaa.abbbbbbbbbbbabb...baabbaa.bbb.a.....
..b..bbaa.abbb..abaabaababaaa...aaa..aaababaaa...bbbbbbbbbbbbaa.abaaaabbb.bb...a....
...a.baaabbbbba...aaaaaaaaabaaa......bbaaaaaab....bbbabbbbb..aaa.aaaabbabbb..b.a..aa
....ba.ababbbbbbbb.aaaaaaabaaa....ba.aaaaab..a....babbbbbbbb.aababaabbbbbaba...aaaaa
b...aa..aa.bbbbbbbbbaaaabaaaaaa...a.babaaaa.b...abbbabbbaa..baa..aaaaabbbb......bbaa
b.abbaab.aa.bbbabbbbabaaaaaaaaa...aaaabbaaaa...bbbbbbbbbbba..aa..aaababbbb.bbbababaa
..bbbbbbbaabbbbba.a.bbaaaaaaaaaa.baaaaaa..aa.ababbbbaaaabbb..aa..aaaaabbbbbbbbbbaaaa
..bbabbabbabbbbbaa...aaaaaaaaaaaaaaaaaababaaabbbabbbbaaa.bbb.ba..aabbbbbbbabbbbabaaa
...bbbbbbbbbbbabbbab..aaaaaabaaaaaaaabbbaaaabbbbbbbbbaa...babaab.aabbbbbbbbbbbbbaaa.
......bbbbbbbabbbbbbbabaaabaabaaaaaabbbaabbbbbbbbbbbbaaa....bbb..aaabbbbbbbb...aaaa.
.a..bbbbbbbbbabbbbbbbaaaaabbbaaaaabbbbbbbbbbbbbbbbbbbba....a.bbbaaaabbbba...b.aaaa..
..a.b..abbabbaabbbbbbababbbbaaaaaaaabbbbbbbbbabbbbbbaabbbbbbbbbbbaaabbbba..ba.a...a.
b......bbbabbaaaabbbaaaaaaaaaaabaaaaababbabbbbbbbbbbbbbbbbabbaabbaaabbbb............
...abb..bbabaaaaabbbbaaabaaaaaabaaaaaabbbabbbaaabbbbbbababbbaaaaabbbbbbb....b....a..
...bbb...bbbbaaaaabbbaaaaaaaaabbaaaabaabbaabbbaabbabbaaaabbbaaaaaabbbbbb.........a..
a..bbbb...bbbbbaaaabbaaaaaaaaabbaaabaaabbabbbaaabbbaaaaaabaaaaaaaaaabbbbaaa.a.....ab
b..bbba.a.aaaaaaaaaaaaabaaaaabaaabaaaaaaaaaabaaaaaaaaaaaaaaaaabaaaaabbbbaa.b..b..ba.
ab.bbb...bbaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaababaaaaaaaaabaa.aaabbbbab.aa...ba..a
...bba.b.aaaaaaaaabaaabaaaaaaaaaaaaaaaaaaaabaaaaabbbaaaaaaabaaa.aaabbbbbbb.b....a...
...bbb...aaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaabbabaaaabbbaabba.....b...
ba.bbb...bb.a.bbbaabaaaaaaaabbbaaaabaaaaababbbbbbbbbbaaaabbbbaaaaaabbbb..abab...a...
a..abb.b.abaa..abaaaaabbbbaaaaaaaaaaaaaaabbbababbbbabaaaaaaaaaaaaaabbbb...bbbb...bb.
...bbb..bbbbaaaaaaaaabbbbbbbaaaaabaabaabbbbbaaabbbbaaaaaaaaaaaaaaaaabba...bbbbb.b..a
a.abbb...abaaaaaaaababbbbbb.aaaaaaaaaabbbbaaaaabbbbaaaaaab...aabaaabbbba.bbb.bbab...
b..bbb...bbbaabaaababbbbaaab.b.aaaabbbbaaaabaaaaaababaaa....baabaaabbbbabab..bbbbb..
...bbb.aabaaaaaabbbbbbbaaaaab.babbbbbbaaabaaaaaaaaaaaaaaa..bbaaaaaaabbbabb......bbbb
...bab..bbaaaaabbbbbbbaaaaaa.bbbabbaaaaaaaaaaabbaaababaaab.abbaaaaabbbbbb.bb.abbbbbb
...bbb.abbaaabbbbbbbbbabaabaa.bbb..aaabaabaaaabbaaaaaabaa.bbaaaaaaababb...aabbbbb...
.b.bba.abbbbbabbbbbabbabaabba.aaa.abbbaaaaaaaabbbaaaaaaaaabaaaaaba.bbb.bbbbbbbb.....
..bbbbaabbaabbbbbbbbbaabaabbaaa...abbaaaaaaaaabbabaabaaaabbaaaaaaabbbbabbbb.a.a.....
.b.bbaaabbaabbbbabbbbaaababbbaa..abbbaabbbaaaababbaaaaaaabbabaaaababbabb...........a
...aaaabbaababaaaabbbbaaaabbbba.abbbabaabbaaaaabbbaaaaaabaaaaaaababbbb..............
..abaaabb.abaaaabababbaaaabbbbb.bbbaaabba.aaaaaaabaaaaabababbbabbbbbab............a.
aaaaaaaab.aaabaaa.bbbaaaababbbbbbaaaaaa.aa.aaabaaaaaaaaaaaaabbbbbabbbaaaaaaaaaab....
aaaaaa.bbaaaaaaba.bbbaaaaaaaaaaaaaaaaaaaaaaaabbbaaaaaaabaaaaaabbaabbaaaaaaabbba.a..a
aaaaab.bb.aaaaaaa.bbbaaaaaaaaaaabaaabbbaaabbababbaaaababbaaaaaabaaaab...............
aabaa..bb.aaaaaa..bbbaabaaabaabbbaabbbbabbbbabbbbbbbaaaaabaaaaaabab..b........aa....
aa....bb..aaaaaaa.bbbaaaa..bbbbbbbabbbbbbbbabbbbbbaaaaaaaababaaabaaaaaabbaaaaaaabaaa
.bbb..bb.baaaaaaa..bbaaaa.bbbababaabbbbbaaabbabbbaaaaabaaaabaaaaabaaaaaaabbaaaaaaaab
.bbaa.bb.baaaaa...a.aaaabbbbbbbabbabbbba.aab.bbbbaaaaabbbaaaaaaaaaaaaaabaaaaaaaaabaa
.bbbb.ba..aaaba....aaaaaabbbbbaabbbbbbb.b.ba.bbbbaaaaabbbbaaaaaaaaaaaaaaaaaaaaaaaaaa
bbbbb.ab..aaaaa..b.aabaaabbbaaabbbbbbab..aabbbbbaaaaaabbbb..aaaaaaaaaaaaaaa.........
.bbbb.bba.aaaabaaaabaaaaabbbaabbabbbbbbb..aaabbbaaabaabbbb..aaaaaaaaaaaaaaa..a......
.bbbbbbb..aaaaaaaabaaaaaabbaabab.abbbbbbbababbbbaaaabaaabbb.baa.abaaaaaaaa......b...
babbbb...abaaaaabaaabaaaabbbbba.a.abbbbbbbbabbbbbaaaaabaabb.baa.a.aaaaaaaa.....abbb.
.aabbb.a.aaaabaaaaabbaabbbbbbb....bbbbbbbbbabbbbbbaaaa.aaabbbaaaaaaaaaaaaaab...a.bb.
..bbbb.babaaabaaaabbbabbbbbb......bbbbbbbbbbabbabaaaaaa.aabbbaaaaa..abaaaaa...a..bb.
..abbb..aaaaaaaaabbbbbbbb.bb...ababbbbabbbbbbbbbbabaaba.babbbaaba..babaabaab.a..bb..
b..abb.aaaaaaaaabbbbabbaa.bbbababaabbaabbbbbbbbbba.abaaa.babaaaaa..baaabaaaaa..abb..
.....aaaaaaaaaabbbbbbbaaa..abbbb.bbbabbbbbbbbbbbaa..baaa.aaabaabaaaaaab..aaaaabbbb..
.a.aaaaaaabaaaabbbbbaaaaabbbbb...bbbbbbbaababbabba..aaaaaaabaaaaaaaaaaa...aabaaabb..
aaabaaabaaaaabbbbbbaaaaaabbbbb.babbbb.aaababbbabba...aaaaaa.baabaaaaaa.....aaaaaa..b
aaaabbaaaaabbbabbbb.abaaab..bbbbbbbab.aababbbaabaa....aaab..aaaaaaaaa.....a.aaaaaa..
abaaaaaaaabbbbbbb..baaaab....bbbbbbbb..bbbbbbbbbbb..aaaaaaa..aaaaaaaab.......aaaaaba
aaa..baaababbbbbbabaaaabb.bbbbaabbbb..bbbabbbaabbabababaaaab.aabaaaa.........baaaaaa
...aa.abbbbabbbbbbaaaaaabbbbb.abbbbb..bbbbaabbbbbbaaabbaaaaa.aaaaaaaa.....a..bbaaaaa
a.b..bbbbbabbbabbbaa.aabbba...bbbaaa.bbbabbbbb.aabababbabaaa.aaaaaaaaa......bbb.aaaa
..a.abbbbbbbbbbbbaaabbbbb....b.bbbbbbababb.aa.aaaabbbb.aaaaaaaabbbbbbbabb...bb..bbab
.....babbbbbbbbaabbbbbbaa...a...bbbabbb.bb....aab.bbbbbbbbbbabbbbbbbbbbbb...bb..b...
a...aabbbbb.bbabbabbbbbbb.a.....babbbaabb.a.b...bbbbabbbbbbbbbbbbbabbabbb..bb.b.a.b.
...bbbbbbb...bbbbbabbbbbbbba...abbbbaababbbbabbbbabbbbbbbbabbbbbbbbbbbbaa.abb....a..
..babbbbbba....aabbbbbbbbabbbb.bbbbbbbbbbabbbbbbbbbbaaabbbbbbbab...aabaa...bb.a.b...
.b.bbabb.a....aaa...bbbbbbbbbbbbbbbbbbbbbbbbbbbbbaaaaaabbbaaaaaa.bb.aaaaa.....bb....
b.bbbbb....b..aabbbbbababbbbbbbbbbbbbbbbbbbbbbaaaaaa.bbabbbbaaaa...a.aaaba..........
..abbba.abbbababbbbbbbbbbbbbabbbbabbbbbb......aaaba...bbbbbbbabaa.....aabaa.........
..bbbb.bbbbbbbabbbbbbabbbbbbbbabbbbbbb......b.b.bbaa....babbbaaaaa....baabb.........
.......bbbabbbababaababbb.bbb.bbbb.bbb........bbb.aa.....bbbbaaaaa.....aaaaa....b...
.......bbbbabbbbb....aaaabbb..bbbbbbbbba.b.b...bb.ab...ababbbbaaaaa....baaba.a...b..
a.b....a..a.a...aa.baaaabbb..bbabbbb.bbb.......a..aa.......bbababaa......aab......b.
...a......bb.b.........bbb..a.bbbbb.bbb..a...b.b...a........bbbaaabb.b...b.....a....
.a...........b.a.ab...bbb...a.abbbb.......a.........b..ba....bbbaaa..a..a.b.....a..b

This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2010, TopCoder, Inc. All rights reserved.