QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#669501#8935. Puzzle: Easy as ScrabblemaspyAC ✓67ms64232kbC++2315.5kb2024-10-23 18:50:132024-10-23 18:50:16

Judging History

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

  • [2024-10-23 18:50:16]
  • 评测
  • 测评结果:AC
  • 用时:67ms
  • 内存:64232kb
  • [2024-10-23 18:50:13]
  • 提交

answer

#line 1 "/home/maspy/compro/library/my_template.hpp"
#if defined(LOCAL)
#include <my_template_compiled.hpp>
#else

// https://codeforces.com/blog/entry/96344
#pragma GCC optimize("Ofast,unroll-loops")
// いまの CF だとこれ入れると動かない?
// #pragma GCC target("avx2,popcnt")

#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using u8 = uint8_t;
using u16 = uint16_t;
using u32 = uint32_t;
using u64 = uint64_t;
using i128 = __int128;
using u128 = unsigned __int128;
using f128 = __float128;

template <class T>
constexpr T infty = 0;
template <>
constexpr int infty<int> = 1'010'000'000;
template <>
constexpr ll infty<ll> = 2'020'000'000'000'000'000;
template <>
constexpr u32 infty<u32> = infty<int>;
template <>
constexpr u64 infty<u64> = infty<ll>;
template <>
constexpr i128 infty<i128> = i128(infty<ll>) * 2'000'000'000'000'000'000;
template <>
constexpr double infty<double> = infty<ll>;
template <>
constexpr long double infty<long double> = infty<ll>;

using pi = pair<ll, ll>;
using vi = vector<ll>;
template <class T>
using vc = vector<T>;
template <class T>
using vvc = vector<vc<T>>;
template <class T>
using vvvc = vector<vvc<T>>;
template <class T>
using vvvvc = vector<vvvc<T>>;
template <class T>
using vvvvvc = vector<vvvvc<T>>;
template <class T>
using pq = priority_queue<T>;
template <class T>
using pqg = priority_queue<T, vector<T>, greater<T>>;

#define vv(type, name, h, ...) vector<vector<type>> name(h, vector<type>(__VA_ARGS__))
#define vvv(type, name, h, w, ...) vector<vector<vector<type>>> name(h, vector<vector<type>>(w, vector<type>(__VA_ARGS__)))
#define vvvv(type, name, a, b, c, ...) \
  vector<vector<vector<vector<type>>>> name(a, vector<vector<vector<type>>>(b, vector<vector<type>>(c, vector<type>(__VA_ARGS__))))

// https://trap.jp/post/1224/
#define FOR1(a) for (ll _ = 0; _ < ll(a); ++_)
#define FOR2(i, a) for (ll i = 0; i < ll(a); ++i)
#define FOR3(i, a, b) for (ll i = a; i < ll(b); ++i)
#define FOR4(i, a, b, c) for (ll i = a; i < ll(b); i += (c))
#define FOR1_R(a) for (ll i = (a)-1; i >= ll(0); --i)
#define FOR2_R(i, a) for (ll i = (a)-1; i >= ll(0); --i)
#define FOR3_R(i, a, b) for (ll i = (b)-1; i >= ll(a); --i)
#define overload4(a, b, c, d, e, ...) e
#define overload3(a, b, c, d, ...) d
#define FOR(...) overload4(__VA_ARGS__, FOR4, FOR3, FOR2, FOR1)(__VA_ARGS__)
#define FOR_R(...) overload3(__VA_ARGS__, FOR3_R, FOR2_R, FOR1_R)(__VA_ARGS__)

#define FOR_subset(t, s) for (ll t = (s); t >= 0; t = (t == 0 ? -1 : (t - 1) & (s)))
#define all(x) x.begin(), x.end()
#define len(x) ll(x.size())
#define elif else if

#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second

#define stoi stoll

int popcnt(int x) { return __builtin_popcount(x); }
int popcnt(u32 x) { return __builtin_popcount(x); }
int popcnt(ll x) { return __builtin_popcountll(x); }
int popcnt(u64 x) { return __builtin_popcountll(x); }
int popcnt_mod_2(int x) { return __builtin_parity(x); }
int popcnt_mod_2(u32 x) { return __builtin_parity(x); }
int popcnt_mod_2(ll x) { return __builtin_parityll(x); }
int popcnt_mod_2(u64 x) { return __builtin_parityll(x); }
// (0, 1, 2, 3, 4) -> (-1, 0, 1, 1, 2)
int topbit(int x) { return (x == 0 ? -1 : 31 - __builtin_clz(x)); }
int topbit(u32 x) { return (x == 0 ? -1 : 31 - __builtin_clz(x)); }
int topbit(ll x) { return (x == 0 ? -1 : 63 - __builtin_clzll(x)); }
int topbit(u64 x) { return (x == 0 ? -1 : 63 - __builtin_clzll(x)); }
// (0, 1, 2, 3, 4) -> (-1, 0, 1, 0, 2)
int lowbit(int x) { return (x == 0 ? -1 : __builtin_ctz(x)); }
int lowbit(u32 x) { return (x == 0 ? -1 : __builtin_ctz(x)); }
int lowbit(ll x) { return (x == 0 ? -1 : __builtin_ctzll(x)); }
int lowbit(u64 x) { return (x == 0 ? -1 : __builtin_ctzll(x)); }

template <typename T>
T floor(T a, T b) {
  return a / b - (a % b && (a ^ b) < 0);
}
template <typename T>
T ceil(T x, T y) {
  return floor(x + y - 1, y);
}
template <typename T>
T bmod(T x, T y) {
  return x - y * floor(x, y);
}
template <typename T>
pair<T, T> divmod(T x, T y) {
  T q = floor(x, y);
  return {q, x - q * y};
}

template <typename T, typename U>
T SUM(const vector<U> &A) {
  T sm = 0;
  for (auto &&a: A) sm += a;
  return sm;
}

#define MIN(v) *min_element(all(v))
#define MAX(v) *max_element(all(v))
#define LB(c, x) distance((c).begin(), lower_bound(all(c), (x)))
#define UB(c, x) distance((c).begin(), upper_bound(all(c), (x)))
#define UNIQUE(x) sort(all(x)), x.erase(unique(all(x)), x.end()), x.shrink_to_fit()

template <typename T>
T POP(deque<T> &que) {
  T a = que.front();
  que.pop_front();
  return a;
}
template <typename T>
T POP(pq<T> &que) {
  T a = que.top();
  que.pop();
  return a;
}
template <typename T>
T POP(pqg<T> &que) {
  T a = que.top();
  que.pop();
  return a;
}
template <typename T>
T POP(vc<T> &que) {
  T a = que.back();
  que.pop_back();
  return a;
}

template <typename F>
ll binary_search(F check, ll ok, ll ng, bool check_ok = true) {
  if (check_ok) assert(check(ok));
  while (abs(ok - ng) > 1) {
    auto x = (ng + ok) / 2;
    (check(x) ? ok : ng) = x;
  }
  return ok;
}
template <typename F>
double binary_search_real(F check, double ok, double ng, int iter = 100) {
  FOR(iter) {
    double x = (ok + ng) / 2;
    (check(x) ? ok : ng) = x;
  }
  return (ok + ng) / 2;
}

template <class T, class S>
inline bool chmax(T &a, const S &b) {
  return (a < b ? a = b, 1 : 0);
}
template <class T, class S>
inline bool chmin(T &a, const S &b) {
  return (a > b ? a = b, 1 : 0);
}

// ? は -1
vc<int> s_to_vi(const string &S, char first_char) {
  vc<int> A(S.size());
  FOR(i, S.size()) { A[i] = (S[i] != '?' ? S[i] - first_char : -1); }
  return A;
}

template <typename T, typename U>
vector<T> cumsum(vector<U> &A, int off = 1) {
  int N = A.size();
  vector<T> B(N + 1);
  FOR(i, N) { B[i + 1] = B[i] + A[i]; }
  if (off == 0) B.erase(B.begin());
  return B;
}

// stable sort
template <typename T>
vector<int> argsort(const vector<T> &A) {
  vector<int> ids(len(A));
  iota(all(ids), 0);
  sort(all(ids), [&](int i, int j) { return (A[i] == A[j] ? i < j : A[i] < A[j]); });
  return ids;
}

// A[I[0]], A[I[1]], ...
template <typename T>
vc<T> rearrange(const vc<T> &A, const vc<int> &I) {
  vc<T> B(len(I));
  FOR(i, len(I)) B[i] = A[I[i]];
  return B;
}

template <typename T, typename... Vectors>
void concat(vc<T> &first, const Vectors &... others) {
  vc<T> &res = first;
  (res.insert(res.end(), others.begin(), others.end()), ...);
}
#endif
#line 1 "/home/maspy/compro/library/other/io.hpp"
#define FASTIO
#include <unistd.h>

// https://judge.yosupo.jp/submission/21623
namespace fastio {
static constexpr uint32_t SZ = 1 << 17;
char ibuf[SZ];
char obuf[SZ];
char out[100];
// pointer of ibuf, obuf
uint32_t pil = 0, pir = 0, por = 0;

struct Pre {
  char num[10000][4];
  constexpr Pre() : num() {
    for (int i = 0; i < 10000; i++) {
      int n = i;
      for (int j = 3; j >= 0; j--) {
        num[i][j] = n % 10 | '0';
        n /= 10;
      }
    }
  }
} constexpr pre;

inline void load() {
  memcpy(ibuf, ibuf + pil, pir - pil);
  pir = pir - pil + fread(ibuf + pir - pil, 1, SZ - pir + pil, stdin);
  pil = 0;
  if (pir < SZ) ibuf[pir++] = '\n';
}

inline void flush() {
  fwrite(obuf, 1, por, stdout);
  por = 0;
}

void rd(char &c) {
  do {
    if (pil + 1 > pir) load();
    c = ibuf[pil++];
  } while (isspace(c));
}

void rd(string &x) {
  x.clear();
  char c;
  do {
    if (pil + 1 > pir) load();
    c = ibuf[pil++];
  } while (isspace(c));
  do {
    x += c;
    if (pil == pir) load();
    c = ibuf[pil++];
  } while (!isspace(c));
}

template <typename T>
void rd_real(T &x) {
  string s;
  rd(s);
  x = stod(s);
}

template <typename T>
void rd_integer(T &x) {
  if (pil + 100 > pir) load();
  char c;
  do
    c = ibuf[pil++];
  while (c < '-');
  bool minus = 0;
  if constexpr (is_signed<T>::value || is_same_v<T, i128>) {
    if (c == '-') { minus = 1, c = ibuf[pil++]; }
  }
  x = 0;
  while ('0' <= c) { x = x * 10 + (c & 15), c = ibuf[pil++]; }
  if constexpr (is_signed<T>::value || is_same_v<T, i128>) {
    if (minus) x = -x;
  }
}

void rd(int &x) { rd_integer(x); }
void rd(ll &x) { rd_integer(x); }
void rd(i128 &x) { rd_integer(x); }
void rd(u32 &x) { rd_integer(x); }
void rd(u64 &x) { rd_integer(x); }
void rd(u128 &x) { rd_integer(x); }
void rd(double &x) { rd_real(x); }
void rd(long double &x) { rd_real(x); }
void rd(f128 &x) { rd_real(x); }

template <class T, class U>
void rd(pair<T, U> &p) {
  return rd(p.first), rd(p.second);
}
template <size_t N = 0, typename T>
void rd_tuple(T &t) {
  if constexpr (N < std::tuple_size<T>::value) {
    auto &x = std::get<N>(t);
    rd(x);
    rd_tuple<N + 1>(t);
  }
}
template <class... T>
void rd(tuple<T...> &tpl) {
  rd_tuple(tpl);
}

template <size_t N = 0, typename T>
void rd(array<T, N> &x) {
  for (auto &d: x) rd(d);
}
template <class T>
void rd(vc<T> &x) {
  for (auto &d: x) rd(d);
}

void read() {}
template <class H, class... T>
void read(H &h, T &... t) {
  rd(h), read(t...);
}

void wt(const char c) {
  if (por == SZ) flush();
  obuf[por++] = c;
}
void wt(const string s) {
  for (char c: s) wt(c);
}
void wt(const char *s) {
  size_t len = strlen(s);
  for (size_t i = 0; i < len; i++) wt(s[i]);
}

template <typename T>
void wt_integer(T x) {
  if (por > SZ - 100) flush();
  if (x < 0) { obuf[por++] = '-', x = -x; }
  int outi;
  for (outi = 96; x >= 10000; outi -= 4) {
    memcpy(out + outi, pre.num[x % 10000], 4);
    x /= 10000;
  }
  if (x >= 1000) {
    memcpy(obuf + por, pre.num[x], 4);
    por += 4;
  } else if (x >= 100) {
    memcpy(obuf + por, pre.num[x] + 1, 3);
    por += 3;
  } else if (x >= 10) {
    int q = (x * 103) >> 10;
    obuf[por] = q | '0';
    obuf[por + 1] = (x - q * 10) | '0';
    por += 2;
  } else
    obuf[por++] = x | '0';
  memcpy(obuf + por, out + outi + 4, 96 - outi);
  por += 96 - outi;
}

template <typename T>
void wt_real(T x) {
  ostringstream oss;
  oss << fixed << setprecision(15) << double(x);
  string s = oss.str();
  wt(s);
}

void wt(int x) { wt_integer(x); }
void wt(ll x) { wt_integer(x); }
void wt(i128 x) { wt_integer(x); }
void wt(u32 x) { wt_integer(x); }
void wt(u64 x) { wt_integer(x); }
void wt(u128 x) { wt_integer(x); }
void wt(double x) { wt_real(x); }
void wt(long double x) { wt_real(x); }
void wt(f128 x) { wt_real(x); }

template <class T, class U>
void wt(const pair<T, U> val) {
  wt(val.first);
  wt(' ');
  wt(val.second);
}
template <size_t N = 0, typename T>
void wt_tuple(const T t) {
  if constexpr (N < std::tuple_size<T>::value) {
    if constexpr (N > 0) { wt(' '); }
    const auto x = std::get<N>(t);
    wt(x);
    wt_tuple<N + 1>(t);
  }
}
template <class... T>
void wt(tuple<T...> tpl) {
  wt_tuple(tpl);
}
template <class T, size_t S>
void wt(const array<T, S> val) {
  auto n = val.size();
  for (size_t i = 0; i < n; i++) {
    if (i) wt(' ');
    wt(val[i]);
  }
}
template <class T>
void wt(const vector<T> val) {
  auto n = val.size();
  for (size_t i = 0; i < n; i++) {
    if (i) wt(' ');
    wt(val[i]);
  }
}

void print() { wt('\n'); }
template <class Head, class... Tail>
void print(Head &&head, Tail &&... tail) {
  wt(head);
  if (sizeof...(Tail)) wt(' ');
  print(forward<Tail>(tail)...);
}

// gcc expansion. called automaticall after main.
void __attribute__((destructor)) _d() { flush(); }
} // namespace fastio
using fastio::read;
using fastio::print;
using fastio::flush;

#if defined(LOCAL)
#define SHOW(...) SHOW_IMPL(__VA_ARGS__, SHOW6, SHOW5, SHOW4, SHOW3, SHOW2, SHOW1)(__VA_ARGS__)
#define SHOW_IMPL(_1, _2, _3, _4, _5, _6, NAME, ...) NAME
#define SHOW1(x) print(#x, "=", (x)), flush()
#define SHOW2(x, y) print(#x, "=", (x), #y, "=", (y)), flush()
#define SHOW3(x, y, z) print(#x, "=", (x), #y, "=", (y), #z, "=", (z)), flush()
#define SHOW4(x, y, z, w) print(#x, "=", (x), #y, "=", (y), #z, "=", (z), #w, "=", (w)), flush()
#define SHOW5(x, y, z, w, v) print(#x, "=", (x), #y, "=", (y), #z, "=", (z), #w, "=", (w), #v, "=", (v)), flush()
#define SHOW6(x, y, z, w, v, u) print(#x, "=", (x), #y, "=", (y), #z, "=", (z), #w, "=", (w), #v, "=", (v), #u, "=", (u)), flush()
#else
#define SHOW(...)
#endif

#define INT(...)   \
  int __VA_ARGS__; \
  read(__VA_ARGS__)
#define LL(...)   \
  ll __VA_ARGS__; \
  read(__VA_ARGS__)
#define U32(...)   \
  u32 __VA_ARGS__; \
  read(__VA_ARGS__)
#define U64(...)   \
  u64 __VA_ARGS__; \
  read(__VA_ARGS__)
#define STR(...)      \
  string __VA_ARGS__; \
  read(__VA_ARGS__)
#define CHAR(...)   \
  char __VA_ARGS__; \
  read(__VA_ARGS__)
#define DBL(...)      \
  double __VA_ARGS__; \
  read(__VA_ARGS__)

#define VEC(type, name, size) \
  vector<type> name(size);    \
  read(name)
#define VV(type, name, h, w)                     \
  vector<vector<type>> name(h, vector<type>(w)); \
  read(name)

void YES(bool t = 1) { print(t ? "YES" : "NO"); }
void NO(bool t = 1) { YES(!t); }
void Yes(bool t = 1) { print(t ? "Yes" : "No"); }
void No(bool t = 1) { Yes(!t); }
void yes(bool t = 1) { print(t ? "yes" : "no"); }
void no(bool t = 1) { yes(!t); }
#line 3 "main.cpp"

/*
先頭行から埋めていく
L がある場合, U と矛盾しない最初のマスに置いてよい
R がある場合, U と矛盾しない最後のマスに置いてよい
それ以外は, U があるなら U で埋める. U がないなら D で埋める.

1 行目以外はそうじゃない. D から仮置きしたものをこわしてしまう.

ああなるほど
各条件について最初の候補点を見る
候補点が衝突していればその点を禁止して候補点を更新
候補点の衝突がなくなったらおわり
*/

void solve() {
  LL(H, W);
  vc<string> A(H, string(W, '.'));
  string L(H, '?'), R(H, '?'), U(W, '?'), D(W, '?');
  {
    VEC(string, B, H + 2);
    FOR(i, H) L[i] = B[1 + i][0], R[i] = B[1 + i][1 + W];
    FOR(j, W) U[j] = B[0][1 + j], D[j] = B[1 + H][1 + j];
    FOR(i, H) FOR(j, W) { A[i][j] = B[1 + i][1 + j]; }
    FOR(i, H) FOR(j, W) if (A[i][j] == '.') A[i][j] = '?';
  }
  auto isin = [&](int x, int y) -> bool { return (0 <= x && x < H && 0 <= y && y < W); };
  int dx[] = {1, 0, -1, 0, 1, 1, -1, -1};
  int dy[] = {0, 1, 0, -1, 1, -1, 1, -1};

  // 方向, マス目, 文字
  using P = pair<int, char>;
  vvv(P, dat, H, W, 0);
  FOR(j, W) if (U[j] != '.') dat[0][j].eb(0, U[j]);
  FOR(i, H) if (L[i] != '.') dat[i][0].eb(1, L[i]);
  FOR(j, W) if (D[j] != '.') dat[H - 1][j].eb(2, D[j]);
  FOR(i, H) if (R[i] != '.') dat[i][W - 1].eb(3, R[i]);

  vc<pi> que;
  FOR(x, H) FOR(y, W) que.eb(x, y);

  auto check = [&](int x, int y) -> bool {
    if (dat[x][y].empty()) return 1;
    if (A[x][y] == 'x') return 0;
    set<char> ch;
    for (auto& [a, b]: dat[x][y]) ch.insert(b);
    return len(ch) == 1;
  };

  while (len(que)) {
    auto [x, y] = POP(que);
    if (check(x, y)) continue;
    if (dat[x][y].empty()) continue;
    A[x][y] = 'x';
    for (auto& [d, ch]: dat[x][y]) {
      int x1 = x + dx[d], y1 = y + dy[d];
      if (!isin(x1, y1)) { return NO(); }
      dat[x1][y1].eb(d, ch);
      que.eb(x1, y1);
    }
    dat[x][y].clear();
  }

  FOR(x, H) FOR(y, W) {
    A[x][y] = '.';
    for (auto& [a, b]: dat[x][y]) A[x][y] = b;
  }

  YES();
  FOR(i, H) print(A[i]);
}

signed main() { solve(); }

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

詳細信息

Test #1:

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

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: 3740kb

input:

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

output:

NO

result:

ok Correct.

Test #3:

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

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: 3700kb

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: 3992kb

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: 3988kb

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: 1ms
memory: 4140kb

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: 4112kb

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: 6ms
memory: 15200kb

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: 12ms
memory: 45000kb

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: 1ms
memory: 3712kb

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: 1ms
memory: 4092kb

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: 1ms
memory: 3800kb

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: 3900kb

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: 3960kb

input:

1 1
.M.
M.M
.M.

output:

YES
M

result:

ok Correct.

Test #16:

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

input:

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

output:

YES
FG
D.

result:

ok Correct.

Test #17:

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

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: 20ms
memory: 45484kb

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: 22ms
memory: 45084kb

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: 46412kb

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: 23ms
memory: 49220kb

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: 67ms
memory: 64172kb

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: 35ms
memory: 47716kb

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: 19ms
memory: 46116kb

input:

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

output:

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

result:

ok Correct.

Test #25:

score: 0
Accepted
time: 29ms
memory: 46196kb

input:

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

output:

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

result:

ok Correct.

Test #26:

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

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: 19ms
memory: 44688kb

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: 10ms
memory: 45176kb

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: 21ms
memory: 44820kb

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: 19ms
memory: 44532kb

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: 26ms
memory: 46388kb

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: 26ms
memory: 44576kb

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: 20ms
memory: 44652kb

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: 16ms
memory: 44948kb

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: 22ms
memory: 46036kb

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: 15ms
memory: 46232kb

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: 45800kb

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: 16ms
memory: 45660kb

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: 28ms
memory: 44848kb

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: 27ms
memory: 45316kb

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: 16ms
memory: 44960kb

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: 27ms
memory: 49396kb

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: 58ms
memory: 64232kb

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: 30ms
memory: 48876kb

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: 21ms
memory: 44960kb

input:

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

output:

NO

result:

ok Correct.

Test #46:

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

input:

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

output:

NO

result:

ok Correct.

Test #47:

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

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: 19ms
memory: 46168kb

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: 15ms
memory: 46336kb

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: 22ms
memory: 45168kb

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: 16ms
memory: 45296kb

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: 15ms
memory: 45988kb

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: 19ms
memory: 45264kb

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: 15ms
memory: 44980kb

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: 26ms
memory: 45516kb

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: 16ms
memory: 45516kb

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: 46180kb

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: 19ms
memory: 45368kb

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: 11ms
memory: 44424kb

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: 3692kb

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: 4368kb

input:

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

output:

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

result:

ok Correct.

Test #62:

score: 0
Accepted
time: 3ms
memory: 44936kb

input:

1000 1000
.JAKFUFMSHIGMDNRMFGIOEQPSTWONZYFQVGFGMRMNNDDXPGARMHIBPXXESWLTWSIEQULLIXQRBHSJLSHZLJRNNBUEAESLQKNSZYHAEOANLMGYOHXOIOBQQECHNXSINXZCIQTHRFGPPRASDVWKGOGDCTBPHUHDUCYQOEMUCSKEXMSEUCJTXXRCUIJZKVPETRNOOAHANWWAPACUYNODHPMQKYWVUHMVHGWIAHSIEXUICRQDWKSUFWMZZLECVXMISJIKBSSWXUMOZHVXOKRYZYZZDMVIRNHGWYXYF...

output:

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

result:

ok Correct.

Test #63:

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

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: 1ms
memory: 4076kb

input:

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

output:

NO

result:

ok Correct.

Test #65:

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

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: 3936kb

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: 1ms
memory: 4072kb

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: 27ms
memory: 44460kb

input:

1000 1000
.NULNZJLOQREAOHHZRSBEMIOAYQYPGEJVXWIOCNCFXXHIYOXXJKNYZPCTLSDMXLAJVURIIYKXOHFRIYYEIQUXGCANJFFGDGCPJQOXHSIXDMJYURIOTHZYUUKNZJAVQIGPFNENLBEFLTVNMRSXWDWDSEGVVAVUIICAFNCKLATYOUCZYYYFWFSMWKIKOKYJHCTXQFAIPPVHQRBMTIBGRTJNTSSAZZCVHMRKNJXRGTGKRWKDAMXITEPONEAXWRVASSXXAMANWYAASZTQXEFHAUKJHPGLIUBPOJXIR...

output:

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

result:

ok Correct.

Test #69:

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

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: 1ms
memory: 4308kb

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: 20ms
memory: 45724kb

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: 3672kb

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: 1ms
memory: 4104kb

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: 45212kb

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: 3716kb

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: 1ms
memory: 4132kb

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: 11ms
memory: 44940kb

input:

1000 1000
.NLZDUTQNBAWRYWRCMQXBUSCMTSVODXKKDWPZLPCFRFLFEZCGHSOKAFDOTVUQVNWHOTDWZFVZZTNRAADZNGBDAERKDYHPFOXEHLPEGHACTOCGWQZRAGDICHYHTNUHOMNZOQOVYZRSESIFRULCKNMKWNSZASXQETYEQECTZJHWHHVWXQRMWTIWAYUZIJMOMCKNCOIONIXWIJZINTFTIJLGGGEFNMZBIHPAUMWFKVNJIOMMHCHDDBEOITVQFNAEXNZVAHFUEIESQWMYUJBUHABQIJTGQMMFDSDKA...

output:

NO

result:

ok Correct.

Test #78:

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

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: 1ms
memory: 4032kb

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: 15ms
memory: 45624kb

input:

1000 1000
.VJZQSRRPMHKGNFWBCDXHIVWFLVOGNQMPUQXKGDFICDCGVSZLTUROODTOGKXIFZQCCYRTAVSONKGYXCNGWHWCUEUPOWFJFTARPLMHMFODRKKMIHHAJISAQGHUSWPVHPYETJHTDDBUDGWMIGDPIHRKNGCOAKDCTXZGKMYPCJXNLUTGNVMXXKSNTYNYRRKQQYNEISUYJKOZGLSCXBMUWTBLWVQMPOQVVDJGPFMIJNIGTRLIYISRVMPBMDJLINDNKOBTZTKIFQFKKOKKYIQIYOETBUGYFTFIJIEMM...

output:

NO

result:

ok Correct.

Test #81:

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

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: 1ms
memory: 4328kb

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: 22ms
memory: 44900kb

input:

1000 1000
.CREOVUSQSUBZHGCAMEHDHOEKYXWYDEVOBZAVCCAVPDWBJGLQQGURPAIXJWGJHIDUOFFPMOHFQTRBLWZGLFULTNRNPLJTLWTINHFTFPDVZPOBTAEYMJKHOIRZSISGGNKJTPSNXLHLKJAZCBYHLGGKJLRPMIHQTFLEYOXAEUXOXIGBOYLXFACCYYBPNZBPEQQHPLOCIAGQWQELHDJOYFYEBDUFBLCPYTPXUOGCZJWDRCXHHDKAEHZOCKOOCECYAGETYBJABTQZAGIVBLARAYEDKZSZUZZAQAHHI...

output:

NO

result:

ok Correct.

Test #84:

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

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: 1ms
memory: 4032kb

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: 11ms
memory: 46168kb

input:

1000 1000
.NZFEZUYNRISOCPIEAOOISHLWCREPCVAUFDECHSNVFHMJCDXSQOTTPBFSIFSJOWDVZQULKUWVFBLEYGHJDQNZKRWQYRMGFDIVHGQAGHROSZZNZLQRBODARKGAJTGAJHXFXREDREAYOJJEGSXCPGVSNERMUUIHYNBHVVVDFRLLXSHTLSOFRIUQVDPNRDLFAHIKRIRPXMGHMUEUKJUEEWZGFTGYNESQTGRRRYIZTXFELFODRZVGUKQXSKUFWWFIRVEQMFASWWUKVUJSWOKTDPNJPIDWZXSZQSKXD...

output:

NO

result:

ok Correct.

Test #87:

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

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: 4092kb

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: 15ms
memory: 44720kb

input:

1000 1000
.XWGCCNEHTKSGEGYLDZPMUSEXZISJXQITQKYNZTBXHQPBCNTCOJLOEIHBRREEZBILHQWBRPUGZPBEKVCAIVBOSJUMXAOAPJHJYLKQHRYOTFSQGDOXXMBAABFUFDOVINZTXRTFTVSHGOEYLNGJFBAISGBMARUCGRKLBGBSSVEEZCJWIOUXOQAUQOIUOXWBREHTLMFAARFBINPIZFOJBGYPPDCPPPUNJKQFRQHDDVOJOZSODGIMSUGOYPFUNBKCTZKRDAILLJZUUXMPZSJSYQHJTUFLFDCEJWBRF...

output:

NO

result:

ok Correct.

Test #90:

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

input:

1000 1000
.AACADBEBCBCBDACDEDCBCCAEECCAAECCDBECCBBBECCDEEDCACBBAEAADDCEACCABCCECCAAECBCBCDCDDCAABBDADCCDCBBBDBEAAABDEEAEBCDBDDEAEACBDCADEADDCDECDABCBBEEEEEDECEBBADEBDBDDDAAEBEBCCCBACEDABBEAABEBCCAADCCECBAEBADDDCBBCBDDEAECBDBAEAABCADCAADDAAEEBAEABEADBADCACCCADCAEDEDACBADAEDEBABEEBBECCCECEDCBACDEBAACE...

output:

NO

result:

ok Correct.

Test #91:

score: 0
Accepted
time: 3ms
memory: 46348kb

input:

1000 1000
.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

output:

NO

result:

ok Correct.

Test #92:

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

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