JOIN
 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
......hhdnq.bbmmrmqdhiiaaaaaa...nnsnjjjjlnnnnnqbnrrrbhhhsleqspppfffffqqqffjlllhffffffftitt.....dp...
......gephhihbmmmmqqq.riakaaahd...dbfjjjjnnnnnrnnrrnehhhhhffbpbpphffppqqqjhlllllmjmmm.tttt....k.....
.sassiggghhhbbbmmmqnqriiiaaaaa..ddsdipjcjjnnnnlnffofkldhthffkfppfpppppfqqfddlllmbmmhmqottt....i.....
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
...j..........sssd.bbqggg..hhhhhhgggaasbaredddddddddocckfprbhhhijjbcclpphhhoaqqlqqtiaaaffffpffaammmm
.......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.
......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.......
.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
....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....
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
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.
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.
.mncs......k..ggeeeeppfff.ggqgjmmaaaammgmihhhffcdccoiiiiirrjojjjjjsnmdpdddjfffn.rj.s.icccccdccncccb
kimccgbg......gaeeee.pdppggiicmmaaaammm.olihhhkcscccoibiiikrajjjjjjmmmdddffrffk.a.......ccccjscc...
.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.....
.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..
...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
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...
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.
dacbhcccg.gkkhggkgggmggkddllhamagdddeeieggggg...ei.i
dd.bbdcccggkgkklgggggjjkdmllllddedicibedlhdggg......
aalabgggggggkggdkkecdjhfkjlalldmmmddlddldddfggci..kk
mabgkaggggggggckhkkkkdjjjjjllllmdgggagmdfecccgggjkkk
ddaabaakimccdlccb.damhmdmdgggggibggjgigiihccd.kkk..g
ddgeaaaahaiccccccddgagggggmggfgggjgghgiiiidcikkkcccj
dlggaaahaaaaccamggggggegggggggggmjaajkjcccckkkkccccc
ddlkfbdajagiggggggggcggegggggjjlcccbccchcckkkkbbbhbb
dg.jmgegkgggggggggcgagggddikhjmlcciccccabbkkbbifbgbb
md..ggmgggggcggcgddjddmeehebbllllbbbmbbc...ccjjjibil
ddgbbgggggdmddcdddiddbbbbbbkbllalieeheeeeiebcjjiiiih
hdhhldmdddddiddddbbbjceekebeeelllbeefeeeeeeeej.ag...
dfbdddbdeddddkgeaakaacbaccdeeeefeeeeeegebekelj.dl..f
.dddddaigddfggkgeeaaaaaaacmkmmjbffkkkkkbkkgkc.......
.jdddgkabgiiljggeeeaaaaaaaafmmcibbkfkkkkhkekki.....g
..ddddgjgggijjjggeikkaabaaaameccccg...kkkkkkgkkk..f.
gg...jgggjiijjjeggikfkaiafaaaacccjc....gjkkkkkegklkb
l...jjcjjj..g.aaeggdebkddmmaaaaaacgfccjjjjacckkkckkk
....jjjji.i..f.kbkggkjmdmmmaafajiacccccjjd.ac.amkmkk
...g.k.h........eekmgkdimmfiaaaaifaaaccchjmcc.kjcgkk
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
...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...
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....
.......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.
...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.
.....d..bddddcmmh..ddd.jaacaa.mcblmmmlgdhhhhgckaakkkkbmdfmaembgbjmeimcccca.ggddd..l
......lf.ddfdmmmmddjjbi...kaeammbbmmmmgfhhbhaaaakkkkkldfkdee...jiih...cch.mhmgdd...
m........ddddmmmmmjeji.c..iaaamm.mmmmillhhhkaaaakkkkl.dkhdem...jdibb.cccfcahggdd..i
.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.
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
.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
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...
..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:
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
bbcb..abbb.aaabba.......dccdbccccaccbddbddddcccccccabbdddddca...aaaaaa.ccccbaaaacdbdcbab..ddbd....
```
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
.pi.iiiisiiiiiibkaggpgssgggidjgggojjjlgqdaaalol..
....iciisiiiiiibbiiminiiiifggigmijjjjbjppamaalldd
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.
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.
.bb.c.h..hc.g.chffef.begggiabca.iieaeehhifffeffccaede..
..ceh..e.a..fbeeefheibghggdaaaa.aiiedefdfbcfffibcbdggc.
eebecggbd...hhfhfcfibbggggfheaa..iicecffdfgfhfccdaaigi.
.e..bbbhghhhhhcfffbbbcggdahcffiffeeeefifbgcgceaceeedbd.
g.a..bihhhh...daabfibagefggdffdffeeeeficccbcaegcfeedda.
..g..gbhh.ddaiccbcfbbbggggffgffffeeeecccdccccdgcccedfd.
.e..cgbbb...fbbbhffabbeggdafdffbeeegehhidccdcabgacedddd
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
ggghdgfeieaaaahcehhhgee..fbeaieccbbffcffbbbbbaidahceeid
fgggaaebdaaigcdhffgghibfcccieeccefbfffgfbb..i.dd.d.ef.d
idacfaaagciiigbbbbabggbbcfieeecbffhfffffd.....dhe.hhefh
gaaahgcicbbbbabccegggbbacceeedegcffffee....b..id..dch.h
f.ebgfaibbbbbabbabbbbbbcecefeeebhfefieg..i...i..haced.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.