QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#818658#8935. Puzzle: Easy as ScrabbleKKT89AC ✓21ms4852kbC++204.3kb2024-12-18 01:55:382024-12-18 01:55:38

Judging History

你现在查看的是最新测评结果

  • [2024-12-18 01:55:38]
  • 评测
  • 测评结果:AC
  • 用时:21ms
  • 内存:4852kb
  • [2024-12-18 01:55:38]
  • 提交

answer

#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll myRand(ll B) { return (ull)rng() % B; }

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n, m;
    cin >> n >> m;
    char c;
    vector<char> up(m, '.'), left(n, '.'), right(n, '.'), down(m, '.');
    vector<vector<char>> a(n, vector<char>(m, '.'));
    cin >> c;
    for (int i = 0; i < m; ++i) {
        cin >> up[i];
    }
    cin >> c;
    for (int i = 0; i < n; ++i) {
        cin >> left[i];
        for (int j = 0; j < m; ++j) {
            cin >> a[i][j];
        }
        cin >> right[i];
    }
    cin >> c;
    for (int i = 0; i < m; ++i) {
        cin >> down[i];
    }
    cin >> c;

    vector<int> lid(n, 0), rid(n, m - 1), uid(m, 0), did(m, n - 1);

    auto L = [&](auto mark, int h) -> bool {
        char need = left[h];
        if (need == '.') {
            return true;
        }
        while (lid[h] < m) {
            if (a[h][lid[h]] == need) {
                return true;
            } else if (a[h][lid[h]] == 'x') {
                lid[h] += 1;
            } else if (a[h][lid[h]] != '.') {
                if (!mark(mark, h, lid[h])) {
                    return false;
                }
            } else {
                assert(a[h][lid[h]] == '.');
                a[h][lid[h]] = need;
                return true;
            }
        }
        return false;
    };
    auto R = [&](auto mark, int h) -> bool {
        char need = right[h];
        if (need == '.') {
            return true;
        }
        while (rid[h] >= 0) {
            if (a[h][rid[h]] == need) {
                return true;
            } else if (a[h][rid[h]] == 'x') {
                rid[h] -= 1;
            } else if (a[h][rid[h]] != '.') {
                if (!mark(mark, h, rid[h])) {
                    return false;
                }
            } else {
                assert(a[h][rid[h]] == '.');
                a[h][rid[h]] = need;
                return true;
            }
        }
        return false;
    };
    auto U = [&](auto mark, int w) -> bool {
        char need = up[w];
        if (need == '.') {
            return true;
        }
        while (uid[w] < n) {
            if (a[uid[w]][w] == need) {
                return true;
            } else if (a[uid[w]][w] == 'x') {
                uid[w] += 1;
            } else if (a[uid[w]][w] != '.') {
                if (!mark(mark, uid[w], w)) {
                    return false;
                }
            } else {
                assert(a[uid[w]][w] == '.');
                a[uid[w]][w] = need;
                return true;
            }
        }
        return false;
    };
    auto D = [&](auto mark, int w) -> bool {
        char need = down[w];
        if (need == '.') {
            return true;
        }
        while (did[w] >= 0) {
            if (a[did[w]][w] == need) {
                return true;
            } else if (a[did[w]][w] == 'x') {
                did[w] -= 1;
            } else if (a[did[w]][w] != '.') {
                if (!mark(mark, did[w], w)) {
                    return false;
                }
            } else {
                assert(a[did[w]][w] == '.');
                a[did[w]][w] = need;
                return true;
            }
        }
        return false;
    };
    auto mark = [&](auto self, int i, int j) -> bool {
        a[i][j] = 'x';
        return L(self, i) && R(self, i) && U(self, j) && D(self, j);
    };

    auto slv = [&]() -> bool {
        for (int i = 0; i < n; ++i) {
            if (!L(mark, i)) return false;
            if (!R(mark, i)) return false;
        }
        for (int i = 0; i < m; ++i) {
            if (!U(mark, i)) return false;
            if (!D(mark, i)) return false;
        }
        return true;
    };

    if (slv()) {
        cout << "YES\n";
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < m; ++j) {
                if (a[i][j] == 'x') {
                    a[i][j] = '.';
                }
                cout << a[i][j];
            }
            cout << '\n';
        }
    } else {
        cout << "NO\n";
    }
}

这程序好像有点Bug,我给组数据试试?

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3804kb

input:

5 5
.CBA...
....x..
..x...C
A.....B
B..x..A
C......
.......

output:

YES
CBA..
....C
A...B
B...A
C....

result:

ok Correct.

Test #2:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

1 2
....
Nx..
..O.

output:

NO

result:

ok Correct.

Test #3:

score: 0
Accepted
time: 0ms
memory: 3568kb

input:

5 5
.U.N.X.
U....xX
Ox....X
M...xxN
Vx....S
Ix.x..X
..IBHX.

output:

YES
U.NX.
.O..X
M.N..
.VB.S
.I.HX

result:

ok Correct.

Test #4:

score: 0
Accepted
time: 0ms
memory: 3588kb

input:

10 10
.BAZEMIEKUJ.
A..........K
B..x.x.x..x.
K.........xT
A.x..x.....J
Hx....x....B
Q..x....x.xW
S...x......W
S...x.xxx..Z
...x......xZ
I..x..x.x.xR
.QKO.ID..RW.

output:

YES
.AZEMIEK..
B.......U.
K.......T.
A........J
.H.......B
Q.......W.
S........W
S.O.....Z.
QK...D..Z.
...II...R.

result:

ok Correct.

Test #5:

score: 0
Accepted
time: 0ms
memory: 3780kb

input:

5 10
.PTWIVVISPY.
T...x.x....Y
Xx.x.xx..x.K
P.x.xx.....K
S..........A
E.........xS
.SPEASDCYSA.

output:

YES
.TW.V.ISPY
.X.I.....K
P....V...K
SP.......A
..EASDCYS.

result:

ok Correct.

Test #6:

score: 0
Accepted
time: 0ms
memory: 3548kb

input:

10 5
.HVYN..
Y.x...C
V..x..B
H...x.Z
....xxN
....x.P
B.x...G
Fx.x..D
Txx..xK
E..x.xR
Sx....B
.EPSBD.

output:

YES
..YNC
.V..B
H...Z
..N..
....P
B...G
.F..D
..TK.
EP.R.
..SB.

result:

ok Correct.

Test #7:

score: 0
Accepted
time: 0ms
memory: 3632kb

input:

50 50
.YDOGQIDENEUMONVSGZNMNHLEZCXIRMK.OOCKJOKXXZDUFEMPXS.
Y.x...x.x.x..x..........x.......x......x.....x....xX
N.........x.....x.....x....x.x.xxxxx.x...x.........E
U.....x.....x....x......x.....x........x..........xS
...x......x........x..x.....x.x.x........x.x.x.....S
Q.....x.x..x..........x....x....

output:

YES
Y.OGQ.D.N.UM.NVSGZNMNHL.ZCXIRMK.OOCKJO.XXZDU.EMPX.
ND...I.E....O..........E..............K.....F...E.
U........E......................................S.
.................................................S
Q................................................L
F...........................................

result:

ok Correct.

Test #8:

score: 0
Accepted
time: 1ms
memory: 3624kb

input:

100 100
.NUXAMX.LNWZKRRKZIRNZVDJF.XRB.VEFQXHTGLGIKZYSRPPF.YGVTOSQCADEG.KYKH.NWWO.XDXJW.G.RBHABFLWHFVUNOLBHMKN.
U..x...x...x....xx........x.....x.....xxx..x..........x..x...x..xx..x..x..x............x.....x.....x.N
C...x.......x.............x....x.x.x..x........x..x.xx..x..xx.................x..........

output:

YES
.U.AMX.LNW.KRRK..RNZVDJF..RB.VE.QXHTG...KZ.SRPPF.YGVT.SQ.ADE..K..H..WW..X.XJW.G.RBHABF.WHFVU.OLBHM.N
.CX.......Z....ZI..............F......GI..Y..........O..C...G..YK..N..O..D..................N.....KO
.O...................................L...........................................................

result:

ok Correct.

Test #9:

score: 0
Accepted
time: 5ms
memory: 3672kb

input:

500 500
..FHFDLGFGHREQBGILNRAGJ.ERZSAFGLQ.ESEBI.ELKM.RENLNFQSPT.TXUEIKHHOQWABSELMOPGTFGTXGYMTSU.N.O.AX.OGNSWTFSLUIMTUX.RUCECKZCXOJNPTFVAJUJTF.LHXURYIQIJCVWDBVZ.ZXFRAT.XIPXTDCSLHJHSZCW.RMNUGPIHYUQYUYAY.NHCBU.JPMLG.DDXAJWKNZJVKNAWAJZAHW.FCBEVATZ.YZ.HQ..QPLFARSHNP..EDPIKLYLF.FIFXEXR.XSUORAP.CZPMJXPUS.W...

output:

YES
...FDL...HREQ..ILNRA...ERZSA.GL...SE.I..LK...ENLNFQS.T.TX.E.K.HOQWA.SE.M.PGTFG.XGY..SU...O.AX.OGNS.TFSLUIM.UX...CEC..CXOJNPT.VA..JTF.LHXURYIQI.CVWDB.Z..XFR.T..IPXTD..LHJHSZCW.RMNUGPIHYUQY.YA..N.CB..JPM.G.DD.AJW.NZJ...AWAJZAHW.FCB...T..YZ.HQ..Q.LFA.S.NP..EDPI.LYLF..IFXEX...SUO.AP.CZP.JXPUS.W.D.WU...

result:

ok Correct.

Test #10:

score: 0
Accepted
time: 19ms
memory: 4376kb

input:

1000 1000
.SKFDQ.AV.GPTHMF.PL.YOQRQOXDOF.XVZ.H.MYOJIYT.QZNJQI.ZZMAJ.OAWBJBRXFW.CLEPPKGGAWGTVBKOBL.GPCO.ML.DBL.A.RJ..GF.EHK.CDXLLTCBCL.CGYJBMUSPIN.QELGYW.JE..CFVQF.LVYLFHYJ.MY.FZ.RU.ODLAYTWIZQOQZXBW.BVD.RFPLHLEHAU.G.PLFWFUKA.RSG..AVU.SA.PWRGJYO.OXD..S.Z.LIIADT.YXH..NHWXY.R.YFLS.URIJGPPURZPPVHJFLMKTDT...

output:

YES
S.FDQ.AV.GPTHMF.P..YOQRQOXD.F.XV.....YO.IYT.QZ.JQI.ZZMAJ.OAWBJBRX...C.EPP.GGAWGT.B..BL.GPCO.ML.D.L.A.R...GF.E.K.CDXLLT.BCL.CGYJB.USPIN..EL..W.J...CFVQ..LV.LFHYJ.MY.FZ.R..ODLAYTWIZQO.ZX.W...D.R..LHLE.A..G.PLFWFUKA.R.G..A...SA..WRGJ...OXD....Z.L.I.DT.Y.H..N.WXY.R.Y.LS..RI.G.PU.ZP.V..FLMKT.TWI.ZKHZ...

result:

ok Correct.

Test #11:

score: 0
Accepted
time: 0ms
memory: 3636kb

input:

1 1000
.K.CCS...LC.....Y..J...E.W.B..Q..KQ...Q...L..U.XSWX..NB..K.OLF...Y.A....HG....RRQO..Y...J.LOS...IN..C......H......X.....B.B.PQRT....VB.........P...E....MF.E...RH.XADCQN.D.KT.W..XNI..PH.Q.L.H..G...ZJR.V.I.......O......J.X..N..QS......UN....HLS..Z..N....X.YH.W..E.Z..JHSAV......YXT.P..TX.WT.SHE....

output:

YES
K.CCS...LC.Y.W.Y..J...E.W.B..Q..KQ..EQD..LT.U.XSWX..NB..K.OLF...Y.A....HG.BH.RRQO..Y..PJ.LOSU..IN..C......H......X.....B.B.PQRT...QVB...V..K..P...E....MF.E...RH.XADCQN.D.KT.W..XNI..PH.Q.L.H..G..ZZJR.V.I.......O.....DJ.X..NC.QS......UN....HLS.TZ..N....X.YH.W..EBZZ.JHSAV......YXT.P..TX.WT.SHE...YG...

result:

ok Correct.

Test #12:

score: 0
Accepted
time: 0ms
memory: 3792kb

input:

2 1000
.D..JPYBD.H..F.I.NTFC.VJKS..Q.PBW..XLW.ZS..ATCTMPPKRK.V.NN.MPE.SPN.QODI.H...OR.V..INXOZMGF.KIS.GANJ.WV.YLALHHXO..M.TMTJ..XYP.N.BUENZCUA.I.XJO.Q.NVG.B.TXNI.TVLY.N.CWE.ZEO.ANYRZ.W.PQI.LORBYIYJIK.JZ.PENB.HPJPTIIGVOMF.RPZ..WFM.IS..H..U.ZEX.DXZU.YHM.UOMPOHV.HW..SZ.RHWXW.SZH.....R.X.R.L.JRYLL.CE.IE...

output:

YES
..JJPYBD.H..F.I.N.FC.VJKS..Q.PBW..XLW.ZS..ATCTMPPKRK.V.NN.MP..SPN..ODI.H....R.V..INXOZMGF.KIS.GANJ.WV.YLALHHXO.....MTJ...Y..N.BUENZCUA.I.XJO.Q.N.G.B....I.TVLY.N.CWE.ZEO.ANYRZ.WBPQI.LORBYIY..K.JZ.PENB.HPJPTI.GVOMF.RPZ..W.M.IS....QU.Z.X.D.ZU.Y.M.UO.POHV.HW..SZ..HWXW.SZ......R...R.L.J.YLL.CE.IEZDX....

result:

ok Correct.

Test #13:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

1000 1
.N.
N.N
G.G
...
...
.x.
U.U
...
.x.
P.P
K.K
..O
.x.
.x.
Y.Y
...
.x.
..D
.x.
...
J.J
Q.Q
E.E
.x.
A..
W..
.x.
H.H
D.D
...
...
E.E
..H
..A
.x.
...
C.C
..E
O.O
...
..Z
J.J
...
..Y
P.P
W.W
X.X
G.G
...
...
...
...
L.L
F.F
B.B
.x.
K.K
R.R
U.U
F.F
.x.
...
...
...
B.B
...
L.L
.x.
E.E
N.N
Z.Z
...
Z.Z
W...

output:

YES
N
G
.
.
.
U
.
.
P
K
O
.
.
Y
.
.
D
.
.
J
Q
E
.
A
W
.
H
D
.
.
E
H
A
.
.
C
E
O
.
Z
J
.
Y
P
W
X
G
.
.
.
.
L
F
B
.
K
R
U
F
.
.
.
.
B
.
L
.
E
N
Z
.
Z
W
.
.
.
I
V
P
.
.
J
K
D
X
Y
.
.
.
S
.
X
.
.
J
F
O
S
N
.
D
.
.
E
U
.
.
T
C
D
M
.
.
.
T
.
.
.
.
.
F
.
.
Y
E
K
.
.
.
.
T
.
.
.
.
G
T
.
A
.
H
R
X
.
.
.
.
U
...

result:

ok Correct.

Test #14:

score: 0
Accepted
time: 0ms
memory: 3816kb

input:

1000 2
.HE.
.xx.
....
H..E
..x.
Z..N
U.xU
..x.
Rx.R
A..A
D..L
J..T
..x.
A.xA
Ax.A
...V
.x..
F..F
.x..
U..Q
Bx.B
F..X
E..E
...G
B..V
..x.
.x..
..x.
E.xE
...I
..x.
...W
Tx.T
.x..
Tx.T
H..H
K..K
M..I
..xK
V..I
.x.Y
...V
....
A..M
B.xB
Hx.H
A.xA
...K
...X
O...
J..X
S..U
X..M
F.xF
..x.
M..I
D.xD
Y.xY
Hx....

output:

YES
..
HE
HE
..
ZN
U.
..
.R
AA
DL
JT
..
A.
.A
.V
..
FF
..
UQ
.B
FX
EE
.G
BV
..
..
..
E.
.I
..
.W
.T
..
.T
HH
KK
MI
K.
VI
.Y
.V
..
AM
B.
.H
A.
.K
.X
O.
JX
SU
XM
F.
..
MI
D.
Y.
.H
XF
SX
AK
.R
B.
..
..
KE
NN
Z.
..
BI
PV
ZD
.D
.G
..
RR
V.
.O
EE
..
C.
.J
SP
..
GG
JI
..
.P
DH
..
QQ
..
V.
ZL
W.
QC
P.
KK
.O...

result:

ok Correct.

Test #15:

score: 0
Accepted
time: 0ms
memory: 3660kb

input:

1 1
.M.
M.M
.M.

output:

YES
M

result:

ok Correct.

Test #16:

score: 0
Accepted
time: 0ms
memory: 3568kb

input:

2 2
.FG.
F..G
D..D
.DG.

output:

YES
FG
D.

result:

ok Correct.

Test #17:

score: 0
Accepted
time: 18ms
memory: 4408kb

input:

1000 1000
.SALZWWWEFVNIEX.ZDPPWJHROFIITXR.CSOKTMFFUGSA.UW.X.QYXWNAC.YCVHOGAHGZQAJWINRU.Z..CCFQKASZXMPWSQGILOT.N.PKGZ.JWPZ.ALPWSOFCMWABPW.ZAFSQQUASJHPIAMITPJEAJLKMGVGDOHFFNYKKXFHUIPFYDPQ.RWKD.PWLTQPZGPMYPQHOAGOHIDQMFGJU.MLXPCUK.ES.KZHPRLBGCTGYHPVYMX.DFAZODQ.QXANEJTISMUGV.LIGKZDSNOC.NDWM.N.JYHJIWCBQ.L...

output:

YES
..LZW..EFV.IEX.ZDPPW.HROF.ITXR..SOKT.FFU.S..UW.X.QY.WNAC.YCVHOGAHGZQ.JW.NRU.Z...CF..A..XMPW.Q...OT.N.PKGZ..WPZ.ALP.SOFCMWABPW.ZAFSQQ.ASJHPI.M.TPJ.A.LKMGVG.OHFFNYK.XFHU.PF.DPQ...KD..WLT.PZGP...Q.OA.O.ID.MFGJU..LX...K.ES.KZHPR..GCTGYHPV..X..FA.O.Q.QXANE...S.UG....GKZDS..C.NDW..N..YHJIW.B..LIU.N.NI...

result:

ok Correct.

Test #18:

score: 0
Accepted
time: 16ms
memory: 4456kb

input:

1000 1000
..EYLAGAENPDPZMGY.K.MSRTZBHDENS..YJRW.IWCLBIQQICT.ODBUMXFPO.UDPELUBMQSLZ.EHIVABC.ME.NQQI..QEHTIIFGJQWZSLDNDKGWA.UGMR.CJ.RPAQYJUAIIFQAMRAWECAAFHV.GUGIXROGEYDUX.FUUP.JKSYZITIHMSCKEQQKU.SFAXDPIPSHHYGGYLLEHUHZYRKYBKNAAOAWZHPRKHIQRZJXO.LMJUHDR.AWTBOEEJIHRH.XBUDQHGHKSL.SKW.SZZNIZAF..PK.NVOIMECDI...

output:

YES
.......................ZB.DE.S..Y.RW.IW.L.IQ..CT.O.BUMX....UD.ELUB.QSL..E..VABC.ME.N..I...EHT..F...W.S.D..KGW..UG.R.C...PAQYJUAIIFQA.R....AAFHV.GUG..ROG..DUX...U..J.S....IHMSCKE...U...AXDP...HH.G..L.E.UHZY.KY.K.AAOA..HPR.HI.RZJ...LMJUH....WT..E.JI.RH..BU..HGHK.L.S...SZZ.I..F........IME..IKXFG.J....

result:

ok Correct.

Test #19:

score: 0
Accepted
time: 13ms
memory: 4404kb

input:

1000 1000
.YOTYESJGMDJYFO.GICQVC.PBBNUUXFEIX.OJ.DBWOESWK.TEI.DITEQKIKC.QOTZBX..UB..SW.ODDBU.ZDILJKQYEM.CXOWRNAX.RYRPM.VMVYI.PBYXXUDDAFQUMAI..UFRHYOQA.PUWEP.AHEMMHMRCEZRFJQRWKLVXA.HXPHIMHV.SEHGFEJB.WRT.EYCWPI.CTERLDCPFUXKOWGIVNJKKOPUZRZI..NCHBODRTVKZRNHGTOQTYAKSEBA.TEX..EFIVBSBFOAJ.M.PXGTMHN.PRAPFIDD...

output:

YES
..............X.IC......BN......X..J...W.ESWK.......TEQ.I...QOT..X..UB..S...D..U..D.L..QYEM..XOWRNA..RY..M.V..Y..P...X......U.A...UFRH...A.PU.E..AHE.M....EZR.J.RWK.VX..HX.H.M....E.GF.JB..RT.E.C.PI.C.E.L.CP..X..W.I.N..KO..ZRZI..N....DR.V.Z.N.GTOQ.Y..SE.A.T.X..E..VB.BFO.J.M.PX..MH..PRAPF..DH.O.G.T...

result:

ok Correct.

Test #20:

score: 0
Accepted
time: 14ms
memory: 4360kb

input:

1000 1000
.HXXXGGPVDEYBGKDYLMRYKPIY.B..BQBPSH.DHV.RNWZKUYVSVELVLW.IAZZSBAGJSPHY..LFURSTQY.BTDPZ.GQCCNHBHJNUBDRQRGESN.TIGYPZVZ..MAWLKSUBOR.OJ.FEYPDJBAI.WV.EYBPRKNB.V.NY.QESGNGLNTUF.EY.EOIUPSETRWU.AWLP.DCBRZ.IDJIZW.UEJYDHPYOJPH.QJJAR.EOYFQKOSXUK.LNXOHJNINT.NVJFEGZOMSJQT.XHISZWU.Z.GYGELPGGDVTFAGA.TSYDN...

output:

YES
.....................P......BQ..S..........KUY......L.......B..............T......P.....C..B.J........................WL..........F.......I........R.NB.........G.G.............P.........L..D......DJ.Z........P...P..Q......O...................T.........M.....X.......Z...G.L.GGD....G..........M......

result:

ok Correct.

Test #21:

score: 0
Accepted
time: 13ms
memory: 4544kb

input:

1000 1000
.CCFMBZB.AUU.H.ZXYVAIMTA.D.JJIPERQWJVCTTAKSARUVYRPOPQMNFTNMPUBAZLCD.NXITOLEGFETDCOOBBGTL.U.IDCGBOOWFZ.VAWT.BXDK.YXRPTAVKNVAEMTDFY.UEUJCXSVZTYVJIN.ZOXGSTHSGUJWPTSLSUKFZDICKCPNTF.TTVUZUWAWFIPJ.HSXCJWRLDXZPXSHYLE..VZDEXCIGCFVBJBRNLAZDYXYGBDSRJUKRLVGREJGHMBFFK.SQSFXVDXBOULXPVHXPXKDZADDQA.JJCLE...

output:

YES
.................................................................................................W.........................................Y..........................................................D.............................................................X......................................

result:

ok Correct.

Test #22:

score: 0
Accepted
time: 17ms
memory: 4452kb

input:

1000 1000
.YYJG..U..V.ZKZL.MR.Y.BFP.RK.Y...Y.P...LZ.HB.FECA.O...DDWYTFMKZZ.RZ..AJD....ND.P.B...MPYOAU.DYJX..Y.UEUN..IVDN.C..WXXF...FRP...A..NP.B.O.Z.D..LFC.F..TR.G..M..ULQ..VPC..X.DHPY..UGO.F.P.BM.R..HXJ..STSJMS.Q.AZMF.EF..OXMSV.BAG..ADIR.FD.QDJN.DM...NKI...IYMNE.CP...J...G.KSX..B.J.HLYJC.PMBBJG.F.....

output:

YES
...........................................................................................................................................................................................................................................................................................................

result:

ok Correct.

Test #23:

score: 0
Accepted
time: 11ms
memory: 4432kb

input:

1000 1000
...H......V...............A......Y.....L...W........E....O....I.................................................M.........DM...................W........D...................F...............................F...........................Q.L............Q..............D..U...........................

output:

YES
...........................................................................................................................................................................................................................................................................................................

result:

ok Correct.

Test #24:

score: 0
Accepted
time: 11ms
memory: 4580kb

input:

1000 1000
...............................................P................................................................................................L.......................................................................F....................................T.......................................

output:

YES
...........................................................................................................................................................................................................................................................................................................

result:

ok Correct.

Test #25:

score: 0
Accepted
time: 15ms
memory: 4444kb

input:

1000 1000
.....................................................................................................................................................................................................................................................................................................

output:

YES
...........................................................................................................................................................................................................................................................................................................

result:

ok Correct.

Test #26:

score: 0
Accepted
time: 15ms
memory: 4376kb

input:

1000 1000
.LSJXLZZD.YK.B.STLUYFB.O.MZDTXTLLSRCHKNQVK.LPMVY.KV.BFQGD.NAYTTLK..EAP.XGSIYRXDMVNGNPGL.DNGDONQCYC.EQUJOAEYUTVNWRJFT.PU.QBTJMBEM.AA.RKJRIQJOK.TRGYTNXZXBKCCECOBFJXPRVQHASGE.FBTEDJH.QNNLCUAQRKZISWRCJIRHHCUAORAOKKSWLSHYSHDTB.APURKPFQWWVEQVSJ.LRILACYRW.XPPAAFLL.GTUWWTCMAIAWRDAAUB.VIPK.KMOKEOLR...

output:

YES
LSJXLZZD.YK.B.STLUYF..O.MZDTXTLLSRCHK.QVK.LPMVY.KV.BFQGD.NAYTTLK..EAP.XGS.YRXDMVNGNP.L.DNGDONQ.YC.EQUJOAEYUTVNWRJFT..U.QBTJMBEM.AA.RKJRIQJOK.TRGYTNXZXBKCCECO.FJXPRVQHA.GE.FBTEDJH.QNNLCUA.RKZISWRCJIRHHCUAORAOKKSWLSHYSHDTB.APURKPFQWWVEQ.SJ.LRILACYRW.XPPA.FLL.GTUWWTCMAI.WRDA.UB.VIPK...OKEOLRNL.JCU....

result:

ok Correct.

Test #27:

score: 0
Accepted
time: 14ms
memory: 4528kb

input:

1000 1000
.DP.QPM.HQWBGIPFTNLVIWMOIVHQNBUCWBOAJSDZCB.RAXNSVHCQESPHTPCBYD..OWFUSZLXAOY.SL.XUVPDQFOV.QUD.RIWPEEFRTGXAXX.CE.FYTRYUGTLLYFRBRJ.G.KCZAWVQHEW.MR.HBVAD.IXHDT..L.ZFKI.CBZXXBVWOXXAFG.UQZJACGQSWTXXQHGDUUYBAVYJBLA.QBACTMZQQVARPNNBNPH..KDUT.HHRUNOMQAWQQXNFR.CWHYRSWLI.IRNNNY.YCKFZXIMTSJX.GZSKZNKNS...

output:

YES
DP.QPM.HQWBGIPFTNLVIWMOIVHQNBUCWBOAJSDZCB.RAXNSVHCQESPHTPCBYD..OWFUSZLXAOY.SL.XUVPDQFOV.QUD.RIWPEEFRTGXAXX.CE.FYTRYUGTLLYFRBRJ.G.KCZAWVQHEW.MR.HBVAD.IXH.T..L.ZFKI.CBZXXBVWOXXAFG.UQZJACGQSWTXXQHGDUUYBAVYJBLA.QBACTMZQQVARPNNBNPH..KDUT.HHRUNOMQAWQQXNFR.CWHYRSWLI.IRNNNY.YCKFZXIMTSJX.GZSKZNKNSZFAYM.S...

result:

ok Correct.

Test #28:

score: 0
Accepted
time: 11ms
memory: 4348kb

input:

1000 1000
.QACXHKHSI.T..MNSDIFWXJC..MMWQ.FEHIDIB.WPW.JBWAOVY.EHYJNMCLINCOTHRZCJNCVHSTKAFKYCTILGKRGY.NM.Y.H.J.KFZ.CW.WSYOYLFRLZENLVKN.SZNJFGFVDWCW.AE..FQJJNLXY.UOSAAIWYHM.YWZQS.XPB.YTTAU.YN.HWTQH.YBYDGSDCGKDUGRJDEZWVGTOWKVKXDPPONDGEQ.IZOI.UCF.M.USZYUQZAAOQC.TG.UETLCUYKWKZAFYYWDDCU.OQ.WCZQSXOESQDDHWJF...

output:

YES
QACXHKHSI.T..MNSDIFWXJC..MMWQ.FEHIDIB.WPW.JBWAOVY.EHYJNMCLINCOTHRZCJNCVHSTKAFKYCTILGKRGY.NM.Y.H.J.KFZ.CW.WSYOYLFRLZENLVKN.SZNJFGFVDWCW.AE..FQJJNLXY.UOSAAIWYHM.YWZQS.XPB.YTTAU.YN.HWTQH.YBYDGSDCGKDUGRJDEZWVGTOWKVKXDPPONDGEQ.IZOI.UCF.M.USZYUQZAAOQC.TG.UETLCUYKWKZAFYYWDDCU.OQ.WCZQSXOESQDDHWJFMOTOQJZ...

result:

ok Correct.

Test #29:

score: 0
Accepted
time: 15ms
memory: 4420kb

input:

1000 1000
.JX.NOOUEQW.OZCKCF.VT.IDFDPWZXXBXQWMIVNT.ZM.YJPAACHOEEFDBGZXLLCGKEPKW.BDMEIDRFC.EPJRENUNKJDMTVR.HRMMSPS.ZEQBXAGRIGAEABSDTQVEJUWWIVF.IMGCRNLOAOBMCVYOGEWRAYOJTRUMU.NSZW.B.EUZKBIZ.YMHFOOCGX.DHSZJXMBDMYDDJXXSHVTOU.EJ.XKPZQJACHZE.BHRHEQYIBNVDYBUBMNVKMSYXZXEFIV.OPL.BFWMJYRE.VV.SV.X.H..EZGHAWZHOA...

output:

YES
JX.NOOUEQW.OZCKCF.VT.IDFDPWZXXBXQWMIVNT.ZM.YJPAACHOEEFDBGZXLLCGKEPKW.BDMEIDRFC.EPJRENUNKJDMTVR.HRMMSPS.ZEQBXAGRIGAEABSDTQVEJUWWIVF.IMGCRNLOAOBMCVYOGEWRAYOJTRUMU.NSZW.B.EUZKBIZ.YMHFOOCGX.DHSZJXMBDMYDDJXXSHVTOU.EJ.XKPZQJACHZE.BHRHEQYIBNVDYBUBMNVKMSYXZXEFIV.OPL.BFWMJYRE.VV.SV.X.H..EZGHAWZHOATDUMZDA...

result:

ok Correct.

Test #30:

score: 0
Accepted
time: 16ms
memory: 4376kb

input:

1000 1000
.DZIRSLTJU.UBNKSQOQVBCO.LHXP.KQDKAIWOJMNI.KQBHNSJ.HCWUMEX.LJLWEA.SYZFBQUCCQTXL.IGNQXHMHAM.KBIUTYZB.DQCRUU.WLPBDWDEDV.JWOAAMYEA..LVHWWSQXOPMZRDSL.TGJD.XMPNO.RTHCKJFIRCKDBMT.UKXNDIR.PDZOSFRVUBZBUJVTNKHUUGEHLSKDWKO.CQKIFNL.ZIQDTKKSAXMKJBPGMNVLNIMFPR.YOVHMNZAFROGZYPKSBTRDGLICIK.MUQGP..QSUOPJAZ...

output:

YES
DZIRSLTJU.UBNKSQOQV.CO.LHXP.KQDKAIWOJMNI.KQBH.SJ.HCWUMEX.LJLWEA.SYZFBQU.CQTXL.IGNQXHMHAM.KBI.TYZB.DQCRUU.WLPBDWDEDV.JWOAAMYEA..LVHWWSQXOPM.RDSL.TGJD.XMPN..R.HCKJFIRC.DBMT.UKX.DIR.PDZOSF..UBZBUJVTNKHUUGE.LSKDWKO.CQK.FNL.ZIQDTKKSAXMKJBPGMNVLNIMFPR.YOVHMNZAFROGZYPK.BTRD...CIK.MUQG...QSUOPJAZLZO.UPC...

result:

ok Correct.

Test #31:

score: 0
Accepted
time: 16ms
memory: 4464kb

input:

1000 1000
.MYLDYUACWALSDVAKZ.IKAHZYFABRPMLLULC.GSVPUSYNNEGAOAIGOATRIUUFEZOCJQDYHFMCYJUDYE.UCQCUUCZK.MFVXRCQUZQZI.O.WPHOCVKVAMPXK.NURJ.B.BTUBNWG.ZRPXJALNMIVCBTITZ.BCNSYJH.SGSO.XXIOQEYFXHZHWQV.TIYSPF.XBFAZMHTDCEBEGLJNJU.WXAKKJ.ONGZJ.HERVPG.QI.JHLGYZAFOFSFX.IWFPQBEW.XPUL.NNAXIGWKK..VATW.TVHXBGPBLBDGIB....

output:

YES
........W....................M......G.....Y..E...............Z....D.......U...................C...............KV...........B.B.........P.J..N...............................X............F.............E.........AK.................I.......A...........Q.........................T............B.....O.....

result:

ok Correct.

Test #32:

score: 0
Accepted
time: 15ms
memory: 4576kb

input:

1000 1000
.LYXHPBWMFMTKVIQXQRMUIZ.HW..IEYGSAP.BXGZJXSIOVE.DQHJOFDOLARYPEOLAIFL.YUIFKWAYBDAYDLYOPKNEIA.VGZFMXNASKXPEOFRPVVKKRCQLCRCEMXRVD.ACTHSAZYDB.SC.SLTBJWCGNPCX.SZFT.HHMSTEWXWOEITHWKIIXWO.HFQHXSX.GA.L.MXYQRFTQTER.IVZZV..Q.NRBCF.PNMJEXT.SDISTHXWN.TAHJJB.XEZQOWVRMO.MH.JULNAYILOQLSE.JGCB.GCBE.LTMGUM...

output:

YES
L...P....M..V...Q.M..Z..W..............J.S.....D.HJ...O....P.....FL......W.YB...D............ZFMX.ASK..E......K.R...C..E...V..A.......D......LTBJ...N..X....T.....T.....E......I.W..H.Q.............Q..........Z....Q..R.......J..T.S.....X.....H.....E..O.V........U.....L......J.C.....E..T..UM....Y.....

result:

ok Correct.

Test #33:

score: 0
Accepted
time: 21ms
memory: 4412kb

input:

1000 1000
.XYEMFHIER.CZ.LNREYNVNIF.CUNLURC...HSHZ.J.OLEFFS.ZSVWGNGN.YGPOMDIFCTMRA.JRLMTCS..AWYBBJKHOYHINDIRRWS.OMOQ.ZHEWDSBHNKGD.ZAUSEHMELEMWRLC.LIPNSNJOB.XNMT.ETIQFVCPYMITVHY.X.SNDCAEFE.FFK.CE.GKNRJHIY.WAXYCQIVNLEQYYSABBWOJ.CTT.F.NVYYCNFRQRFYBEBS.WGVWFSOLYEKWTRDKGLBLLQKSURZ.QWNR.APGQQRUIMKRL..YXIOJ...

output:

YES
X..M....R.CZ..NR.Y..N...CU.LUR....HSHZ...O.........W.N.N.YGPOM.I.CTMR...R...CS...WYBBJK..YHIND.R.WS..MO..Z.E...B.NK...Z....H.E.EMW.LC.LI......B...M.......V...MITVHY.X.SND........K..E.GKNRJHI........IVNL.Q.Y.....O...TT....V.YCN.RQRFY.E.S..GVW..OLYEK..RD.G...LQKS.RZ.Q.NR.A.G.QR.IM.R.....I.J....MU....

result:

ok Correct.

Test #34:

score: 0
Accepted
time: 19ms
memory: 4432kb

input:

1000 1000
.UXMHORG.PYDICJWAKCP.OTSOWYKDMSUHPQJOXYUTSV.MGSRR.GRCVZYDYVPTIZOUYYBSELDTXKEPTLYBNRH.IRFTZ.NTMQB.UZGI.IF...GDVSSMRSPOVSJJFXVBXA.YYTY.NR.DURKGBXUOEZU.BQCNGG..OZDNEKFMHJH.UOSRLSPXGUX.AMRIL.LFR.QUGU.VLTOYILWAENLHDSZWK.DVOZX.FDQFS.EXZS.HFKJ.QRLVSGDWDZMZKE.BPFPPIPURDPRYHMGJAJASAJDZP..CSP.Y.CZCC...

output:

YES
.XM.O.G.PYDI..WAKCP.O.SO..KDM.UH.Q.OXYUTSV.MG.RR.GRCV.YDY..TI.OUYYBSE.DTXK.P..YBNRH.IR..Z..T....UZGI.IF...GDVS.MR.P.VSJJFX.BXA.YYTY.NR..URKG..UOEZ..BQCNGG..OZDNE.FMHJH..OS.L..XGU..AM.IL.LF..QUGU..L.OY.L.....HD.ZWK.D.O...F.QF..E.ZS.H.KJ.Q....GDWDZMZKE..PFP.IPURDPRYHMGJ.JA..JDZP..C.P.Y..Z.C.XV.O.R...

result:

ok Correct.

Test #35:

score: 0
Accepted
time: 16ms
memory: 4428kb

input:

1000 1000
.QNBDJYHFQVESJURS.YEWMCEZFLRKSZTAWCYOVTSQOZQIWUVRROZAWYYJUJBUB.SLNZIZGXXPQFDHPD.KJTIDKNMDQEYTPVUSBOMJ.ESCQ.SCGJWYLRE.R.OVFVIN..W.SMQHQOMXGEFP.OYVTCIIDKPCJNRJYMCWOWSWENITNRZNDH.DU.S.JMTOVIJFJ..OBUJ.NMIXFPMPHUYOXDLRDTOZFRT.LKLPFC.OBXZLKERXNSVHLZQD.HTDWBVOMERMJUUKAYOXRXWCPPOQ.WXSJIYK.YC.MDUFB...

output:

YES
QNBDJYHFQVESJ.RS.YEWMCEZFLRKSZ.AWCYOVTSQO.QIWUVRROZAWYY.UJBUB.SLNZIZG.XPQF..PD.KJTIDKNMDQEYTPV.S.OM...SCQ.SCGJ.YLRE.R.OVF.IN....SMQHQOMXGE.P.OYVTCIIDKPCJNRJYMC.OW.WENIT.RZ.D..DU.S.JMTOVIJFJ..OBUJ.NMIXF..PHUYOXDLRDTOZFRT.LKLPFC.OBXZLKERX.SVH.ZQD.HTDWBVOMERMJUUKAYOXR.WCPPOQ.W.SJIYK.Y..MDUF.NSYNXX....

result:

ok Correct.

Test #36:

score: 0
Accepted
time: 14ms
memory: 4580kb

input:

1000 1000
.KWOUVJPAYKRTHLIOBSGJBIVNOHFPHZXGEKC.MMM.AHC.QIFGFDWDQAGFR.IVJGTBLMBRIZXVY.TE..TFXZBXPRD.XBHKSLNYFOS.BWCRGHXEVJQE.CHVIYUSXWPWWLSXYYSWFRGTNHAISCNTHKSNBXWJ.SEE.LJXWY.BIDCTJOPDDE.MVBYHWPL.ANVUWDK.DJOVJRG.GTGTJJ.VHDRDLQ.SL.EX.RCMBAQSEBRWLCY.HDFT.IRVIOKIENARHVWJCPAECFEVSMVZPZJZSG..VB.EQFVWA.OJG...

output:

YES
KWOUVJPAYKRTHLIOBSGJBIVNOHFPHZXGEKC.MMM.AHC.QIFGFDWDQAGFR.IVJGTBLM.RIZXVY.TE..TFXZBXPRD.XBHKSLNYFOS.BWCRGHXEVJQ..CHVIYUSXWPWWLSXYYSWFRGTNHAISCNTHKSNBXWJ.SEE.LJXWY.BIDCTJOPDDE.MVBYHWPL.ANVUWDK.DJOVJRG.GTGTJJ.VHDRDLQ.SL.EX.RCMBAQSEBRWLCY.HDFT.IRVIOKIENARHVWJCPAECFEVSMVZP.JZSG..VB.EQFVWA.OJGWY.PBVR...

result:

ok Correct.

Test #37:

score: 0
Accepted
time: 11ms
memory: 4376kb

input:

1000 1000
.EFA.YUPBMIUK.CSBRM.XZM.XBX.HHDKKBL.ST.XATVYDVCDBFPFJPU.DRV..WK.TYM.IRI.BVERBB.ALYMJNBXDSTTUJYN.LYIAQTFOMKLEIXHPZGS.BFRAVJXGGBEU.AUQRDSRCOJZYLOJLWASW.I.AVSNDP.LUUIYAKB..DIDNLXBHOSDSUUYQUTYKADLX.HQHZAGOFWGNN.ZBVBL.RTSZNGDUEPWHO.AZS.SBAVXEZTODPCMDA.EMGVHWTP..XQCLGGBTIHQ.LFPZQFW.LEMBX.U.HZL.H...

output:

YES
EFA.YUPBMIUK.CSBRM.XZM.XBX.HHDKKBL.ST.XATVYDVCDBFPFJPU.DRV..WK.TYM.IRI.BVERBB.ALYMJNBXDSTTUJYN.LYIAQTFOMKLEIXHPZGS.BFRAVJXGGBEU.AUQRDSRCOJZYLOJLWASW.I.AVSNDP.LUUIYAKB..DIDNLXBHOSDSUUYQUTYKADLX.HQHZAGOFWGNN.ZBVBL.RTSZNGDUEPWHO.AZS.SBAVXEZTODPCMDA.EMGVHWTP..XQCLGGBTIHQ.LFPZQFW.LEMBX.U.HZL.HGQL...G...

result:

ok Correct.

Test #38:

score: 0
Accepted
time: 20ms
memory: 4376kb

input:

1000 1000
.DEABUNIECDFTUYSXMIRUXYFCUZSTHBLSF.X.ENER.ICAXCG.ZVHTEMJULIQMMGCODDAWNCT..RGX.MZMZEELLDRZNE.HMKXUK.L.EAYFMDXSETLOIPSN.PMFITTGPGVQT.ZN..WEQ.QCTJBYCXMWZHONLWPWPAZBJ.LBHGQQ.DYXZLSXGW.R.YTRIWM.LMS.DP.SCEGDSEEUCXRVP.JGFLFYXEDXNXNVQKKDGGOBCIH.TIMSDLVKUMSIH.YGGIOGYVFEEAFKIFXG..R.QUFRNMPNWQBOGSQAH...

output:

YES
D.A.UNIE.DFTUYSXMI.UXY.C..STH.LS..X..N.R.ICA.CG.ZVHTEMJU.IQMMGCODDA.N....RGX.M..ZEELLDRZNE.H.KXU..L.EAYF.DXSETLOIP.N.PM.IT.GPG.QT.ZN....Q.Q.TJBYCX.WZ.O.LWPWPAZBJ.LBHG...D.XZL.XG..R.YTRIWM.LMS.DP.S.E.DSEEUCXRVP.JGFL.YXE.XNX.V.KK.GGO.CIH.TIMSD.VK..SIH.YGGIOGY...EAF..F.G.....U..NM.NWQ.O.SQAH.O.HZBZ...

result:

ok Correct.

Test #39:

score: 0
Accepted
time: 20ms
memory: 4368kb

input:

1000 1000
.TVYCUGGIMJMYOKVYZG.UPGOKUCMEHFBZLTVVHQWJDGCFBEZDPBTVSNVID.UXLFWOTWX..CIUYWUICWP.EQNRE..SXNUEJ.KGQKR.EURQP.NVCFUDVPBNRPFA.APB.EOOSSY..EVP.BFBTKUQOTHHNQCSI.L.ECGGDBCLSERQKHPWYJFXOLK.NTNY.XCPPGHFXVJE.UGZ..EBPXJKJ.MBRBAYFECGIFBF.KG.JZAT.YA..QAMNMDHCEOVWZVHXTDVXUJGC.YMWWUX..OOR.QAVKCGLUFIDEONU...

output:

YES
T.Y.UGG.MJ..O.VY.G..PGOK.C.EH..ZLTV.HQ..DG....ZDPB...N.ID.UX..W.T....CIUY.U..W..EQNRE...X.UEJ.K.QKR.....P...C...V.B.R.F....B.E...SY..E.......KUQOT..NQ.S..L.EC.G.BC..ERQ..PWYJFXOL..N.NY.X.PP..FX.J..UGZ...BPX.KJ...RBAYF.CG.F...KG.JZ.T.YA...AMN.DH.EOV.Z..XT.VXU....Y........O..QA..CGLUFIDEONU.P.WO.T...

result:

ok Correct.

Test #40:

score: 0
Accepted
time: 21ms
memory: 4544kb

input:

1000 1000
.UVJ.HHDYINQXSFEEZFLY.QDEOVACYPM.PMKWBBWTOMUBBACYKDNBYCAMUAPWDXFYZWVAMLLJ.AFDRCQAV.LPRBCHV.BUVVJXXYHRFUM..WQBPLQF.DLRUYAIKY.DPGLWKJAZRDIILTDLAD.IJM.SO.OIFVLVFCUHCT.LAXAGHDHVVKAQGYTUERMWBFRPQRPBDLLTOGKA.E.BWUQNENXPVFWWTVYVK.JL.WWXICG.OYMSOHRRZZJ..CEAOVHEQIS.LMBJNXURGLQJBIPPEBKY.O.TRXUYJH......

output:

YES
...............E..LY.Q.E.VA..PM..M.WBBWTO...B.CYK.N..CAMUA...X...WVAML...A.DR......PR..HV..U..J...HRFUM...QB..Q..D.RU....Y..P...KJ.ZR.IIL.DLAD.IJ.....O.FVL.F.UH...LAXA.HD...K.QG.TUE...B.RP...BDLLT.G.A.E..W..NEN..VF....Y.K.........G.OY....R.Z.J..CEA....Q...LM..N.URGLQJ.IP..B...O..RXUY.....U.S.LOH...

result:

ok Correct.

Test #41:

score: 0
Accepted
time: 13ms
memory: 4540kb

input:

1000 1000
.PDEBKFYBQ.NC.LRSEECWOELCLU.BWAHI.XV.TJZQBMQQI.TFFLLFKVAFVMG.AX.ESOPFPY.YCQTVPPSVLFH.CCHQBIOIFBOWNIEKGCQDPKVI..VQJX.BZVIRCNMRXUVBYCWDMWQDLVC.HFFSRACRDMVKWQVDITTNWBGNNQMXWL.OQOZVRTBHYJVDRCFOLBWHUEPYBMXQYPHUEUZYLANFNXGSEUSF.IQDXZB.D.TPYMMIUXDRK.MHYRUDUWMPKE.XPPTGIITGWTKIORNCJHA.B.KDLWSEL.RUN...

output:

YES
...B......NC..R.E........U.B..H.............I..F.....V...........O............S.L.........O...OW..........V.............C....UV.Y.....QD..C..FF...C..........T...B...QMX...O..........VDR..OL..H...Y..XQ.............XG....F..Q...B.D.......UX....................T.........O.....A.......S......V..BZ.....

result:

ok Correct.

Test #42:

score: 0
Accepted
time: 16ms
memory: 4364kb

input:

1000 1000
.PPG.NQPNBYORDXVDN.KWLWJPW.HDX.WCNRWZSWLPUOOGAKKTXAYE.KZV.DD.Q..WHSRLIQZPMMQKTJLZWE.IF.SUVMAIVSEL...BXAAWAURQMZBQ.LSUCGPNMFXZMFX.DYMUKPHA.HMJUKMPDWSVPGQR.JSZIJKCTVVHETWCQG.OTOQFQGLI.S.QUHWTCXHUTYBWRS.JYHCK.CLDIMF.A.Z.GU.INRFVKU.VVUJAHWIVBTF.FSNDOPCFLXXT.LJCWDPUVGGZAOTXSAQLBXBWMJOBRTWCM.POY...

output:

YES
..........................................................................................................................................................................X...........................................................................................G.........................Y..........

result:

ok Correct.

Test #43:

score: 0
Accepted
time: 13ms
memory: 4144kb

input:

1000 1000
.HBE...ZCY.TXH..AYMVG..GZFO..M.YAOZIZKS.ILML.J..BWCIWWYL......OM....NZ.N.....UH.HD.VHCRDI..WEP..AUUPDZP.QHM.ZMUT..CK.E.P.W.J..F.AIY...FPFVSHCI.H.N..K.....C.WI...ODR.XOZ..I.ZT.RO..MEC..RV.X.IY..S.QL.YXM.FSM.YQP.IC.K.C.GCL.Y.F.FI.CFGKS.MX..JV....CU.M..K..NY.FH.KY.GRY.V.BX...I.HAE..EKWL..AP.O...

output:

YES
...........................................................................................................................................................................................................................................................................................................

result:

ok Correct.

Test #44:

score: 0
Accepted
time: 16ms
memory: 4540kb

input:

1000 1000
....................................T...I...L.....W.......................X..CE.........U.............E......................F.K.......D...XR...Q.....D.....C................M..........................................................................................................N............

output:

YES
...........................................................................................................................................................................................................................................................................................................

result:

ok Correct.

Test #45:

score: 0
Accepted
time: 8ms
memory: 4536kb

input:

1000 1000
...............................................................................M.............O......................................................................................................................................OS...............................................................

output:

NO

result:

ok Correct.

Test #46:

score: 0
Accepted
time: 8ms
memory: 4404kb

input:

1000 1000
.....................................................................................................................................................................................................................................................................................................

output:

NO

result:

ok Correct.

Test #47:

score: 0
Accepted
time: 15ms
memory: 4528kb

input:

1000 1000
.VKCQQI.KRWGIWNWR.IEQSJIQMHXHQIEQSOL.PGPAIRULWBFCZXBQ.DAYYTRCZPZKFZVGRHLVJSDTLYJPTNRWAFJDBUJQ.CJRURR.CICDNZFSB.PIBBUOWEZBREBKPKQRBDTPOOZTDAWKHHDLZNDLENILCHFKVBNKNUCDRPMZXBWY.FBQXQUHAOUWL.NOAV.WNCN.SXECYMLAUPTXESE.SRMIAYKC.BR.NRSW.OMCPWL.PZDYLJDQIG.MUZFV.KQTUEUN.GOGYCGFGMZJBXWPINNKP.GCEJTWL...

output:

YES
VKCQQI.KRWGIWNWR.I.QSJIQMHXHQIEQSOL.P.PAIRULWBFCZXBQ.DAYYTRCZPZKFZVGRHLVJSDTLYJPTNRWAFJDBUJQ.CJR.RR.CICDNZFSB.PIBBUOWEZBREBKPKQRBDTPOOZTDAW.HHDLZNDLENILC.FKVBNKN.C.RPMZXBWY.FBQ.QUHAOUWL.NOAV.WNCN..XECYMLAUPTXESE.S.MIAYK..BR.NRS..OMCPWL.PZDYLJDQIG.MUZFV.KQT.EUN.GOGYCGFGMZJBXWPINNKP.GCEJTWLAZFEZTG...

result:

ok Correct.

Test #48:

score: 0
Accepted
time: 14ms
memory: 4364kb

input:

1000 1000
..HBOGEV.WGWNL.XDANPUKVBERPKGQJNTWDRY.SHV.LMAHPWO.EZLSYUHHMTRITSSLTOYCAPTEZO.EHDO.CPJFIAXS.FXZZZJYHSWBF.DGYATXIYPYNSATZJWOH.OJKUAGRWWEWH.YDE.QFWPVT..SEHIZQER.L.ZVGGHDHJEQWK.LWGSQCNL.T.ATZFSVGXMUJZOBNZWQIUNOWOOREOLFXSKCNNKCLZQPXAV.DFSKNWG.XLXT.DWJ.VZGTAK.CASZBJUZTMICFUIM.ATKLHMKWYVVFUYLW.RM...

output:

YES
RHBOGEV.WGWNL.XDANPU.VBERPKGQJNTWDRY.SHV.LMAHPWO.EZLSYUHHMTRITSSLTOYCAPTEZO.EHDO.CPJFIAXS.FXZZZJYHSWBF.DGYATXIYPYNSATZJWOH.OJKUAGRWWEWH.YDE.QFWPVT..SEHIZQER.L.ZV.GHDHJEQWK.LWGSQCNL.T.ATZFSVGXMUJZOBNZWQIUNOWOOREOLFXSKCNNKCLZQP.AV.DFSKNWG.XLXT.DWJ.VZGTAK.CASZBJUZTMICFUIM.ATKLHMKWYVVFUYLW..MIVBA.LN...

result:

ok Correct.

Test #49:

score: 0
Accepted
time: 9ms
memory: 4412kb

input:

1000 1000
.ERZINQ.NXXFQANJCQINMCSPUQYBKF.QFYN.TPRUQDGEB.GNOMYVWU..MYNWJHG.ZCVK.DVO.NQ.LCJMSQDPNGMOGFGSX.KGTCN.PDA.ZFBDPZFEEJHBKASYZDJ.UBKJW.BETKIMP.WRLBXD.FYOJAGYONFOKO..AQLXWWBPMFZZFOHHLUOVVY.PDLULHAXD.XND.JBHY..DLJTAU.REQEQRICRP.BHD.KLYEXJFPZEH.AJMHDTOIQKTZ.Y.PWG.LNLKAQPXTUFNDAGFGMYWSAXZOBCORPUJUR...

output:

YES
ERZINQ.NXXFQANJCQINMCSPUQYBKF.QFYN.TPRUQDGEB.GNOMYVWU..MYNWJHG.ZCVK.DVO.NQ.LCJMSQDPNGMOGFGSX.KGTCN.PDA.ZFBDPZFEEJHBKASYZDJ.UBKJW.BETKIMP.WRLBXD.FYOJAGYONFOKO..AQLXWWBPMFZZFOHHLUOVVY.PDLULHAXD.XND.JBHY..DLJTAU.REQEQRICRP.BHD.KLYEXJFPZEH.AJMHDTOIQKTZ.Y.PWG.LNLKAQPXTUFNDAGFGMYWSAXZOBCORPUJUR.EMIE.U...

result:

ok Correct.

Test #50:

score: 0
Accepted
time: 14ms
memory: 4204kb

input:

1000 1000
.THOCTULZ..WAT.G.SNOIDVQWZB.NQIMZPBVX.ISIXGQQXVVBYJXXIWXOYFSIQ.QDKDEYBINJZ.B..BDYQEEXFSWR.ROG.EXWKHICUNSYNVNOPOOALSGY.YFFDTWTN.WYVIRBQLKCAC.GE.YGOZDPKSF.LLNFY.JVLD.ELOJIPIKETZRQFIZIBPLAF.QMIEAXZ.VHYJB.SHGB.THGSJDSUIRKN.FGZAZWXOVVRYFTNW.SZQNILLVQILCQSBUT.AASSWVY.KLISXFPUMFFZSOAVDHHWMN..IL.Q...

output:

YES
THOCTULZ..WAT.G.SNOIDVQWZB.NQIMZPBVX.ISIXGQQXVVBYJXXIWXOYFSIQ.QDKDEYBINJZ.B..BDYQEEXFSWR.ROG.EXWKHICUNSYNVNOPOOALSGY.YFFDTWTN.WYVIRBQLKCAC.GE.YGOZDPKSF.LLNFY.JVLD.ELOJIPIKETZRQFIZIBPLAF.QMIEAXZ.VHYJB.SHGB.THGSJDSUIRKN.FGZAZWXOVVRYFTNW.SZQNILLVQILCQSBUT.AASSWVY.KLISXFPUMFFZSOAVDHHWMN..IL.QOXIGJK....

result:

ok Correct.

Test #51:

score: 0
Accepted
time: 15ms
memory: 4348kb

input:

1000 1000
.NNGL.U.FBTKNXHXAFTLMLFIHLFIXDBLHZNN.WLHNUELBRDSCJFLLCDZTJZ..CDGECUPH.F.MWBYWRTAWTLBWIB.QF.HVTFTYQOVVGMSXXBTNHHXUZATHBHNHV.UYTSSCVOFPOCRZCD.OCU.MQAEILPSYWLED.URMHMSXSLGI.RJKROYQLAAOIBGYVVXVD.T.WG.ZSVIPPNQB.FSQAG.UMHYNKLUCSOFBK.WOSMVUQZRBPO.VLJZHBV.AMLCFKXZAR.P.YJOAMGIW..YYKBHNZ.TDGWCME.JA....

output:

YES
NNGL.U..BTK.XHXAF.LMLFIHLFIXDB.HZNN.WLHNUELBRDSCJFLLCDZTJZ..CDGECUPH.F.MW.YWRTAWTLBWIB.QF.HVTFT.Q.VVGM.XXB.NHHXU.ATHBHNHV.U.TSSCVOFPOC.ZCD..CU.MQAE.LPSYW.ED.URM.MS.SLGI.RJK.O.QLAAOIB.YVVXVD.T.WG.ZSV.PPNQB.FSQAG.UMHYNKL..SOFBK.WOSMVUQZRBPO.VLJ.HBV.A.LCFKX.AR...Y.OAMGIW..YYKBHNZ.TDGWCME.JA.GPYCHS....

result:

ok Correct.

Test #52:

score: 0
Accepted
time: 16ms
memory: 4544kb

input:

1000 1000
.KEMKWAYMRCRUOH.WYNPC.JCFSPZNM.EVMVLCFIEN.JQZFDAQETQQPSLFMFPOL.VLVFAW.Z.NNWOBPVFLLWVGPCWJQWCUSIHSOE.WX.YYYJNO.O.IQVMFVG.BZACL..JNVZQ.L.USHAOXBALQFWXB.DRLYRVKBF.ASFRLFFYMQGJZVMZSIVQFJKSJCFKB.FWZFK.RUBLZHEQ.BZKUXETRULWAPQGNDWMLY.WYRAYD.A.DT.FNWPKBEMXFOYMQRW.N.GUPR.PZ.MOCLXEYOLVMTSSUBILSLVAHD...

output:

YES
...K..................C..P.N...........N.........T.....................N.W.B.......................W...................................S.A...............R.......F.............................Z.......Z.E.............A........Y.............F....B................R.P.......E........U...S........X......

result:

ok Correct.

Test #53:

score: 0
Accepted
time: 15ms
memory: 4420kb

input:

1000 1000
.DVWLYCUZIHRAJFJOZH.DJEIA.RFZBMMADGYCIZ.OHFVJEKNK.HH.QHB.QHKLDDJSU.UEVGQMLAN.BYUSLKGXZOITKNTYSEQ.KZWG.WSGVVWHO.YRUMYAFQAAWZCQOGFD.JIABJP.USF.N.LNPDCJCGCV.WU.AACMBPHJUEIWUV.ZCXYALY.KUJMSIK.O.ZYMTJIXYX..W.RQZYVPBO.O.LBJJ.EEZPHQ.WSBFMTXCMLGKKZR.EU.Z.ODZ.FREWDGSWS.LIIEOLV.TIVRJIK.FOECGA.QSATAK...

output:

YES
..W.Y..ZI.R....OZH.D.E.A........D.YC....HF...K.......HB.......JS......QM.....Y...KG...I..NT.......WG......W..........QA.W....G.......J......N..NP.....C........M..H.U.I.U......AL..K..M.I..O..Y..J.............P...............Q....FMTXC..G.K.R..U........R.....W..L...O.......J......C........K...Y.Y....

result:

ok Correct.

Test #54:

score: 0
Accepted
time: 17ms
memory: 4328kb

input:

1000 1000
.HZMFAX.HJPEHCAKYURF.RDHMXPVBNAQOOJB.MVLPXIYBQ..AASHLENXIHETILINR.QMLT.WFLKCAM.PJEFGPMES.GEHCVBWKUW.EFRCS.PQTVRYS.KM.MLYCFVDQMTNONDDTCG.TZAGGJUVABEH.IZSDNXWHAVFRRLFHMX.HUNK.CVHSZ.SUDGU.BSWGJTSFCJXCOMJQEHRAKCNWUNWRGFGQPNRPOWTBCPHYP..GAUUUMAYXNNXZAULDZHLRD.QDHCUAARNAQWOOTNUJKELLBCCPOP.HCODMH...

output:

YES
HZMF...H.P..CAK......D.M..V.N.QO.J..MVLP.IY.Q....S.....I.ET.LIN..Q.LT...LK.AM..JEF......G...V...UW.....S..Q..R.S.KM.MLY...D...N.NDD..G.TZ..GJUV.....IZSDN.W..VF.R.FHMX.H.N......Z..UDGU.BSWGJ..FCJ.C.MJQE...K...UNW.G.G.PNR....BCPH.P..GA.U.MAY.N.......Z.LRD...H...AR..QW..TN....LL..CPOP.H.O..HY.........

result:

ok Correct.

Test #55:

score: 0
Accepted
time: 14ms
memory: 4584kb

input:

1000 1000
.S.FIYMOI..MQ.ZFWBHJU.SMJHI.RX.NIFHMCQUOMDMJEPHYVGDWV.OLRUREYURSAEM.VZ.VQSKUKOAEACMMEKELRBTGKS.JHLLPLXKPV.YSUBHYMLVOBICCCWRKLG.XOYBZENXMFHIOTYSGTIAVUGI.QT.URRZEOTKPCFNCBWGGFZIVOPMRVHOGOQ.YJTJITXBHXOILT.QQRQZ.BLTLG.YRIHTVNUALIIMPQISNLBUEHVQTVUS.EESTTHITUAKKD.FRGYZRXAWLE.TXW.MFADPBXFZ.QTEXYM...

output:

YES
S.F.YMOI..MQ.Z..BHJU..MJHI.RX.NIF.M..UOMDMJEP.Y...WV.OLR...Y....EM.VZ.V.SKU.OAEA.MM..ELRBTGKS....LP.XKPV.YSUB.Y....BIC.CWRK....O..ZEN.M.HIOTYSGT.AVUGI..T.U.R.EOTKP.FN.B..GFZ..O..R..O.O..YJ.JI.X.HXOILT.Q.RQZ.BLTLG.YRIHTVNUALIIM.QISN.BU.HVQTVU....ST.HIT.AK...FR.YZR.AWL......M.ADPBX.Z.QTE.Y.DROO.XA...

result:

ok Correct.

Test #56:

score: 0
Accepted
time: 12ms
memory: 4424kb

input:

1000 1000
.RBRW.HL.XFRZEMOUWLXIUPYV.TGOHSBBVV.VAPNRVP.AXAULVMQPJLSHQLKZHRYZXNCBB.DMLCJZHCYEOTOWGIVKW.EYP.YJUS.CHG.GZSLTQMY.AKFRPUMKVJAFHEDJTTR.UWYMSV.CVUKVZWCOEGVPDKP..YVLGIG..WPEDTSIAWQUWTZJOOXPGBOAHNY.O.FPXPOKAQBGOMNINHXSERYKYILLABGTBMSYKBHPZOUI.GOPJPYROTX.PEPCXMB.MSNNRHN.GKNLZ.JOIGMMXJWKN.JAYMZ.L...

output:

YES
.BRW.HL.XFRZEMOUWLXIUPYV.TGOHSBBVV.VAPNRVP.AXAUL.M.P.LSHQLKZHRYZXN.BB.DMLCJZHCYEOT.WGIVKW.EY..Y.US.CHG.GZSLTQMY.AKFR.UMKVJAFHEDJTTR.UWYM.V.CVUKVZW.OEGVPDK...YVL.I...WPEDTSIAWQUWTZJOOXP.BO.HNY.O.FP..OKAQBGOMNINHXSERYKYILLA.GTBMSYKBH.ZOUI.GOPJ.YROTX.PEPCXMB.MSN.RHN.GK.LZ.J.I.MMXJWKN.JAYMZ.L..VPLEQ...

result:

ok Correct.

Test #57:

score: 0
Accepted
time: 15ms
memory: 4424kb

input:

1000 1000
.UVE.BWTHRULI.MEQKFS.F.Q.KPRPSKJDDDLK.MKPDTLQZO.ZCBXWR.BBNOROKYL.ZIUTDGPKSN.LCGZWKUFMPM.XZLNXAY.S.N.Y.VMQPQRGCRNZUYJBSIWZG.ENONWOGABTB.VE.Y.NVI.TADDXYP.L.PF.GXGCQCIYGLKEGP..RVZZYWQYBQPSMCADMW.OUNKTQJPLYDRG..I.PHL.LNPDSJRE..XLBG.GYBCVAMNEIRCBGXYJBDSUB.QESZ.RNFTFGPHUPSAEVTE.BIRXJSUEFTY.LBTQS...

output:

YES
UVE.BWTHRULI.MEQKFS.F.Q.KPRPSKJDDDLK.MKPDTLQZO.ZCBXWR.BBNOROKYL.ZIUTDGPKSN.LCGZWKUFMPM.XZLNXAY.S.N.Y.VMQPQRGCRNZUYJBSIWZG.ENONWOGABTB.VE.Y.NVI.TADDXYP.L.PF.GXGCQCIYGLKEGP..RVZZYWQYBQPSMCADMW.OUNKTQJPLYDRG..I.PHL.LNPDSJRE..XLBG.GYBCVAMNEIRCBGXYJBDSUB.QESZ.RNFTFGPHUPSAEVTE.BIRXJSUEFTY.LBTQSJOWJOQM...

result:

ok Correct.

Test #58:

score: 0
Accepted
time: 15ms
memory: 4536kb

input:

1000 1000
.STXDDI..TODOZDSZE.O.E.YLBJOVWOZMF.ZZGNVBEIHVFIGY.NXZPHQY.FWBCCCU.IALMPSUMAOHTJOBILOFC..DVMWWGZWJ.PGAXACPPPQDIOEQZP.HLBYDZACYQFCDX.DKHAZ.X.DDORVTPQQ.DAAOPOO.XCQOGIJJEK.UAFVDVKTURBOR.SGS.ILPQEHUGSMFG..JOFQLYWPVLYXONQUGCPYCTR.PKDZINZAIPFNSFELLS.URLAMGZ.XJ.TPVEFUJTPBWXJATRWKLYERIVJKBUGFETILUF...

output:

YES
STXDDI..TODOZDSZE.O.E.YLBJOVWOZMF.ZZGNVBEIHVFIGY.NXZPHQY.FWBCCCU.IALMPSUMAOHTJOBILOFC..DVMWWGZWJ.PGAXACPPPQDIOEQZP.HLBYDZACYQFCDX.DKHAZ.X.DDORVTPQQ.DAAOPOO.XCQOGIJJEK.UAFVDVKTURBOR.SGS.ILPQEHUGSMFG..JOFQLYWPVLYXONQUGCPYCTR.PKDZINZAIPFNSFELLS.URLAMGZ.XJ.TPVEFUJTPBWXJATRWKLYERIVJKBUGFETILUFBKI.ULU...

result:

ok Correct.

Test #59:

score: 0
Accepted
time: 15ms
memory: 4376kb

input:

1000 1000
..I........................Z.......C......F.....B..........SW.....R.D.Z..S.LX...TR.....S.B.....B...I..P.R......S...T.BL.M......Z.U......R...............HB.G....K...........D.W....T...S......U..MIG.........UY.....D........M..........X.XK...........V......WT......H...................S..B.......

output:

YES
OI........................Z.......C......F.....B..........SW.....R.D.Z..S.LX...TR.....S.B.....B...I..P.R......S...T.BL.M......Z........R...............HB.G....K...........D.W....T...S......U..MIG.........UY.....D........M..........X..K..................WT......H...................S..B....V.........

result:

ok Correct.

Test #60:

score: 0
Accepted
time: 0ms
memory: 3652kb

input:

10 10
.GKUDKGMANA.
A..........H
N..........N
Q..........B
J..........V
Y..........P
O..........U
D..........T
X..........P
D..........E
U..........R
.NYOASKFGBM.

output:

NO

result:

ok Correct.

Test #61:

score: 0
Accepted
time: 1ms
memory: 3680kb

input:

100 100
.RRLADAYHEBSINAJACSHZANHTEJTYUOJFDGIAYODQDELQNYUDFSKZBGWJJTISIDZADCRPVJEYQIITKMPNDGIQYZDXWWMQETIPFBZO.
S....................................................................................................O
E........................................................................................

output:

YES
..........SINAJACSHZANHTEJTYUOJFDGIAYODQDELQNYUDFSKZBGWJJTISIDZADCRPVJEYQIITKMPNDGIQYZDXWWMQETIPFBZO
........EB.........................................................................................W
..LADAYH.........................................................................................

result:

ok Correct.

Test #62:

score: 0
Accepted
time: 14ms
memory: 4400kb

input:

1000 1000
.JAKFUFMSHIGMDNRMFGIOEQPSTWONZYFQVGFGMRMNNDDXPGARMHIBPXXESWLTWSIEQULLIXQRBHSJLSHZLJRNNBUEAESLQKNSZYHAEOANLMGYOHXOIOBQQECHNXSINXZCIQTHRFGPPRASDVWKGOGDCTBPHUHDUCYQOEMUCSKEXMSEUCJTXXRCUIJZKVPETRNOOAHANWWAPACUYNODHPMQKYWVUHMVHGWIAHSIEXUICRQDWKSUFWMZZLECVXMISJIKBSSWXUMOZHVXOKRYZYZZDMVIRNHGWYXYF...

output:

YES
................................VGFGMRMNNDDXPGARMHIBPXXESWLTWSIEQULLIXQRBHSJLSHZLJRNNBUEAESLQKNSZYHAEOANLMGYOHXOIOBQQECHNXSINXZCIQTHRFGPPRASDVWKGOGDCTBPHUHDUCYQOEMUCSKEXMSEUCJTXXRCUIJZKVPETRNOOAHANWWAPACUYNODHPMQKYWVUHMVHGWIAHSIEXUICRQDWKSUFWMZZLECVXMISJIKBSSWXUMOZHVXOKRYZYZZDMVIRNHGWYXYFJSBAJSR...

result:

ok Correct.

Test #63:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

10 10
.VBYCDNLKSW.
R..........U
S..........P
G..........M
K......x...Y
P.x....x...P
V..........A
R..........E
O..........V
R..........U
K..........Q
.XYOOIHYQZX.

output:

NO

result:

ok Correct.

Test #64:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

100 100
.BHMXXBSMUHVYTUTYDHQQYTVVMPXVCYWAIRJGBZBRJXMJAFBQBYYFCMYEIRAIDCELHMYCBONBFTIYVOBFIWLSXJRWKCJQRPSCFDNT.
C.....................................................................x.x.x..........................P
F.......x................x...............................................................

output:

NO

result:

ok Correct.

Test #65:

score: 0
Accepted
time: 15ms
memory: 4404kb

input:

1000 1000
.UIGXNGKSRDNDTUAEHIRNXLHRLSYYZMIATKNZXOPWKWNMKAPWJCGZVKJGMKVMRYVNOQGISKECIYCTYEIBUSWJLQEPIQCPXDJYPQZMGETFODCIFKLDHCHJRTZIVQFWNJUSNHSXNLXOATNASASFSHHDOHGUBCYDEAQYJLDVJEWTKOPDXAZTSXACZKUTOGOLPPXYNLXAMHURAITERGIMPDUTOXSHQCIYEWPMMZDCMXSJWLXHQQNQHBFSXEUGBAOBQEQIEIBJBZSDCPWBYXUFYGKDCKDLMSLUORYRO...

output:

YES
.........DNDTUAEHIRNXLHRLSYYZMIATKNZXO.WKWNMKAPWJCGZVK.GM.VMRYVNOQGISKE.IYCTYEIBUSWJLQEPIQCPXDJ.PQZMGETFODCIFKLDHCHJRTZIVQFWN.USNHSXNLXOATNASASFSHHDOHGUBCYDEAQYJLDVJEWT.OPDXAZTSXACZKUTOGOLPPXYNLXAMHURAITERGIMPDUTOXSHQCIYEWPMMZ.CMXSJWLXHQQNQHBFSXEUGBAOBQEQIEIBJBZSDCPWBYXUFYGK.CKDLMSLUORYROXCNDPPJ...

result:

ok Correct.

Test #66:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

10 10
.UTSAZHTXYX.
L.........xX
C......x...I
T......x...W
E..........Y
M.x........T
S..x..xx...H
H.....x....S
U......x...J
U..........B
A...x..x...C
.OHMGKKTKQH.

output:

NO

result:

ok Correct.

Test #67:

score: 0
Accepted
time: 0ms
memory: 3880kb

input:

100 100
.JAFDLLBUUSDKENTKACNZBYKAYOXBHHKRQEPYWPNKYNKNZTKJEMOUFFEKSLCCQAVMCDRCJZQGITTGNKADWZTJAVNUCEEUVDKRDXQB.
A.........................x...................................x......................x.....x....x....R
K...........x...........................................x...x.x..........................

output:

NO

result:

ok Correct.

Test #68:

score: 0
Accepted
time: 15ms
memory: 4444kb

input:

1000 1000
.NULNZJLOQREAOHHZRSBEMIOAYQYPGEJVXWIOCNCFXXHIYOXXJKNYZPCTLSDMXLAJVURIIYKXOHFRIYYEIQUXGCANJFFGDGCPJQOXHSIXDMJYURIOTHZYUUKNZJAVQIGPFNENLBEFLTVNMRSXWDWDSEGVVAVUIICAFNCKLATYOUCZYYYFWFSMWKIKOKYJHCTXQFAIPPVHQRBMTIBGRTJNTSSAZZCVHMRKNJXRGTGKRWKDAMXITEPONEAXWRVASSXXAMANWYAASZTQXEFHAUKJHPGLIUBPOJXIR...

output:

YES
..........................................................................................................................................................................................................BMTIBGRTJNTS.AZZCVHMRKNJXRGTGKRWKDAMXITEPON..XWRVASSXXAMANWYAASZTQXEFHAUKJH.GLIU.POJXIRKVGXO.U...

result:

ok Correct.

Test #69:

score: 0
Accepted
time: 0ms
memory: 3656kb

input:

10 10
.XIIYSTPPDQ.
J..........L
H..x.......Q
K..........T
R.....x....C
Bx.........G
T.x........A
C..x.......H
A.x...x....T
P.......x..L
U.....xx...R
.BTHGJRRIEM.

output:

NO

result:

ok Correct.

Test #70:

score: 0
Accepted
time: 0ms
memory: 3652kb

input:

100 100
.WCHFDUVNQZXTXCLWYSNAMVUBFQXPIJYHUVUQKFZURHQDYDWCCAFFEDNJZGAAEIMAUUCYZFLMWFNHXKZTOHXEAHCDUCZQGJCBOHXN.
Yx.xxx.x.x.x.xx..x..x.x..xx..xxxx.x..x.xxx..x.xx.xxxxxxxx..x..x..xxxx........x...xxxx..xx.xxxxxx.x..xY
M.............x.............xx............x.xx...........x.....x.........................

output:

NO

result:

ok Correct.

Test #71:

score: 0
Accepted
time: 16ms
memory: 4412kb

input:

1000 1000
.YYQPCIJLWNSKJEJHGBDWKBONGSKGORSBWFMZGIUGNBBQQKJZGOIBVLRKOAMMMVFGZJFECUVWDYDUVAGEXXRGFKBQSQITXJQBDMLMIKWMLWNJFLYMAISFAWZJUUOPLCPYOHQHKUWOLTVRTIVLZGMCWTVKHQDMRMSZXUEJIPTRWNDRZTXBDZCXBXSJWWLZDTPZSULUACNKGWNVEPYVBGOKXAATPWSSKZAXSTWKALPLHEIYOHQNFDHBCMGSQEUKIKXBVUHBOBLPBVZNAHPMCDKXQYSIFEVLVAEDJ...

output:

YES
....................................................VLRKOAMMM.FGZJ.ECU.WDYDUVAGEX.RGFKBQ.QITXJQBDMLMIK.MLWNJFL.M.ISFAWZ.UUOPLCPYOH..KUWOLT.RT..LZGMCWT..HQDMRM.ZXUEJ.PTRWNDRZTXBDZCXBXSJWWLZDTPZ.ULUACNKGWNVEPY.BGOKXAATPWS.KZAX..WKALPLH.IYOHQNFDHBCMGSQEUKIKXB.UHBOBL.BVZNA.PMCDKXQYSIFE.L..EDJBLDOJQF...

result:

ok Correct.

Test #72:

score: 0
Accepted
time: 0ms
memory: 3536kb

input:

10 10
.EACBPCUCNR.
D..........S
I...xx.....J
U..........V
E.....x.x..C
M..........O
R....x....xI
A.x........V
G.x........H
K..........V
C..x..x....L
.HGFJIYQZSZ.

output:

NO

result:

ok Correct.

Test #73:

score: 0
Accepted
time: 0ms
memory: 3688kb

input:

100 100
.JAJHQEAHMORBUNSADNSXTEJGNXBWFSMMGROIGWLNLYNMCUXZFGRDHSPLKIPVJBHGTZWCEIOSCNGLCGZNCKCDDXYAMDVRKCXYYCXV.
Wx...............xx.x....x.xx...xx....xxx..x........................x.....x.....x............x.......N
R........x.............x....x.....x....x......................x....x.....................

output:

NO

result:

ok Correct.

Test #74:

score: 0
Accepted
time: 16ms
memory: 4412kb

input:

1000 1000
.BHUNFMSMVENVZNPGULRKVZVELQNXNJTIAKLSLZPXABRTIDVWCOPHAIOXNJUMTINGHMPAOJKESKKSEYRHYDDUJSYTUBMCDPJSJLSTBBLJAJYVPWNFLFKXZYJKPGCNLSBUSOCBEJDXSWEAJDMGGGBCAYZKSCADVQMYUXDUCQLRAXMEWVSEPLQIYXOWEJVPRKTKZNXKGWFBWERACNJLCWPECUAMFPEHNUCNBCUHQZZIFPVUXDWTVGYKOTPVLWXUZZAYIZGPJFTEWEOBZGRSFNBGZEHJCCTGVWHTE...

output:

YES
.......................................................................................TUB.CDPJSJLSTBB.JAJYVPWNFLFKXZYJKPGCNLS.U.OCBEJDXSWEAJDMGGGBCAYZKSCADVQMYUXDUCQLRAXMEWVSEPLQIY.OWEJVPRK.KZNXKG.FBWERACNJLCWPECUA..PE.NU.N.C..QZZ.FPVUXDWTVGYKOTPVLWXUZZAYIZGPJF.EWEOBZGRSFNBGZE.JCC...W..EOJEJUBI...

result:

ok Correct.

Test #75:

score: 0
Accepted
time: 0ms
memory: 3520kb

input:

10 10
.HTADQAQMWO.
B..........Z
S..........U
Z..........B
Ux.........C
F...x.x....X
K.x......x.B
R.........xO
M..x....x..V
N....x....xG
T.x......x.W
.UKMFGFPLKN.

output:

NO

result:

ok Correct.

Test #76:

score: 0
Accepted
time: 0ms
memory: 3628kb

input:

100 100
.WGLRIGBLIUDGFHSQADPGWNQUUWBCPCAHGIUAUEYYESTQXEOOEUMSOMYNYCNPXJCHGPPUQPRXJNSTYGYHUKCYYFMJMXUVOQLNBIWI.
Qxxxxxxxxxx.xxx.xxx.xx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxx.xxxxxxx.xxxxxxxxxxxxxxxxxxxxQ
Wx...........x.x...x.x..x.xx.x............xx...........x.x..x.....xx..x....x.............

output:

NO

result:

ok Correct.

Test #77:

score: 0
Accepted
time: 5ms
memory: 4752kb

input:

1000 1000
.NLZDUTQNBAWRYWRCMQXBUSCMTSVODXKKDWPZLPCFRFLFEZCGHSOKAFDOTVUQVNWHOTDWZFVZZTNRAADZNGBDAERKDYHPFOXEHLPEGHACTOCGWQZRAGDICHYHTNUHOMNZOQOVYZRSESIFRULCKNMKWNSZASXQETYEQECTZJHWHHVWXQRMWTIWAYUZIJMOMCKNCOIONIXWIJZINTFTIJLGGGEFNMZBIHPAUMWFKVNJIOMMHCHDDBEOITVQFNAEXNZVAHFUEIESQWMYUJBUHABQIJTGQMMFDSDKA...

output:

NO

result:

ok Correct.

Test #78:

score: 0
Accepted
time: 0ms
memory: 3544kb

input:

10 10
.KIATNNBQHI.
L...x......E
A..x.......H
Y......x...B
I.x....xx.xB
S......x.x.Z
J..........U
J........x.H
G...x......L
H......x.x.S
L...x......Z
.CXPLXPSIZR.

output:

NO

result:

ok Correct.

Test #79:

score: 0
Accepted
time: 0ms
memory: 3700kb

input:

100 100
.VUHOPFRWLYETEXERXRDCIVXPOJATRTEKQANWDHLBJHLICCFGCINTOGRTTFKJAIXRIJWRFQFGQCDMVOFMFMFROXUQFQYMRXUELVNL.
H..x............x..x............x.x...x...x.....x..x.......x..........x...........x......xx.......x..K
Q.......x.x.....x.......x.....x..x..............................x.x...x..x.x.............

output:

NO

result:

ok Correct.

Test #80:

score: 0
Accepted
time: 8ms
memory: 4424kb

input:

1000 1000
.VJZQSRRPMHKGNFWBCDXHIVWFLVOGNQMPUQXKGDFICDCGVSZLTUROODTOGKXIFZQCCYRTAVSONKGYXCNGWHWCUEUPOWFJFTARPLMHMFODRKKMIHHAJISAQGHUSWPVHPYETJHTDDBUDGWMIGDPIHRKNGCOAKDCTXZGKMYPCJXNLUTGNVMXXKSNTYNYRRKQQYNEISUYJKOZGLSCXBMUWTBLWVQMPOQVVDJGPFMIJNIGTRLIYISRVMPBMDJLINDNKOBTZTKIFQFKKOKKYIQIYOETBUGYFTFIJIEMM...

output:

NO

result:

ok Correct.

Test #81:

score: 0
Accepted
time: 0ms
memory: 3604kb

input:

10 10
.NAQRRDBDNF.
F.........xH
Nxx......x.A
L...x.x.x..D
V......xx..B
D.....x....I
C.x........J
E....xx....W
I..........Z
G..x.......C
B......x..xS
.TJGLWWRVRS.

output:

NO

result:

ok Correct.

Test #82:

score: 0
Accepted
time: 0ms
memory: 3700kb

input:

100 100
.PRJMCTWZORMJPQWDUMIELEICWQEHACOAUNKOVTBUCYJVBUKZFWMEVVXVEHDHNYSFDWHVRBEMFKXRISECTPNQJNJRXOYMZMPSVQNT.
F.......x........x..x.....x.....................xx..............xx.......x...................x.x.....Z
Sx....x..........x.......x...x........x....................x...x..............x..x.......

output:

NO

result:

ok Correct.

Test #83:

score: 0
Accepted
time: 8ms
memory: 4392kb

input:

1000 1000
.CREOVUSQSUBZHGCAMEHDHOEKYXWYDEVOBZAVCCAVPDWBJGLQQGURPAIXJWGJHIDUOFFPMOHFQTRBLWZGLFULTNRNPLJTLWTINHFTFPDVZPOBTAEYMJKHOIRZSISGGNKJTPSNXLHLKJAZCBYHLGGKJLRPMIHQTFLEYOXAEUXOXIGBOYLXFACCYYBPNZBPEQQHPLOCIAGQWQELHDJOYFYEBDUFBLCPYTPXUOGCZJWDRCXHHDKAEHZOCKOOCECYAGETYBJABTQZAGIVBLARAYEDKZSZUZZAQAHHI...

output:

NO

result:

ok Correct.

Test #84:

score: 0
Accepted
time: 0ms
memory: 3808kb

input:

10 10
.UTCQOMFRSG.
D.x.x.x....W
P.......x..L
Ux.........A
I..x.......X
Sx.......x.U
W.x..x.....V
C..x......xK
O....x.x.x.F
E..........N
S........x.E
.ZWIDVDMLFK.

output:

NO

result:

ok Correct.

Test #85:

score: 0
Accepted
time: 0ms
memory: 3540kb

input:

100 100
.CLKWQRYTKUGOIJWPVYEBSBTZDWMKXMUJGEMKRKJFRSPHADSSDYUTYPCBSFBBSSJGUFAREHPVHWQVWOEWDPNLRVFXXPPIYSDDUSUY.
Zx...x.x...x......x.....x..x...x..x..........x....x....x.........................x.........x........xC
J.............x...x............xx......x...x.x.........x.......x...x..........x..........

output:

NO

result:

ok Correct.

Test #86:

score: 0
Accepted
time: 4ms
memory: 4664kb

input:

1000 1000
.NZFEZUYNRISOCPIEAOOISHLWCREPCVAUFDECHSNVFHMJCDXSQOTTPBFSIFSJOWDVZQULKUWVFBLEYGHJDQNZKRWQYRMGFDIVHGQAGHROSZZNZLQRBODARKGAJTGAJHXFXREDREAYOJJEGSXCPGVSNERMUUIHYNBHVVVDFRLLXSHTLSOFRIUQVDPNRDLFAHIKRIRPXMGHMUEUKJUEEWZGFTGYNESQTGRRRYIZTXFELFODRZVGUKQXSKUFWWFIRVEQMFASWWUKVUJSWOKTDPNJPIDWZXSZQSKXD...

output:

NO

result:

ok Correct.

Test #87:

score: 0
Accepted
time: 0ms
memory: 3524kb

input:

10 10
.AAHAPMZFHH.
K..........Y
F......xx..Z
F.......x..Y
Y......x...Z
E..........X
Yxx.x......A
Y....x.....G
I.....x....W
S.......x..C
E..........U
.OTBPGWPSOV.

output:

NO

result:

ok Correct.

Test #88:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

100 100
.VLZZHFSYLELLKWHKTYGPRPVLXKTOVUSYLOTLHFHDOGWCHSKICKQJNYXRFFBLGLJFEKYIOPWSFDNKNVEIMIQWKOMYYBEQDWZNELWB.
Gx.......x.x..x....x...........x..........x.......x......xx..x....................x.x...x............A
Rx.....x.xx....xx.x.xx..................................x........x.............x..x......

output:

NO

result:

ok Correct.

Test #89:

score: 0
Accepted
time: 8ms
memory: 4376kb

input:

1000 1000
.XWGCCNEHTKSGEGYLDZPMUSEXZISJXQITQKYNZTBXHQPBCNTCOJLOEIHBRREEZBILHQWBRPUGZPBEKVCAIVBOSJUMXAOAPJHJYLKQHRYOTFSQGDOXXMBAABFUFDOVINZTXRTFTVSHGOEYLNGJFBAISGBMARUCGRKLBGBSSVEEZCJWIOUXOQAUQOIUOXWBREHTLMFAARFBINPIZFOJBGYPPDCPPPUNJKQFRQHDDVOJOZSODGIMSUGOYPFUNBKCTZKRDAILLJZUUXMPZSJSYQHJTUFLFDCEJWBRF...

output:

NO

result:

ok Correct.

Test #90:

score: 0
Accepted
time: 4ms
memory: 4832kb

input:

1000 1000
.AACADBEBCBCBDACDEDCBCCAEECCAAECCDBECCBBBECCDEEDCACBBAEAADDCEACCABCCECCAAECBCBCDCDDCAABBDADCCDCBBBDBEAAABDEEAEBCDBDDEAEACBDCADEADDCDECDABCBBEEEEEDECEBBADEBDBDDDAAEBEBCCCBACEDABBEAABEBCCAADCCECBAEBADDDCBBCBDDEAECBDBAEAABCADCAADDAAEEBAEABEADBADCACCCADCAEDEDACBADAEDEBABEEBBECCCECEDCBACDEBAACE...

output:

NO

result:

ok Correct.

Test #91:

score: 0
Accepted
time: 8ms
memory: 4852kb

input:

1000 1000
.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

output:

NO

result:

ok Correct.

Test #92:

score: 0
Accepted
time: 16ms
memory: 4408kb

input:

1000 1000
.CSUBCKBTFPZSKIIWUOHEGDHVTJNTLVDPVAJBLBUSOISEXNRUPHCWJCGJQSTUPIPZKMVHHREJWJCRHBNBEPYXVSVBTJPDLBVNLIGJGJFLNETPIAMVRCIBBZCTMQDFNUBBHUKIMVJRXULOKEUSNUYGXTVAVISTQICLQNMVTUKLIDWYNDWGDLFWHSYWLUFVHYIJYCYYRHKYYHSTTLQDHNYHTNXCHIQAYQQROFXNEEZELTDMHAFPOSZSQEMUNRNFDWYPSCPYSQREDNIFRKFSGIRFREIZLCCKKSZNN...

output:

YES
....................GDHVTJNTLVDPVAJBLBUSOISEXN.UPHCWJCGJQSTUPIPZ.MVHHREJWJCRHBNBEPYXVSVBTJP.LBVNLI.J.JFLNETPIAMVRCIBBZCTMQDFNUBBHUKIMVJRXULOKEUSNUY.XTVAVISTQICLQNMVTUKLIDWYNDWGDLFWHSYWLUFVHYIJYCYYRHKYYHSTTLQDHNYHTNXC.IQAYQQROFXNEEZELTDM.AFPOSZSQEMUNRNFDWYPSCPYSQREDN.FR.FSGIRFREIZLCC.KSZNNLSQMUKO...

result:

ok Correct.

Extra Test:

score: 0
Extra Test Passed