QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#112673#5416. Fabulous Fungus FrenzymaspyAC ✓12ms5316kbC++2317.3kb2023-06-12 21:06:072023-06-12 21:06:11

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-06-12 21:06:11]
  • 评测
  • 测评结果:AC
  • 用时:12ms
  • 内存:5316kb
  • [2023-06-12 21:06:07]
  • 提交

answer

#line 1 "library/my_template.hpp"
#if defined(LOCAL)
#include <my_template_compiled.hpp>
#else
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")

#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using pi = pair<ll, ll>;
using vi = vector<ll>;
using u32 = unsigned int;
using u64 = unsigned long long;
using i128 = __int128;

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); }
// (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, typename U>
T ceil(T x, U y) {
  return (x > 0 ? (x + y - 1) / y : x / y);
}
template <typename T, typename U>
T floor(T x, U y) {
  return (x > 0 ? x / y : (x - y + 1) / y);
}
template <typename T, typename U>
pair<T, T> divmod(T x, U y) {
  T q = floor(x, y);
  return {q, x - q * y};
}

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

#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) {
  assert(!que.empty());
  T a = que.top();
  que.pop();
  return a;
}
template <typename T>
T POP(vc<T> &que) {
  assert(!que.empty());
  T a = que.back();
  que.pop_back();
  return a;
}

template <typename F>
ll binary_search(F check, ll ok, ll ng) {
  assert(check(ok));
  while (abs(ok - ng) > 1) {
    auto x = (ng + ok) / 2;
    tie(ok, ng) = (check(x) ? mp(x, ng) : mp(ok, 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;
    tie(ok, ng) = (check(x) ? mp(x, ng) : mp(ok, 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;
}
#endif
#line 1 "library/other/io.hpp"
// based on yosupo's fastio
#include <unistd.h>

namespace fastio {
#define FASTIO
// クラスが read(), print() を持っているかを判定するメタ関数
struct has_write_impl {
  template <class T>
  static auto check(T &&x) -> decltype(x.write(), std::true_type{});

  template <class T>
  static auto check(...) -> std::false_type;
};

template <class T>
class has_write : public decltype(has_write_impl::check<T>(std::declval<T>())) {
};

struct has_read_impl {
  template <class T>
  static auto check(T &&x) -> decltype(x.read(), std::true_type{});

  template <class T>
  static auto check(...) -> std::false_type;
};

template <class T>
class has_read : public decltype(has_read_impl::check<T>(std::declval<T>())) {};

struct Scanner {
  FILE *fp;
  char line[(1 << 15) + 1];
  size_t st = 0, ed = 0;
  void reread() {
    memmove(line, line + st, ed - st);
    ed -= st;
    st = 0;
    ed += fread(line + ed, 1, (1 << 15) - ed, fp);
    line[ed] = '\0';
  }
  bool succ() {
    while (true) {
      if (st == ed) {
        reread();
        if (st == ed) return false;
      }
      while (st != ed && isspace(line[st])) st++;
      if (st != ed) break;
    }
    if (ed - st <= 50) {
      bool sep = false;
      for (size_t i = st; i < ed; i++) {
        if (isspace(line[i])) {
          sep = true;
          break;
        }
      }
      if (!sep) reread();
    }
    return true;
  }
  template <class T, enable_if_t<is_same<T, string>::value, int> = 0>
  bool read_single(T &ref) {
    if (!succ()) return false;
    while (true) {
      size_t sz = 0;
      while (st + sz < ed && !isspace(line[st + sz])) sz++;
      ref.append(line + st, sz);
      st += sz;
      if (!sz || st != ed) break;
      reread();
    }
    return true;
  }
  template <class T, enable_if_t<is_integral<T>::value, int> = 0>
  bool read_single(T &ref) {
    if (!succ()) return false;
    bool neg = false;
    if (line[st] == '-') {
      neg = true;
      st++;
    }
    ref = T(0);
    while (isdigit(line[st])) { ref = 10 * ref + (line[st++] & 0xf); }
    if (neg) ref = -ref;
    return true;
  }
  template <typename T,
            typename enable_if<has_read<T>::value>::type * = nullptr>
  inline bool read_single(T &x) {
    x.read();
    return true;
  }
  bool read_single(double &ref) {
    string s;
    if (!read_single(s)) return false;
    ref = std::stod(s);
    return true;
  }
  bool read_single(char &ref) {
    string s;
    if (!read_single(s) || s.size() != 1) return false;
    ref = s[0];
    return true;
  }
  template <class T>
  bool read_single(vector<T> &ref) {
    for (auto &d: ref) {
      if (!read_single(d)) return false;
    }
    return true;
  }
  template <class T, class U>
  bool read_single(pair<T, U> &p) {
    return (read_single(p.first) && read_single(p.second));
  }
  template <size_t N = 0, typename T>
  void read_single_tuple(T &t) {
    if constexpr (N < std::tuple_size<T>::value) {
      auto &x = std::get<N>(t);
      read_single(x);
      read_single_tuple<N + 1>(t);
    }
  }
  template <class... T>
  bool read_single(tuple<T...> &tpl) {
    read_single_tuple(tpl);
    return true;
  }
  void read() {}
  template <class H, class... T>
  void read(H &h, T &... t) {
    bool f = read_single(h);
    assert(f);
    read(t...);
  }
  Scanner(FILE *fp) : fp(fp) {}
};

struct Printer {
  Printer(FILE *_fp) : fp(_fp) {}
  ~Printer() { flush(); }

  static constexpr size_t SIZE = 1 << 15;
  FILE *fp;
  char line[SIZE], small[50];
  size_t pos = 0;
  void flush() {
    fwrite(line, 1, pos, fp);
    pos = 0;
  }
  void write(const char val) {
    if (pos == SIZE) flush();
    line[pos++] = val;
  }
  template <class T, enable_if_t<is_integral<T>::value, int> = 0>
  void write(T val) {
    if (pos > (1 << 15) - 50) flush();
    if (val == 0) {
      write('0');
      return;
    }
    if (val < 0) {
      write('-');
      val = -val; // todo min
    }
    size_t len = 0;
    while (val) {
      small[len++] = char(0x30 | (val % 10));
      val /= 10;
    }
    for (size_t i = 0; i < len; i++) { line[pos + i] = small[len - 1 - i]; }
    pos += len;
  }
  void write(const string s) {
    for (char c: s) write(c);
  }
  void write(const char *s) {
    size_t len = strlen(s);
    for (size_t i = 0; i < len; i++) write(s[i]);
  }
  void write(const double x) {
    ostringstream oss;
    oss << fixed << setprecision(15) << x;
    string s = oss.str();
    write(s);
  }
  void write(const long double x) {
    ostringstream oss;
    oss << fixed << setprecision(15) << x;
    string s = oss.str();
    write(s);
  }
  template <typename T,
            typename enable_if<has_write<T>::value>::type * = nullptr>
  inline void write(T x) {
    x.write();
  }
  template <class T>
  void write(const vector<T> val) {
    auto n = val.size();
    for (size_t i = 0; i < n; i++) {
      if (i) write(' ');
      write(val[i]);
    }
  }
  template <class T, class U>
  void write(const pair<T, U> val) {
    write(val.first);
    write(' ');
    write(val.second);
  }
  template <size_t N = 0, typename T>
  void write_tuple(const T t) {
    if constexpr (N < std::tuple_size<T>::value) {
      if constexpr (N > 0) { write(' '); }
      const auto x = std::get<N>(t);
      write(x);
      write_tuple<N + 1>(t);
    }
  }
  template <class... T>
  bool write(tuple<T...> tpl) {
    write_tuple(tpl);
    return true;
  }
  template <class T, size_t S>
  void write(const array<T, S> val) {
    auto n = val.size();
    for (size_t i = 0; i < n; i++) {
      if (i) write(' ');
      write(val[i]);
    }
  }
  void write(i128 val) {
    string s;
    bool negative = 0;
    if (val < 0) {
      negative = 1;
      val = -val;
    }
    while (val) {
      s += '0' + int(val % 10);
      val /= 10;
    }
    if (negative) s += "-";
    reverse(all(s));
    if (len(s) == 0) s = "0";
    write(s);
  }
};
Scanner scanner = Scanner(stdin);
Printer printer = Printer(stdout);
void flush() { printer.flush(); }
void print() { printer.write('\n'); }
template <class Head, class... Tail>
void print(Head &&head, Tail &&... tail) {
  printer.write(head);
  if (sizeof...(Tail)) printer.write(' ');
  print(forward<Tail>(tail)...);
}

void read() {}
template <class Head, class... Tail>
void read(Head &head, Tail &... tail) {
  scanner.read(head);
  read(tail...);
}
} // namespace fastio
using fastio::print;
using fastio::flush;
using fastio::read;

#define INT(...)   \
  int __VA_ARGS__; \
  read(__VA_ARGS__)
#define LL(...)   \
  ll __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"

void solve() {
  const int K = 62;

  // [入力
  LL(H, W, Q);
  auto to_int = [&](char c) -> int {
    if ('A' <= c && c <= 'Z') return c - 'A';
    if ('a' <= c && c <= 'z') return 26 + int(c - 'a');
    if ('0' <= c && c <= '9') return 52 + int(c - '0');
    return -1;
  };
  vv(int, A, H, W);
  vv(int, B, H, W);
  FOR(i, H) {
    STR(S);
    FOR(j, W) A[i][j] = to_int(S[j]);
  }
  FOR(i, H) {
    STR(S);
    FOR(j, W) B[i][j] = to_int(S[j]);
  }
  vvc<int> B_init = B;
  vvvc<int> DAT(Q);
  FOR(q, Q) {
    LL(n, m);
    vv(int, X, n, m);
    FOR(i, n) {
      STR(S);
      FOR(j, m) X[i][j] = to_int(S[j]);
    }
    DAT[q] = X;
  }
  // 入力]

  auto CALC_CNT = [&](vvc<int>& X) -> vc<int> {
    vc<int> CNT(K);
    int n = len(X), m = len(X[0]);
    FOR(i, n) FOR(j, m) if (X[i][j] != -1) CNT[X[i][j]]++;
    return CNT;
  };
  vc<int> CNT = CALC_CNT(B);

  using T4 = tuple<int, int, int, int>;
  vc<T4> ANS;
  auto SWAP = [&](int x1, int y1, int x2, int y2) -> void {
    ANS.eb(x1, y1, x2, y2);
    swap(B[x1][y1], B[x2][y2]);
  };
  auto PRESET = [&](int q) -> void {
    ANS.eb(-1, -1, -1, q);
    auto& X = DAT[q];
    int n = len(X), m = len(X[0]);
    FOR(i, n) FOR(j, m) {
      if (B[i][j] == -1) continue;
      assert(B[i][j] == X[i][j]);
    }
    FOR(i, n) FOR(j, m) { B[i][j] = -1; }
    CNT = CALC_CNT(B);
  };
  auto MOVE = [&](int x1, int y1, int x2, int y2) -> void {
    // (x1,y1) にあるものを (x2,y2) に運ぶ
    while (x1 < x2) {
      SWAP(x1, y1, x1 + 1, y1);
      ++x1;
    }
    while (y1 < y2) {
      SWAP(x1, y1, x1, y1 + 1);
      ++y1;
    }
    while (y1 > y2) {
      SWAP(x1, y1, x1, y1 - 1);
      --y1;
    }
    assert(x1 >= x2);
    while (x1 > x2) {
      SWAP(x1, y1, x1 - 1, y1);
      --x1;
    }
    assert(x1 == x2 && y1 == y2);
    return;
  };
  auto gain = [&](vvc<int>& X) -> int {
    // 新たに生み出すことができる wildcard
    // 不可能 -1
    // 利得なし → 0
    int now = H * W - SUM<int>(CNT);
    int res = 0;
    auto CNT_X = CALC_CNT(X);
    FOR(k, K) {
      int a = CNT_X[k];
      int b = CNT[k];
      chmin(b, a);
      // b 個の k と、a-b 個の wildcard を使う
      res += b;
      now -= a - b;
    }
    if (now < 0) return -1;
    return res;
  };
  auto match_to = [&](vvc<int>& X) -> void {
    // B の左上領域を X と完全一致させる
    int n = len(X), m = len(X[0]);
    vv(bool, done, H, W);
    FOR(x2, n) FOR(y2, m) {
      auto [x1, y1] = [&]() -> pi {
        FOR(i, H) FOR(j, W) {
          if (done[i][j]) continue;
          if (B[i][j] == X[x2][y2]) return {i, j};
        }
        return {-1, -1};
      }();
      assert(x1 != -1);
      MOVE(x1, y1, x2, y2);
      done[x2][y2] = 1;
    }
  };
  auto prepare_apply_preset = [&](vvc<int>& X) -> void {
    // 目標盤面を作る
    // 各文字に対して、wildcard を使う回数
    vc<int> WILD(K);
    auto CNT_X = CALC_CNT(X);
    FOR(k, K) {
      int a = CNT_X[k];
      int b = CNT[k];
      chmin(b, a);
      // b 個の k と、a-b 個の wildcard を使う
      WILD[k] = a - b;
    }
    int n = len(X), m = len(X[0]);
    vv(int, Y, n, m);
    FOR(i, n) FOR(j, m) {
      int k = X[i][j];
      if (WILD[k] > 0) {
        WILD[k]--;
        Y[i][j] = -1;
      } else {
        Y[i][j] = X[i][j];
      }
    }
    match_to(Y);
  };

  while (1) {
    vc<int> vals(Q);
    FOR(q, Q) vals[q] = gain(DAT[q]);
    int q = max_element(all(vals)) - vals.begin();
    if (vals[q] <= 0) break;
    prepare_apply_preset(DAT[q]);
    PRESET(q);
  }
  if (gain(A) == -1) return print(-1);
  prepare_apply_preset(A);

  reverse(all(ANS));
  print(len(ANS));
  for (auto&& [a, b, c, d]: ANS) {
    if (a == -1) {
      print(d + 1, 1, 1);
      { // 検証
        auto& X = DAT[d];
        int n = len(X), m = len(X[0]);
        FOR(i, n) FOR(j, m) A[i][j] = X[i][j];
      }
    } else {
      { // 検証
        swap(A[a][b], A[c][d]);
      }
      ++a, ++b, ++c, ++d;
      assert(abs(a - c) + abs(b - d) == 1);
      if (a + b > c + d) {
        swap(a, c);
        swap(b, d);
      }
      assert(a + 1 == c || b + 1 == d);
      if (a + 1 == c) { print(-3, a, b); }
      if (b + 1 == d) { print(-1, a, b); }
    }
  }
  assert(A == B_init);
}

signed main() {
  solve();
  return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 2ms
memory: 3516kb

input:

3 3 1
OOO
GOG
BGB

OOO
GGG
BBB

3 1
B
G
B

output:

17
-1 2 2
1 1 1
-1 3 1
-3 2 2
-3 2 1
-1 3 1
-1 3 2
1 1 1
-1 3 1
-1 3 2
-1 2 1
-1 2 2
1 1 1
-1 3 1
-1 2 1
-3 1 1
-3 2 1

result:

ok puzzle solved

Test #2:

score: 0
Accepted
time: 2ms
memory: 3424kb

input:

2 2 1
OO
OO

PP
PP

1 2
OP

output:

-1

result:

ok puzzle solved

Test #3:

score: 0
Accepted
time: 2ms
memory: 3428kb

input:

4 8 4
11122222
33344444
55556666
77777777

NIxSHUOx
DExDUIxx
DANxSHIx
YUANSHEN

2 3
NIy
DEx

3 8
zzzzzzzz
DANNSH9I
YUA9SHEN

1 1
x

2 5
SHO8y
DUUI8

output:

148
1 1 1
-3 2 3
-3 3 3
-1 4 3
-1 4 4
-1 4 5
-1 4 6
-1 4 7
-1 2 2
-1 2 3
-3 1 4
-1 2 1
-1 2 2
-1 2 3
-3 1 4
1 1 1
-3 2 3
-3 3 3
-1 4 3
-1 4 4
-1 4 5
-1 4 6
-1 2 2
-1 2 3
-3 1 4
-1 2 1
-1 2 2
-1 2 3
-3 1 4
1 1 1
-3 2 3
-3 3 3
-1 4 3
-1 4 4
-1 4 5
-1 2 2
-1 2 3
-3 1 4
-1 2 1
-1 2 2
-1 2 3
-3 1 4
1 1 1...

result:

ok puzzle solved

Test #4:

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

input:

2 2 1
OO
OO

OP
PP

1 2
PP

output:

8
-1 2 1
1 1 1
-3 1 2
-1 2 1
1 1 1
-3 1 2
-1 2 1
-1 1 1

result:

ok puzzle solved

Test #5:

score: 0
Accepted
time: 2ms
memory: 3528kb

input:

2 2 1
OO
OO

OP
PO

2 1
P
P

output:

4
-3 1 2
-1 2 1
1 1 1
-1 1 1

result:

ok puzzle solved

Test #6:

score: 0
Accepted
time: 2ms
memory: 3456kb

input:

2 2 1
OO
OO

OP
PO

2 2
PP
PP

output:

-1

result:

ok puzzle solved

Test #7:

score: 0
Accepted
time: 2ms
memory: 3528kb

input:

2 2 1
OO
OO

OP
PP

1 2
OP

output:

7
1 1 1
-3 1 2
-1 2 1
1 1 1
-3 1 2
-1 2 1
1 1 1

result:

ok puzzle solved

Test #8:

score: 0
Accepted
time: 2ms
memory: 3744kb

input:

20 20 20
bofelagiqboebdqplbhq
qsrksfthhptcmikjohkt
qrnhpoatbekggnkdonet
aoalekbmpbisgflbhmol
djnhnlitcakltqgegqrt
fdctfarsmbnbeosdgilo
ttrsljgiratfmioajorh
gorljkihdnmnofnblfhm
bqjkaehetdjlgctmijpc
geslcskpoqjcgtbdspoa
riqthroqmmhqgprqhsba
fdiarrcomockfqdjjdkd
jsbnigfqgsfekbbnnkir
ildqctqtqrpcetaocp...

output:

9816
20 1 1
-3 1 1
-3 2 1
-3 3 1
-3 4 1
-3 5 1
-3 6 1
-3 7 1
-3 8 1
-3 9 1
-3 10 1
-3 11 1
-3 12 1
-3 13 1
-3 14 1
-3 15 1
-3 16 1
-3 17 1
-3 18 1
-1 19 1
-1 19 2
-1 19 3
-1 19 4
-1 19 5
-1 19 6
-1 19 7
-1 19 8
-1 19 9
-1 19 10
-1 19 11
-1 19 12
-1 19 13
-1 19 14
-1 19 15
-1 19 16
-1 19 17
-1 19 18
...

result:

ok puzzle solved

Test #9:

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

input:

20 20 2
HbevPluVL5ORtUFcV9gf
Mrq6zdTPMPnwlN7Fpzx6
Nfp71dVuxTZp9Qet0Ca9
ugbaF34DquDdbUnk5x7V
fDFszn4PmvMpJ5BDWueJ
2YvFxKJgst8XbftPfy9T
F7Q4huk87Lrp1M7i08is
Q41E5AqLkkP3Q5qONXC2
MuM7iIzev3ZpxItvriQK
6OBdEC0sso5vdNQlrCSR
BJQtKjN6RmppsMGIYL81
yyKsWJSoKorGGblNle0r
RkKEQACh8f0bS5nPTtJH
fQgoc39vdsPAUmxlYYL...

output:

-1

result:

ok puzzle solved

Test #10:

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

input:

20 20 2
pqo3Mcpvo74RFSsJszsa
znrYm92Qr8fbqhbCTOgq
4KiMYr0kLAxPGNG15x7L
QHKmq6xaJ4PU4msuRAiv
UBfS6VUO87hRnMAjGXKX
zCgknw3FfhdifmVcT6FF
GH6ohIAzZuprlC3vMDVh
mHIJ9KlQvWxt6EgGbJkA
3SwJNhRSdEeF9BNtc9k2
mZmEuriH7Rc4ccMjqI0Y
cFfI8TC1iM4PkKziLOiN
15CUjuwudnrums3c3dsl
ekL52LiFEpzmU4vaGtuX
CfrnQtWb5zAN9oQS2fj...

output:

31509
2 1 1
-1 20 14
-3 19 15
-3 18 15
-3 17 15
-3 16 15
-3 15 15
-3 14 15
-3 13 15
-3 12 15
-3 11 15
-3 10 15
-3 9 15
-3 8 15
-3 7 15
-3 6 15
-3 5 15
-3 4 15
-3 3 15
-3 2 15
-3 1 15
-1 20 13
-1 20 14
-3 19 15
-3 18 15
-3 17 15
-3 16 15
-3 15 15
-3 14 15
-3 13 15
-3 12 15
-3 11 15
-3 10 15
-3 9 15
-...

result:

ok puzzle solved

Test #11:

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

input:

20 20 2
7CDCA3gd4c8OE3Zs0VE1
vszVp5b7Vw7NnPisnZYJ
hgfA8K4aV11nlDcDasWj
hg7y388G2MOuTOpEGDBh
DDTjEdOJNQHu2pzbuigf
6kdVkqykU2dDjqjDKD2v
vmaF9cP326rpwhVIl0K6
KchHgQg3BK7Hqt9uLAX4
8klt7U0BZ2C8Ky7DQ5Jo
Ce71gbv3U9nG7pNiwO5T
SII4sonVJ3F34MELKUlD
mLfuG79wBvqb2BKKLoRf
GnBA95Uadz3lO2Dvuob1
NLqlqTyNPTp5sihp2tC...

output:

-1

result:

ok puzzle solved

Test #12:

score: 0
Accepted
time: 2ms
memory: 3644kb

input:

20 20 2
PcYcPItqOwm4yYbBIt9e
iBIDFlswIdU1gSXVvuf7
GB55VjrsjvtPiW1lI0xt
8wDgW4acuIsbjY7McQHg
cpYGIgQ5cI3Ctu4iAJj5
K1KDs608gqVk9EQM6gMF
mJVEd5nuZQnlqLZ5Q2Yc
lo5wptbLMN2J0j3ZENzE
BTQuhuUjyGD1ha8mimg5
i6ixmpshNJ7TyUNjHcKm
bS7CeGdF4L50ZcHyVi7O
0iJYFD57UR6LLANOw7w6
qjwguPgl3YE4wk57cx6f
X5rA3btz798F76GFTPx...

output:

-1

result:

ok puzzle solved

Test #13:

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

input:

20 20 2
31JzWNDIcu64mRA4bbXn
nFHHOpnj3X6pjlT9XjtS
t6kqM1qCdWZlHYvND5AZ
Q580jYLFa8htqsbzmNwu
AnogbQ49yYDbGR5uIcRJ
er06ukvBAFUZ9wspjFdO
t1FndB74Vapme74N9Fhm
TGsrhjfKJ7orOyec8PRa
oraPL0zEQhfHGdSkFuQJ
6RxaAFbZ8kOkvDQgA2yf
rTHnPaAHHluAjaC5Vf41
JGYre0sXkS6W4f5oOVch
7jDPnIDXyLX5ymXMpxo7
AGtFpLNXqPnsO8f4UC2...

output:

-1

result:

ok puzzle solved

Test #14:

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

input:

20 20 5
98XQ4BMDPs7KQbGLQM94
5gAZZoXVtAOhWkV7eVC4
lcJaFORqa6FRYQJuyP2m
pHUWWwwcE5TYjXRD1f32
DwPeneIR7ks5Dq9kOS93
VJ9XAtGqjKxz6ib93VdB
nWGU5rGN8eFWanUFUuz8
8oBdZb4d9bFzPkC6aVZ5
U78CXMM9XkU1qltE2EM4
nkzXLl0pINNatqozmpsu
GoiFmfcKy7lWUpigV87d
63xk0X2RqyPWwc3uSkT7
I4JbBl4DTchy7cFhx07y
KQ5NgDHEwoO2EYyfIkF...

output:

-1

result:

ok puzzle solved

Test #15:

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

input:

20 20 5
VnbxSwLhwt7GUidif4lW
0lIVUk241YBWXNVXIalc
uICMK6WkoB9tDO76DKV2
L8p8DG3IXFSxguONRieG
eutIQAuRQWOEqZc3ycFo
AjUGtn3X6vFViizsHwNj
bESe5O4i0QCUlaLSuVkT
MPaf6lZmcZf38WvUGLHD
bzTdwp4OJVayTmOGCvkv
znkkxaiEncYIADpGlrsB
mnLYGHXEZp1mErfJMeh0
vBi2nEG1SCLHclLTwrqW
agGGIwO0puMF52Jyk0SK
3a3IY7jkpwvjXSRMLy5...

output:

14058
3 1 1
-1 16 11
-3 15 12
-3 14 12
-3 13 12
-3 12 12
-3 11 12
-3 10 12
-3 9 12
-3 8 12
-3 7 12
-3 6 12
-3 5 12
-3 4 12
-3 3 12
-3 2 12
-3 1 12
-1 16 10
-1 16 11
-3 15 12
-3 14 12
-3 13 12
-3 12 12
-3 11 12
-3 10 12
-3 9 12
-3 8 12
-3 7 12
-3 6 12
-3 5 12
-3 4 12
-3 3 12
-3 2 12
-3 1 12
-1 16 9
-...

result:

ok puzzle solved

Test #16:

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

input:

20 20 5
zzh9PnCVcvoyTl0XNqBR
NhRWLcbdGlpC2hYU4p7z
Q9zsPBWaybIU9LzvEJOv
cGYogJA6gn379WLXDlps
UE28n4kYuBi60G3VpJ3y
fXFdrdzuLkCclp1Qucaa
cb8vXeoIVEISF1z63mXI
akRc9rUDqJThkHgM3Glf
o0MX2ThxnjB0vjgUgzOR
PD5PmQv52G9lu5pEvwoI
2nah8lAHqPGAwxocL8kQ
Ug6vDhj7gtLnPHtrhCKQ
xjAbQPvwYHhE71R580zS
iHeGypUWdQkxoUmnLPA...

output:

22832
5 1 1
-1 10 13
-3 9 14
-3 8 14
-3 7 14
-3 6 14
-3 5 14
-3 4 14
-3 3 14
-3 2 14
-3 1 14
-1 10 12
-1 10 13
-3 9 14
-3 8 14
-3 7 14
-3 6 14
-3 5 14
-3 4 14
-3 3 14
-3 2 14
-3 1 14
-1 10 11
-1 10 12
-1 10 13
-3 9 14
-3 8 14
-3 7 14
-3 6 14
-3 5 14
-3 4 14
-3 3 14
-3 2 14
-3 1 14
-1 10 10
-1 10 11
...

result:

ok puzzle solved

Test #17:

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

input:

20 20 5
cz7yfUxuJVlDaZw6BPsE
anVcSZ5DDJPMPJjAEljh
mWcTQaRUJ21VBsk9LtMn
IU2kOtF8GrxsO4Ap77yc
aGzhzRS8gjFAsFNP8nAm
5G1OJUh0WhP43mJzhSj1
o55Q582zXKwA7idbCXyI
LvXe3CGvyW2YRTsE7KZ2
8yPYtMObYNoli6LvAYcn
TEba0LujH9bXK0S4q7pd
htdrztum0MdvYWaNJ2EJ
gX6XBJOPOFMIbtxHaVQX
cuaLLQVLomjYM1XQhfrx
v1zIJ7H4lHpG9W1xbxE...

output:

17943
1 1 1
-1 12 2
-3 11 3
-3 10 3
-3 9 3
-3 8 3
-3 7 3
-3 6 3
-3 5 3
-3 4 3
-3 3 3
-3 2 3
-3 1 3
-1 12 1
-1 12 2
-3 11 3
-3 10 3
-3 9 3
-3 8 3
-3 7 3
-3 6 3
-3 5 3
-3 4 3
-3 3 3
-3 2 3
-3 1 3
-1 11 2
-3 10 3
-3 9 3
-3 8 3
-3 7 3
-3 6 3
-3 5 3
-3 4 3
-3 3 3
-3 2 3
-3 1 3
-1 11 1
-1 11 2
-3 10 3
-3 ...

result:

ok puzzle solved

Test #18:

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

input:

20 20 5
us00j7HM7PdH2WRz3xcM
ejN853WC2u56Ob8OhaFY
dvfiTNQ0vxAvSuOCKuPH
hxt33vcCeNyWRCHbl8nC
zI3R2j64CEb8N6O1oU41
qYchY8MtgwTJZil7DlS7
vmKw9IE8U8yFVsqUVAVW
7No9WxCuw4oKt4yMFLhu
335m5dxtgl4WH5qpS3M5
DAfNe1hS6J0lDJS5j5pa
BxSda2Jrvmy5aZdkS8FW
JiifhY3xqGMTvgPhsKr8
Kn8gzxeoP5OVO2PwxfKh
cuxJdH5sFnExQUAW7ge...

output:

-1

result:

ok puzzle solved

Test #19:

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

input:

20 20 5
MgIgubIcCNXH2Mg2w40R
rnEfibRlq6ivJHdMNUTN
OZmyNvIahT20lAm0Fz05
YaZNuoFaRdmjYaD1v54P
YDunv1c9XVGDchTdxoCN
Losy0epOtHOoVbXGQFmo
HMyg9ttIYpsHCFyGl967
BiI4SrDdttKfejRY5ZD0
RBgzAJgGyKHyd86fjciJ
rluiohbDngPEIoR3d0o3
SykYMoYx80TRiT8JX5ve
sGBNQlprQCJ5L38RLL7e
nnbPomySkRfOIbD3KnZW
XayKrhqQI7TfB0ap3YR...

output:

-1

result:

ok puzzle solved

Test #20:

score: 0
Accepted
time: 2ms
memory: 3720kb

input:

20 20 10
vZ2BGfzD3YncgS0RvCYc
ba3pLJQUNwJnbJPnsT9Y
JzqswEDnMTmMARVImvv9
UqOL3CmC3yEF5WaFyIDn
mMRvEEoTtfiesDNw6I0b
zSUGmC5DonGeLWy9DBpd
gBySN2vXSsZB3pdM5i4r
yVjGsVyaJmDB9LjZ6gsY
dwIQcEYAQzPReN7lWflz
dFs27yv6ytvVPGRE4Qk7
Z6AGE5mRpdLvsq9fb5L9
hvrn14Ey3zzX9GNVcNzx
eLXaglbY8GMMVJ2r4KZ8
Y3POq7ystreSt2k9ZH...

output:

16649
2 1 1
-1 19 18
-3 18 19
-3 17 19
-3 16 19
-3 15 19
-3 14 19
-3 13 19
-3 12 19
-3 11 19
-3 10 19
-3 9 19
-3 8 19
-3 7 19
-3 6 19
-3 5 19
-3 4 19
-3 3 19
-3 2 19
-3 1 19
-1 19 17
-1 19 18
-3 18 19
-3 17 19
-3 16 19
-3 15 19
-3 14 19
-3 13 19
-3 12 19
-3 11 19
-3 10 19
-3 9 19
-3 8 19
-3 7 19
-3 ...

result:

ok puzzle solved

Test #21:

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

input:

20 20 10
938hu3udF0D8o3Bo7Ua3
Za7iCB6ZlUAbgdS9O8R5
X4n3C1HhWsU8fPn7nqsD
l3j1GFP9mkLjQx2OkLO9
9GvVb4aWbQMJ7gMgXfAx
esFhkws6c8HzX30AhdY0
9cCcNgLrJ3Xzfc54EFSc
0rWLz5tnY2dTls0VG2as
qYsEH5bjy25oPKzvs6PR
pUppXiBolKGyO5SGeSke
x23UaFbMQDqNkk6Q6bV4
KbkQpOiDszDPP1ulUVTv
JXUBrEVmHQkT1LaMOGOp
lAON0BmcpD76I4LK3Y...

output:

11130
1 1 1
-1 13 16
-3 12 17
-3 11 17
-3 10 17
-3 9 17
-3 8 17
-3 7 17
-3 6 17
-3 5 17
-3 4 17
-3 3 17
-3 2 17
-3 1 17
-3 13 15
-3 14 15
-3 15 15
-3 16 15
-3 17 15
-3 18 15
-3 19 15
-1 20 15
-1 20 16
-1 20 17
-1 20 18
-1 20 19
-1 13 14
-1 13 15
-1 13 16
-3 12 17
-3 11 17
-3 10 17
-3 9 17
-3 8 17
-3...

result:

ok puzzle solved

Test #22:

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

input:

20 20 10
VnqQrUtVm6Qcv2kVwjqZ
Me8fpxb40dwNdKWbijAs
eocFHrEba2kKMMPFslhj
LqSeiPuBNUSXN3VY9GZV
LH5lIu5WPvgbHXL4HEYL
TYySliQHRXLQ16sX4KqQ
1QSsFG1NNJ3xyVTld1v1
AWDEH2oxXMUgFdTF4SO0
GqdjdHtXczsErLUy9Yid
FX6UJZOH0aRaJiOElXkh
cXtdybWOhU590pbiTeYM
5I4qErVRUCDzob8Lt2qk
3WS6DPBSk8PWZGeitCzB
E6RHI11O5XOoXY7g7c...

output:

8338
2 1 1
-3 4 2
-3 5 2
-3 6 2
-3 7 2
-3 8 2
-3 9 2
-3 10 2
-3 11 2
-3 12 2
-3 13 2
-3 14 2
-3 15 2
-3 16 2
-3 17 2
-3 18 2
-3 19 2
-1 20 2
-1 20 3
-1 20 4
-1 20 5
-1 20 6
-1 20 7
-1 20 8
-1 20 9
-1 20 10
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 17
-1 20 18
3 1 1
-1 16 11
-3 15 1...

result:

ok puzzle solved

Test #23:

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

input:

20 20 10
4TqYTxl8WMfOTwo9y96N
pASI3kKQD1AYSQHBNlgN
Cc3It3amJn5ATGFgE4F4
vdJaj4lyfRy31A8bPQWb
RaXyFlN944KyDL7NLpPK
5GBn13FiPtmwtw5NQHEK
4SHyvGNzvibxwQtbX9WU
IViOzT3EkViVWD29MMqA
dVZaneabLenTL0gsYzen
bjnt74OXhZ2ny32ucDWs
67VjWOdogE9GqrP29HS6
SUJkX1NCnQ43ZnbbTwYe
nDYckGZKm1IGaroiqt0Z
TQ4UoKH6P1JhQwpc1b...

output:

19994
8 1 1
-1 6 3
-3 5 4
-3 4 4
-3 3 4
-3 2 4
-3 1 4
-1 6 2
-1 6 3
-3 5 4
-3 4 4
-3 3 4
-3 2 4
-3 1 4
-1 6 1
-1 6 2
-1 6 3
-3 5 4
-3 4 4
-3 3 4
-3 2 4
-3 1 4
-1 5 3
-3 4 4
-3 3 4
-3 2 4
-3 1 4
-1 5 2
-1 5 3
-3 4 4
-3 3 4
-3 2 4
-3 1 4
-1 5 1
-1 5 2
-1 5 3
-3 4 4
-3 3 4
-3 2 4
-3 1 4
-1 4 3
-3 3 4
-...

result:

ok puzzle solved

Test #24:

score: 0
Accepted
time: 2ms
memory: 3668kb

input:

20 20 10
jIjlXJvqkKeNHqJu9OU0
CEJLgoBLXEMfViAPn2xu
oH67vH5wzVx9iEhJz5Ms
cQaYCUK6Whnp87f1VRDx
g1n8g3TaitgQY883TWro
q6QI3ddTaMpbtlDqb5d2
7ariwbB5zGdzc4F1oMj4
4lFRwN0rmbEzDSdpoWM2
XmeqRF1p7Q8v9VOhgAG1
Zcy2pkEFCzJPzM1o5x0l
qbs5qistTeukyuKA6NLk
tmYSzo9xVR4ejixLclAl
0rWL8vnnJF5z8wgXCxfJ
wk1VCs2uXTUZxu6F2U...

output:

-1

result:

ok puzzle solved

Test #25:

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

input:

20 20 10
FA9N0SwQDIYNzj8XBsE1
OANStwtCpgQDMOxRWQTj
3jdrqk1GuefBDSP7uaTY
DdNI0RcvvDgQftmO9SoL
A7OINHbaDNMpjrdn2yRa
Uw67anQem6lUtmbYpqMb
fze2EPhJI57BTdNOPlyj
yMYLpL5h7v4dr7ftS94u
GYuGq6NOqfKay6tfyIkB
B0OFDAnmXez8Jv1pZwZe
HcZQ2NPrsOK2SoNZbHIC
8L5mkLwjtJ4yG1Qmyifr
Gs7g5cuRaAws2y9qTxxt
dOVW2YnWcz1MiwF4YG...

output:

13827
-1 16 17
-1 16 18
-1 16 19
-3 15 20
-1 16 19
-1 16 18
-1 16 17
-1 16 16
-1 16 15
-1 16 14
-1 16 13
-1 16 12
-1 16 11
-1 16 10
-1 16 9
-1 16 8
-1 16 7
-1 16 6
-1 16 5
-1 16 4
-1 16 3
-1 16 2
-1 16 1
-1 15 16
-1 15 17
-1 15 18
-3 14 20
-1 15 19
-1 15 18
-1 15 17
-1 15 16
-1 15 15
-1 15 14
-1 15 ...

result:

ok puzzle solved

Test #26:

score: 0
Accepted
time: 2ms
memory: 3564kb

input:

20 20 20
fLlNCdZX1Un4dhtk9m7p
756yPELepI3iEGVX8bMy
eCKueEJd9lS3ytjuny1I
pZC8W9Qbtz0Uv0WLzxNL
scr2iRpfNLMzPI3FDkQA
Z3jFw6yQAnpaMufv1eHh
ylh0rE1Tgq1pgCWdEBiZ
3ieCmZhc7NdmoWjBgyQI
PMasLnbSgcjghs5PTPZn
XU9gnl5jgeS1vGTy2Qhz
0Hid9loq3tpDmhys562S
JOZWgqra0vPkS2nh1lFi
iOsZXAFhU8FS5BDD83QY
A5Re5s0LdCXzrJN9Lc...

output:

-1

result:

ok puzzle solved

Test #27:

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

input:

20 20 20
XXAlDcMBIVz0lo4YDEmg
392vKwPjX6Z2JdZNDqyW
z7H6j4N7n2qFdjP2otQk
Yublz8jIM9bmosPVhA2u
461oPdbesqg5uhUwvNeS
ED4oy0VrnbuvQFDSGH87
q4mgj4ln8aZnshOrh23K
vOVEq1cdapRAEHcpEkuc
2dR89VxB2IGMOppOAHxF
d9YD51iJVz3vB1Qw9Rdu
JCHsxQhxqX43efDU491x
4qJwEbcbszP9Ck5DIA47
CZpy8UpNth9R3IPYWVC2
LBT5FSGf5WQRGDeKLq...

output:

10409
1 1 1
-1 19 9
-3 18 10
-3 17 10
-3 16 10
-3 15 10
-3 14 10
-3 13 10
-3 12 10
-3 11 10
-3 10 10
-3 9 10
-3 8 10
-3 7 10
-3 6 10
-3 5 10
-3 4 10
-3 3 10
-3 2 10
-3 1 10
-1 19 8
-1 19 9
-3 18 10
-3 17 10
-3 16 10
-3 15 10
-3 14 10
-3 13 10
-3 12 10
-3 11 10
-3 10 10
-3 9 10
-3 8 10
-3 7 10
-3 6 1...

result:

ok puzzle solved

Test #28:

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

input:

20 20 20
FcKTzZPjkXP1xvNve3Cb
Q6boxsYwHlJERH2H3Jh7
MzAHorKXxtM1WhhEtwBO
gRCBoaYadJj4l6L46vl8
R4sOaE5ha5Gw8YPcegK6
jdPVnMj23WqU2E1bwfwY
rECAjmES3L5mL7FEQpGv
XjuFx7bq9cq4Qk9hdecO
iBBOEyGbJb03qmGQiyW1
p8J4RLz2AZicwdQyf1lB
hueHVm2rSfJh3kInVfgr
pXqY1OQhUyXPjtI3uAo1
Z3nZk5ei3DE29yXvxUni
8WS3jmhVTcF1ZFwhPH...

output:

9696
2 1 1
-1 14 9
-3 13 10
-3 12 10
-3 11 10
-3 10 10
-3 9 10
-3 8 10
-3 7 10
-3 6 10
-3 5 10
-3 4 10
-3 3 10
-3 2 10
-3 1 10
-1 14 8
-1 14 9
-3 13 10
-3 12 10
-3 11 10
-3 10 10
-3 9 10
-3 8 10
-3 7 10
-3 6 10
-3 5 10
-3 4 10
-3 3 10
-3 2 10
-3 1 10
-1 14 7
-1 14 8
-1 14 9
-3 13 10
-3 12 10
-3 11 1...

result:

ok puzzle solved

Test #29:

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

input:

20 20 20
6SCG0JDRlzxfS8EHKcMD
ZkYT7WwrzFLNpJ6CUVTm
ywphmYrRdHg9CynoJn2r
IOqTMa5Yqi1M1qEbJSXz
xKCN1YrJe50J31Lt75z2
dy4YpYHDlliwcZ7HKe3o
H4H9eKrj19GUHQYA8vv1
p8wdnsRdZDRVJVmEahsW
0ldLFHPEzDkRzieYBUIn
jYfsKZcLqzOw7B59pPWJ
ZiCA7APSWfjrn1F3raNE
Mh4mhvS8tI8LY37mnNv9
GW98dE5HrI91USvPe0bP
sm7d8z6i3GxRmTqoR6...

output:

10449
3 1 1
-1 13 7
-3 12 8
-3 11 8
-3 10 8
-3 9 8
-3 8 8
-3 7 8
-3 6 8
-3 5 8
-3 4 8
-3 3 8
-3 2 8
-3 1 8
-1 13 6
-1 13 7
-3 12 8
-3 11 8
-3 10 8
-3 9 8
-3 8 8
-3 7 8
-3 6 8
-3 5 8
-3 4 8
-3 3 8
-3 2 8
-3 1 8
-1 13 5
-1 13 6
-1 13 7
-3 12 8
-3 11 8
-3 10 8
-3 9 8
-3 8 8
-3 7 8
-3 6 8
-3 5 8
-3 4 8
...

result:

ok puzzle solved

Test #30:

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

input:

20 20 20
kGw43SE9IBkiS1V6gNwM
coPWk4rlUpXckf3IuK77
pcsGoFm5Z4QIUwR2IshP
lnSG97Cr7I2dcMMYTPEV
NQYruyFKAmwdocQFfzbS
GYfrocjaywdac0JkULty
PurPikfL5pJVnZafz4Oc
TvTcoiV41LevpixUErOs
KTt194GRVaWo2lYR5Ya1
7Uq9YbYoPaHQck9bjF0C
jjdlJ54XzTE5yWzsw3OR
nxjM5Lf31E8TiMqWFGbj
nKbL6ltbRyAYOXnyq0uz
aY8eydrCnqII7R7SNP...

output:

12739
2 1 1
-1 6 8
-3 5 9
-3 4 9
-3 3 9
-3 2 9
-3 1 9
-1 6 7
-1 6 8
-3 5 9
-3 4 9
-3 3 9
-3 2 9
-3 1 9
-1 6 6
-1 6 7
-1 6 8
-3 5 9
-3 4 9
-3 3 9
-3 2 9
-3 1 9
-1 6 5
-1 6 6
-1 6 7
-1 6 8
-3 5 9
-3 4 9
-3 3 9
-3 2 9
-3 1 9
-1 6 4
-1 6 5
-1 6 6
-1 6 7
-1 6 8
-3 5 9
-3 4 9
-3 3 9
-3 2 9
-3 1 9
-1 6 3
-...

result:

ok puzzle solved

Test #31:

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

input:

20 20 20
CmdA7XNz5vkiGZkzRvgQ
okGWx9i4m2dofIZT0voN
4Hz0jnibPzmejCprDxkh
UWnuwW9ZG4QvfkLK7Mtd
8SoX9cLLWG2IOzR0v6Fw
9puIqiSzSLdP1WpTgd2Q
STfzi2RkeNHXcca1WDbn
jZgfgc0VM2EcatLYcx6U
xrAlEvwh9AH4yozHnZPJ
RJGM9uH66TxheZ40dDOH
EkGZpDr38tUNKYCZJ1LX
Y0ukE8CXDF45FzIwTDMu
ZLikUaAGid1RMYf1H4Ij
Vs6oYJEVveXqSTChJx...

output:

10430
2 1 1
-1 4 1
-3 3 2
-3 2 2
-3 1 2
-3 3 1
-3 4 1
-3 5 1
-3 6 1
-3 7 1
-3 8 1
-3 9 1
-3 10 1
-3 11 1
-3 12 1
-3 13 1
-3 14 1
-3 15 1
-3 16 1
-3 17 1
-3 18 1
-3 19 1
-1 2 1
-3 1 2
2 1 1
-1 4 1
-3 3 2
-3 2 2
-3 1 2
-3 3 1
-3 4 1
-3 5 1
-3 6 1
-3 7 1
-3 8 1
-3 9 1
-3 10 1
-3 11 1
-3 12 1
-3 13 1
-3...

result:

ok puzzle solved

Test #32:

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

input:

20 20 1
5D92pjoGfnDO4C5Oyw4H
TsyilavouNw53MQGEvXn
88dzW0KDLS8LJqYCJzDe
9PoqKizhhnIBzYdl2kZ8
oh9UDjyEmDYWTFRFEvLC
wQNDGUgf3ZrbVbfR1lQy
SzXET2GuKH6lhkuISYjD
0NtMCscfZuRklxduB9V3
VcKf1dEWsAFSnstIbAdA
ojetWs2HpaMZ7EklT24p
Y34r7Vu9zje69STK1uUa
MLY9uzt1fuQyEeRIkXHn
bAAQsCcBxxwH8DEpxkFx
X17x9hmFwRPK11FkcdE...

output:

0

result:

ok puzzle solved

Test #33:

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

input:

20 20 20
MIxM7phr1vWSQVkrhT36
53YXI3sEgFgQk8gfmyL3
OiRNhKeQ2oxPXtQiZzB3
Weqf8BpsOLjb0Vck2J9R
suQRYDhfU8v9zQv8PvQY
EM8DfCPBVoXaaSo1GrWg
1ZBGmCcVdSppO9QDMgxu
fkgjTJL9VdRioZ1Hekcb
e9tFsaBJtExHbevyXxoZ
ugUefAoKFGP0n4iZkRHG
UWr4an8dyLOROW4Y8s18
XrfCJ9rMe5JotiZHJQoz
qdlHD4o6tZl262vISChS
u4wgePDrF2qdkZ2fRn...

output:

12543
13 1 1
-1 5 2
-3 4 3
-3 3 3
-3 2 3
-3 1 3
-1 5 1
-1 5 2
-3 4 3
-3 3 3
-3 2 3
-3 1 3
-1 4 2
-3 3 3
-3 2 3
-3 1 3
-1 4 1
-1 4 2
-3 3 3
-3 2 3
-3 1 3
-1 3 2
-3 2 3
-3 1 3
-1 3 1
-1 3 2
-3 2 3
-3 1 3
-1 2 2
-3 1 3
-1 2 1
-1 2 2
-3 1 3
-3 1 1
-3 2 1
-3 3 1
-3 4 1
-3 5 1
-3 6 1
-3 7 1
-3 8 1
-3 9 1
...

result:

ok puzzle solved

Test #34:

score: 0
Accepted
time: 2ms
memory: 3576kb

input:

20 20 1
l1Pf0ZY7tFqEoznSYD9H
1c9ZTOfgXZSKHSLmTsy4
Ohwur8vbnYhGzJXz5Sfo
SiRRMedPTRbfljDaxkJh
O6snjD7KywMXOUpB6hFT
JiEkoIJdJKYpTV8yyQkf
yXVPaheIMmOy5ZN8H5C1
OiKol9EfvfpVK3xlMsP1
qg2jUIe8LCMim6DSpuhX
SHyLkSO8w39KkXCkATe6
ZFs0GEpYPjjvDc3WyPXo
V0y6eByzh2UKV6dA9Ib6
15KFNCjFHkyjIi2g6fCq
eukHfF6BhoISpMBNcsS...

output:

3430
-1 20 19
-1 20 17
-1 20 18
-1 20 19
-1 20 15
-1 20 14
-1 20 15
-1 20 13
-1 20 14
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 17
-1 20 18
-1 20 19
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 10
-1 20 11
-1 20 9
-1 20 10
-1 20 11
-1 20 12
-1 20 13
-1 20 8
-1 20 9
-1 20 10
-1 20 7
-1 20 8
-1 ...

result:

ok puzzle solved

Test #35:

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

input:

20 20 20
rcLXTZgFP2o8yY64v4wy
XcHIv6hXUpy5ZS0qhn10
Z0QbWbqyEOTPURRaTQaK
R7YvePrQU0DnctNszHe6
K2HVig1e6zIz2uccgulR
8CrCzEhi81iSNIN0s4WN
L9Qb73EBce1jWtWWeD5K
NFp4WZlL4WImeZQAK3t1
ulz1YkKQrwpPuyJ4SwjQ
UeL5agOuTS8shzlYhddY
hpZAwscZZxwq5uss3yDm
9EV2syCqguZzXzQNYucG
qgoyoA9QjpMPfKgpL2XT
HmulpDJdQ1DvV5LqXD...

output:

9796
8 1 1
-1 9 3
-3 8 4
-3 7 4
-3 6 4
-3 5 4
-3 4 4
-3 3 4
-3 2 4
-3 1 4
-1 9 2
-1 9 3
-3 8 4
-3 7 4
-3 6 4
-3 5 4
-3 4 4
-3 3 4
-3 2 4
-3 1 4
-1 9 1
-1 9 2
-1 9 3
-3 8 4
-3 7 4
-3 6 4
-3 5 4
-3 4 4
-3 3 4
-3 2 4
-3 1 4
-1 8 3
-3 7 4
-3 6 4
-3 5 4
-3 4 4
-3 3 4
-3 2 4
-3 1 4
-1 8 2
-1 8 3
-3 7 4
-3...

result:

ok puzzle solved

Test #36:

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

input:

20 20 1
OB77ag4kAkk3gyz2LZ2v
0dC9QMcWuae0NV20yD42
7AcqghNefnm2xKIWuzDK
KppBQwod5EPDAgJuCpwm
2CvX4wdXnyDvMUx0eeIN
g42QaCpU2xWKAuj9CUmD
DpOYtXrOOc4Qmy174PD4
vV81q2DFkFhFHfWeNw9v
4yIpRsKQYGMFQeLa8TIf
rA2KJ13VCYqBfYTQqESD
b5rUBT5vb85fI80IanxH
L2EQXdZtDYtRRUdR8WIg
4QPCmvWBJzllZuNeogxF
SXzTWtzsT55MLgvwDVc...

output:

18581
1 1 1
-1 16 9
-3 15 10
-3 14 10
-3 13 10
-3 12 10
-3 11 10
-3 10 10
-3 9 10
-3 8 10
-3 7 10
-3 6 10
-3 5 10
-3 4 10
-3 3 10
-3 2 10
-3 1 10
-1 16 8
-1 16 9
-3 15 10
-3 14 10
-3 13 10
-3 12 10
-3 11 10
-3 10 10
-3 9 10
-3 8 10
-3 7 10
-3 6 10
-3 5 10
-3 4 10
-3 3 10
-3 2 10
-3 1 10
-1 16 7
-1 1...

result:

ok puzzle solved

Test #37:

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

input:

20 20 2
5hvYkH70L1zUSjaQN663
HGyU6JFL14hBulZoPg5X
o9xzrUw6XzqpV3Nxbd2Q
GSEYjfo3uJFxFJs3dEOR
KcKQkPv51aZcxgMXKXYQ
ekpH2y9n4kNqQ50tzs8I
d9oH2jyNjpfkZFHkiauA
iyNB01m4MaFbOFNHT3z3
J5wJNlHg87B4kePO40ed
LkbkI6yxKzDN3kMaaUjq
NCVDPHQ541CHLBMTzgV4
ZyLD1SZ6vhP8oOBanKCa
aJMjVRGYL6hKigvGrDlz
95SuKb5PUhRHsSxPhhI...

output:

11666
2 1 1
-1 19 1
-3 18 2
-3 17 2
-3 16 2
-3 15 2
-3 14 2
-3 13 2
-3 12 2
-3 11 2
-3 10 2
-3 9 2
-3 8 2
-3 7 2
-3 6 2
-3 5 2
-3 4 2
-3 3 2
-3 2 2
-3 1 2
-1 18 1
-3 17 2
-3 16 2
-3 15 2
-3 14 2
-3 13 2
-3 12 2
-3 11 2
-3 10 2
-3 9 2
-3 8 2
-3 7 2
-3 6 2
-3 5 2
-3 4 2
-3 3 2
-3 2 2
-3 1 2
-1 17 1
-3...

result:

ok puzzle solved

Test #38:

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

input:

20 20 5
2M0PSzRyyFU7S5iFJIvJ
9SctAt2KwbTvWFK78X3H
ibQVGTMTg4mpd6Xdhjhd
Vxx9blEDkAxVXgP6pC3D
eCMqEaKRzB2WaBv7Hq46
HRKeSihBIiTcrt811pBp
4rQvBja19baqmTmqIbcE
PX4STpK8nz8P9wScs0QV
KxhPzBVAcsO1UYxmHhQR
G6CNhjVdb6r8qAYFsM8X
O4iYFCtE869bpPRJu2GH
wkzY8CPZKhTR2fDZ2DWQ
SOnPLLJHOFlaqv3wMCOw
G6sKzK3EHTwRBzVdC6Z...

output:

10073
2 1 1
-1 5 9
-3 4 10
-3 3 10
-3 2 10
-3 1 10
-1 5 8
-1 5 9
-3 4 10
-3 3 10
-3 2 10
-3 1 10
-1 5 7
-1 5 8
-1 5 9
-3 4 10
-3 3 10
-3 2 10
-3 1 10
-1 5 6
-1 5 7
-1 5 8
-1 5 9
-3 4 10
-3 3 10
-3 2 10
-3 1 10
-1 5 5
-1 5 6
-1 5 7
-1 5 8
-1 5 9
-3 4 10
-3 3 10
-3 2 10
-3 1 10
-1 5 4
-1 5 5
-1 5 6
-1...

result:

ok puzzle solved

Test #39:

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

input:

20 20 10
1JCa2epIUA2OYqU1LpFu
yNe4VA5VZ11IunX0olaD
wSpocSVkhkwOfZHqaLV6
TFpN5zqISz8I0umcRUtQ
Ek15TV0nSnISTVs1o7Hj
sfb9rOWeh1zci6Bk1mvw
4o4PImAEh2oLmZYpJdPl
oaxbCtvoXGwUzNiC7WHN
pXYdCrFbqf5FafVvixJH
dwD5ZzP8PpE6v4BdeWsL
ZoDxsChdW6932qQTWqV1
ZhWG9JiBE0ubHd0oP8z1
xA4NhYFKGw5tVPHCbdJh
t8K2oXUuuCthg6hggt...

output:

8979
7 1 1
-1 2 18
-3 1 19
-1 2 17
-1 2 18
-3 1 19
-1 2 16
-1 2 17
-1 2 18
-3 1 19
-1 2 15
-1 2 16
-1 2 17
-1 2 18
-3 1 19
-1 2 14
-1 2 15
-1 2 16
-1 2 17
-1 2 18
-3 1 19
-1 2 13
-1 2 14
-1 2 15
-1 2 16
-1 2 17
-1 2 18
-3 1 19
-1 2 12
-1 2 13
-1 2 14
-1 2 15
-1 2 16
-1 2 17
-1 2 18
-3 1 19
-1 2 11
-...

result:

ok puzzle solved

Test #40:

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

input:

20 20 20
3SbQAuegTSPmCPZvlbdk
dF2rTbPelTSGUQlwxZuM
KPNXR7JceThH1jMsJjfm
0tlf3ANIvP36vz7HkdKQ
DFlWR3lQNgQbwtyFfZe3
8V6nwH5RoVm3LGpTUtdf
VgF50bcNruImiXnjnAzj
vjzJy2VCdgowF10YdrhY
Ffyp0LOy6y7PHq8dMbaI
Htwyeo9SLdBqNCMWoeec
V5XwPVY8v9TOLi4L2Hfs
iIU9qY8kuqMUNjF94QXa
2xWNvldtI6VJEydkH2Op
eYq3oZuOS7zPqe9jCH...

output:

9193
3 1 1
-1 2 6
-3 1 7
-1 2 5
-1 2 6
-3 1 7
-1 2 4
-1 2 5
-1 2 6
-3 1 7
-1 2 3
-1 2 4
-1 2 5
-1 2 6
-3 1 7
-1 2 2
-1 2 3
-1 2 4
-1 2 5
-1 2 6
-3 1 7
-1 2 1
-1 2 2
-1 2 3
-1 2 4
-1 2 5
-1 2 6
-3 1 7
-3 1 1
-3 2 1
-3 3 1
-3 4 1
-3 5 1
-3 6 1
-3 7 1
-3 8 1
-3 9 1
-3 10 1
-3 11 1
-3 12 1
-3 13 1
-3 14...

result:

ok puzzle solved

Test #41:

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

input:

20 20 1
A7OrI23h93dWPGV4wTcn
MMX51WR1xWI0IkEPNHkL
fe1M41qASfBV8kQdgXyL
fvsmqDrzi6yU4jtGCaLj
hL51DQCo8OK56oE7NTlE
2uwU3UIfZbH9TAJEtH0v
4AfELSrmnOw8vjJHU86v
W7TGD1960MVuJUTFgIcV
Q2AFn4DN6i7ekR3YRgCr
5ThHgwNsccNJqA1wf7qY
oGALTXfvvZ6Ek4zLzmhz
sQNubVZNN0HWw9Psj8sz
Wo3MFA5PElnCgZtyD39J
0gQOCtV0lGrF7iYNphZ...

output:

4874
-1 20 17
-1 20 18
-1 20 19
-1 20 16
-1 20 17
-1 20 18
-1 20 19
-1 20 15
-1 20 16
-1 20 17
-1 20 18
-1 20 19
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 17
-1 20 18
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 10
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 9
-1 20 10
-1 20 11
-1 20 12...

result:

ok puzzle solved

Test #42:

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

input:

20 20 2
tnanYii3223RArLeNooa
P5wEay5REAikFaQlHi21
IvkFcH7jeTpmHm7vs1No
rWPIS1YSUNufXFUXPL0x
psk1dcSxZo7I3QNXNX9s
dtOMvMqcDDlXYqaLqofc
KwB1FuTtrBAEA4xx8a3n
XjqTRkqtbztjz4LOY4xJ
z5bUMkyyeqVCkQvPh6Af
QqF32YaGM5Sg4Z8GSJhK
TLcCSZhIRae65ZjodrJP
12HW7xwrXIK5VxJgUmtW
TBPR6ImaXiu9GlMhbizo
RHAhskZOC9JbGCi0qne...

output:

5122
-1 19 2
1 1 1
-3 8 10
-3 9 10
-3 10 10
-3 11 10
-3 12 10
-3 13 10
-3 14 10
-3 15 10
-3 16 10
-3 17 10
-3 18 10
-3 19 10
-1 20 10
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-3 6 10
-3 7 10
-3 8 10
-3 9 10
-3 10 10
-3 11 10
-3 12 10
-3 13 10
-3 14 10
-3 15 10
-3 16 10
-3 17 10
-3 18 10
-3 19 10...

result:

ok puzzle solved

Test #43:

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

input:

20 20 5
3xoZnT1zkK53G0UtQUua
cXOM2T1Bpg29tl4JyaVL
M40QIKGIEsZODDdkGzbp
M1tMncCgCnpHcNUeZTSl
Up7vBD9326L98sHMnb9D
frRVC0ncvhomOvNuJBSz
Ye5NzL6hYz5Fl27xySBK
tAkNStjL8kWxdX4zdMBI
Z4sIc3aZUDTJyuQZls7i
Uy671MKTs2hdyNhB3jC5
PNYGMCa2RiBdgelALS2i
5feSPrHVHIRfFpqlrVEH
FLPmiOVvIXHaZim8VrCA
pCGuapf28hzmn2BzSEi...

output:

8892
4 1 1
-3 2 1
-3 3 1
-3 4 1
-3 5 1
-3 6 1
-3 7 1
-3 8 1
-3 9 1
-3 10 1
-3 11 1
-3 12 1
-3 13 1
-3 14 1
-3 15 1
-3 16 1
-3 17 1
-3 18 1
-1 19 1
-1 19 2
-1 19 3
-1 19 4
-1 19 5
-1 19 6
-1 19 7
-1 19 8
-1 19 9
-1 19 10
-1 19 11
-1 19 12
-1 19 13
-1 19 14
-1 19 15
-1 19 16
-1 19 17
-1 19 18
-1 19 19...

result:

ok puzzle solved

Test #44:

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

input:

20 20 10
39rq6XC7pr8L7tULVUCM
H8M2ddYovcFABWUUhhU6
gyHOuuPvMad3nbW2BnHI
480w4JLZLQJKirbfFuX7
RDlR56VazrGQVtnvTjEM
5iE9mKeCshrLgDeTxrud
V1450hCFY1eDibPJ7w4o
Rl6jO0mrXcMIYCoLnm4Q
Ax4qKvi3piazLPPMr80V
wWhLyHycvoruA2k7vaA5
UsgKH7fcB5QoHiHwFQwl
3vHSeRnZgNaQBqf4Nipt
tbTBy0BiKTdttbFogbTR
pY08R4XEntHZ0b6Ouc...

output:

9210
4 1 1
-1 10 3
-3 9 4
-3 8 4
-3 7 4
-3 6 4
-3 5 4
-3 4 4
-3 3 4
-3 2 4
-3 1 4
-1 10 2
-1 10 3
-3 9 4
-3 8 4
-3 7 4
-3 6 4
-3 5 4
-3 4 4
-3 3 4
-3 2 4
-3 1 4
-3 10 1
-3 11 1
-3 12 1
-3 13 1
-3 14 1
-3 15 1
-3 16 1
-3 17 1
-3 18 1
-3 19 1
-1 20 1
-1 20 2
-1 20 3
-1 20 4
-1 20 5
-1 20 6
-1 20 7
-1 ...

result:

ok puzzle solved

Test #45:

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

input:

20 20 20
zBXDtpKp0wACCj65lfxb
IUevkBhq1GqxYI6nrZW8
CT6FrHn6lg10U5oyosWx
u2KW6yUgqeypO60kSdQk
glT9aUKgBVIjgrLiUACa
4O8U8YEwXIVvMQXvL6xP
83sxzQb1jayx8wgNyowt
YdXGol76FrCDgwOQasXf
5QOEMX3HEHnOaIPw8mli
YB6BRqMUwVegsbhGP3RV
0gyuo7wVhnfQBtUsxoNV
x0GJxq6H8ypb1u2rcFtP
aHGwBWXWT8DebJepJdFC
b7qnxqxZnQfVmCUhWU...

output:

9107
18 1 1
-1 4 7
-3 3 8
-3 2 8
-3 1 8
-1 4 6
-1 4 7
-3 3 8
-3 2 8
-3 1 8
-1 4 5
-1 4 6
-1 4 7
-3 3 8
-3 2 8
-3 1 8
-1 4 4
-1 4 5
-1 4 6
-1 4 7
-3 3 8
-3 2 8
-3 1 8
-1 4 3
-1 4 4
-1 4 5
-1 4 6
-1 4 7
-3 3 8
-3 2 8
-3 1 8
-1 4 2
-1 4 3
-1 4 4
-1 4 5
-1 4 6
-1 4 7
-3 3 8
-3 2 8
-3 1 8
-1 4 1
-1 4 2
-...

result:

ok puzzle solved

Test #46:

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

input:

20 20 20
S95oxhKzWbf1F4AY1Lkr
pCrGa0Nzb3Dn34qC81D2
VEuo4xTNk0gYfH6VWkvk
RAbh4z4XntT1Aei7g6p4
25p0VeZA3ckkNvcff20D
wDKGyRlNP9FFvsQ8ZcsW
WFswYrPyJRAZHOc9uFJf
lBtb1ScoRrkFPRTeVygo
SLlvmx5FSaLHdrv1EaZS
2Ow5O4QWOmWmSdn1IWIB
7FhE9PGjRMxfVL6L4oYv
lfRwrUYeMj1X650OsJGZ
faLz6geBIJlKNTNo9ECT
IH36PqJv3CDLk3zCJm...

output:

11641
1 1 1
-1 4 16
-3 3 17
-3 2 17
-3 1 17
-1 4 15
-1 4 16
-3 3 17
-3 2 17
-3 1 17
-1 4 14
-1 4 15
-1 4 16
-3 3 17
-3 2 17
-3 1 17
-1 4 13
-1 4 14
-1 4 15
-1 4 16
-3 3 17
-3 2 17
-3 1 17
-1 4 12
-1 4 13
-1 4 14
-1 4 15
-1 4 16
-3 3 17
-3 2 17
-3 1 17
-1 4 11
-1 4 12
-1 4 13
-1 4 14
-1 4 15
-1 4 16
...

result:

ok puzzle solved

Test #47:

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

input:

20 20 20
AojXugIdqckXF3jDC6wm
dGsz10WAMrvY0Bqsygid
gafbaPYHyzPtQJCxYjwW
lXKuPBJpGb1AtHela5AI
E2ZCkALAHRKUAcbY7rwZ
advpwDNsDUB0vvivDKUE
OfJMUN1UEtGX1t8nb2m4
Naag9Y7tU7151yJ6jBUW
9h9jS9isAL92PoQbi1te
e3hwEW4ftEa2Nys3O1MI
RBKSBtnli4kJBNbeRq4h
OMC2Kwyoen5AIeEe9J1W
CeJ4hrVbdTYRTOZRSAn9
1994pUk0VOoZz5S9JE...

output:

14594
1 1 1
-1 16 17
-3 15 18
-3 14 18
-3 13 18
-3 12 18
-3 11 18
-3 10 18
-3 9 18
-3 8 18
-3 7 18
-3 6 18
-3 5 18
-3 4 18
-3 3 18
-3 2 18
-3 1 18
-1 16 16
-1 16 17
-3 15 18
-3 14 18
-3 13 18
-3 12 18
-3 11 18
-3 10 18
-3 9 18
-3 8 18
-3 7 18
-3 6 18
-3 5 18
-3 4 18
-3 3 18
-3 2 18
-3 1 18
-1 16 15
...

result:

ok puzzle solved

Test #48:

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

input:

20 20 20
zCDSZW0bSR6gXU5p03zj
PneJOcsa85BzI6C6W0ka
j4VsqxKeG6Bvl96RUXYp
rcwIwkcl6gjjm5DNio8b
jYoSbRougAphu9iaVKuG
nOR97gCqg7DILKTTGTZO
S79F1sgjOMYBf8QnghaT
s2CWtjBhNCDbXoaCqcOJ
FJBiLZ0os3ElfICUZWyC
gb684M0yUFf1UuHuDSsN
mBmDqgVjadqWl4Do3AJa
OBZGmpO8Yzc1e95dXCpv
BmCuNfHHoAB466W1SSE2
eubGfReZIpZwqVzoXS...

output:

9197
2 1 1
-1 7 3
-3 6 4
-3 5 4
-3 4 4
-3 3 4
-3 2 4
-3 1 4
-1 7 2
-1 7 3
-3 6 4
-3 5 4
-3 4 4
-3 3 4
-3 2 4
-3 1 4
-1 7 1
-1 7 2
-1 7 3
-3 6 4
-3 5 4
-3 4 4
-3 3 4
-3 2 4
-3 1 4
-1 6 3
-3 5 4
-3 4 4
-3 3 4
-3 2 4
-3 1 4
-1 6 2
-1 6 3
-3 5 4
-3 4 4
-3 3 4
-3 2 4
-3 1 4
-1 6 1
-1 6 2
-1 6 3
-3 5 4
-3...

result:

ok puzzle solved

Test #49:

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

input:

20 20 20
Vrwj35dxfPQfPNmSBHjs
Tf1FXkn1ALN1zCrgALKR
XG2JliJcsB39CgEjP25N
4DXATdFOFGkCtCKzwlXt
E0KsEnGrCUVIHsvq3h6s
IiUC9ujLBizrDDvwTmxT
0oPk9a4LSaODZl29DQp4
WtVVu9F3yW4XDMpORp67
o9QDnqMKKEp0DLlSu4W8
0ZlHeUIffg8lO5DsxMkO
DBPo6O2oJNDEt6yV0uCf
x8aaZIbYwv8dqWnNrrXC
diFVx44bPr2X87OG5SSM
324HFrujU56ibPgR1B...

output:

11258
-3 19 10
-1 20 10
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 17
-1 20 18
-1 20 19
-3 16 9
-3 17 9
-3 18 9
-3 19 9
-1 20 9
-1 20 10
-1 20 11
-1 20 12
-1 20 13
-1 13 4
-1 13 5
-1 13 6
-1 13 7
-1 13 8
-1 13 9
-1 13 10
-1 13 11
-1 13 12
-1 13 13
-1 13 14
-1 13 15
-1 13 16
-1 13 17...

result:

ok puzzle solved

Test #50:

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

input:

20 20 20
QrfXOmmmDknjRkUEZ9Il
rFDBPrY5vQGF2jEY4WPR
3MqxSaaPBMuigBUyIqpc
cY0V5npNkGbLqKoRy4Bs
jJfAiLNvAiqyv1goDOBt
5uUU9aFFgS86sIGZoklc
Xrwpnrd9XaswdDJEDdcs
yAs8CRGI79s6JMv6qRKh
60tWLmCCS6Q6UY1lqlDc
ZdM6RkQZYrjEQwKI1B33
Up1tVqJaAphZseAG4jHS
WKSmlWZkrgVlYWf2hU0s
IVDErfQ0OYaVDlCWyg6S
e0z7ZujODbDIbj2xTt...

output:

9036
9 1 1
-3 17 19
-3 18 19
-3 19 19
-1 20 18
-1 20 17
-1 20 16
-1 20 15
-1 20 14
-1 20 13
-1 20 12
-1 20 11
-1 20 10
-1 20 9
-1 20 8
-1 20 7
-1 20 6
-1 20 5
-1 17 18
-1 17 19
-3 16 20
-3 15 20
-3 14 20
-3 13 20
-3 12 20
-3 11 20
-3 10 20
-3 9 20
-3 8 20
-3 7 20
-3 6 20
-3 5 20
-3 4 20
-3 3 20
-3 2...

result:

ok puzzle solved

Test #51:

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

input:

20 20 20
uCpDKdlcfiz8NjvnwDYk
mKAuCe7a6dpk7NHWufta
c5j8YFbFLd2QRym9NlaO
vAvVMmSjHgecndh5o3M7
UHT0HbzzeXU3aE7cvlZO
GcFv703c3DcfsH4q2SQ2
PYQFiRxD1MuuxqASgAXd
4a99FXBR919oVtcUWDrL
mzdCgYMhEu5unVhoZc3y
nkxBHc3iDVukOJLKcDb6
AkuQjWy5XDWlcgF9ZlSF
llLSFzDuTgVaE9XsZ1lm
22o5CqBwkjJUJkKtlfN9
plx2z26inroVqlt4WK...

output:

8889
20 1 1
-3 13 17
-3 14 17
-3 15 17
-3 16 17
-3 17 17
-3 18 17
-3 19 17
-1 20 17
-1 20 18
-1 20 19
-1 13 16
-1 13 17
-3 12 18
-3 11 18
-3 10 18
-3 9 18
-3 8 18
-3 7 18
-3 6 18
-3 5 18
-3 4 18
-3 3 18
-3 2 18
-3 1 18
-1 13 15
-1 13 16
-1 13 17
-3 12 18
-3 11 18
-3 10 18
-3 9 18
-3 8 18
-3 7 18
-3 ...

result:

ok puzzle solved

Test #52:

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

input:

20 20 20
PyXA54zlpKKjWtTn3X7p
llywYP3ai3Wm3R9V7jr9
EI0nn3YCGvlExXhfwPOv
oriBfGStPvfiTgmEfRoQ
X2JCnZdEk8ugUzu6klj3
iUC9ClOpdIBHi76FRebI
xDH2XWqRwgigTVubbfA4
jLY6zmgDii4APyYnZ6kP
X93oYZGga6dNh9MqBEu7
4cyYstjs7na9ggRfHEDI
0kqFgIfrWIN2buje5Xv6
GwCtKMHIdjxnB4yLT29d
xWDcEwYDvHB7C6FhpZj0
U2Ic9xmb2Nz21qaaYK...

output:

12396
5 1 1
-1 4 12
-3 3 13
-3 2 13
-3 1 13
-3 4 11
-3 5 11
-1 6 11
-1 6 12
-1 6 13
-1 6 14
-1 6 15
-1 6 16
-1 6 17
-1 6 18
-1 6 19
-1 4 10
-1 4 11
-1 4 12
-3 3 13
-3 2 13
-3 1 13
-1 4 9
-1 4 10
-1 4 11
-1 4 12
-3 3 13
-3 2 13
-3 1 13
-1 4 8
-1 4 9
-1 4 10
-1 4 11
-1 4 12
-3 3 13
-3 2 13
-3 1 13
-1 ...

result:

ok puzzle solved

Test #53:

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

input:

20 20 20
7nFYchELMMunOmaUsBRu
qkpDbTU5OF8PYj6XHWJY
jh7IiHXIwRReS7LErUNQ
2SNkCEpXoR4F0JpvpOd4
h4e4QHrFBp0Hf0AmsXVP
DlRCEqrKp2FmeZEm0CKS
I2rIXA2rsEghzcDXCOXf
NjldsdlujCuavJcwBjCh
HDaEBmwFoHUxO4nj1E0H
O4NxCN61kYZwlZRhxvCx
gh1rRcuozu8OrtaLeRwb
pYRXi93CPfxzVNUl7UHf
9WFHsle8Zl6WA7BLCZyJ
CwJdvZLzhtGPIoJDUw...

output:

9530
8 1 1
-1 6 6
-3 5 7
-3 4 7
-3 3 7
-3 2 7
-3 1 7
-1 6 5
-1 6 6
-3 5 7
-3 4 7
-3 3 7
-3 2 7
-3 1 7
-1 6 4
-1 6 5
-1 6 6
-3 5 7
-3 4 7
-3 3 7
-3 2 7
-3 1 7
-1 6 3
-1 6 4
-1 6 5
-1 6 6
-3 5 7
-3 4 7
-3 3 7
-3 2 7
-3 1 7
-1 6 2
-1 6 3
-1 6 4
-1 6 5
-1 6 6
-3 5 7
-3 4 7
-3 3 7
-3 2 7
-3 1 7
-1 6 1
-1...

result:

ok puzzle solved

Test #54:

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

input:

20 20 1
GRIIdMTFsKggULlBNUhz
LB6zoaXH70AsiyXxGQUI
2j8xmNKvVCODANQ0aQpr
uL7iUK4GxPVICkwOOmIz
x3iL2bTB6JJwZB70JyDa
oxlNd1iFOTQJujPJVz3N
0qCAgeaYMTUAtsz6LSKC
GnJxAiuAlZW8a3Vzw2Ie
B3CLdxemBTNiMiiwdhK1
DzTjZU84GokeiQSQkdDV
3UHlnumPxJBr8x5vnfJk
fmkTO8IoxcoxX5DW2PWb
biT5i9kq9cxDdKILMg8u
LmhBmLV0zKa3AMVE3gR...

output:

6000
-1 20 14
-1 20 15
-1 20 16
-1 20 17
-1 20 18
-1 20 19
-1 20 9
-1 20 10
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 8
-1 20 9
-1 20 10
-1 20 11
-1 20 6
-1 20 7
-1 20 8
-1 20 9
-1 20 10
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 17
-1 20 18
-1 20 5
-1 20 6
-1 20 7
-1 20 8
...

result:

ok puzzle solved

Test #55:

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

input:

20 20 20
CM7SdT6KpEEaSyG48l4q
W5sIplUGUCODOTcnAs5j
Y9MDhEk2j8gGo2szfKvT
rbEJ06BIz6SIeOY4zFcL
IHjama00iIgcpJnDOrtS
BuOSMxqM55WBu6CzLy70
7B1S5ldILzV1lCLFwzbt
4JGsHMlx4uU4SFtIApy7
9vE5vmRrkC8ZnJ315Pe4
XwtkCEFkFo4KcEsgDeG9
Bdh5XiOan64CQ9nQjPz4
sMcNinHERhOO5FomjhDf
Esi3CwuVFVIDvbcpDPSf
WUZs6hM5iqmlMoUlgZ...

output:

11736
5 1 1
-1 4 8
-3 3 9
-3 2 9
-3 1 9
-1 4 7
-1 4 8
-3 3 9
-3 2 9
-3 1 9
-1 4 6
-1 4 7
-1 4 8
-3 3 9
-3 2 9
-3 1 9
-1 4 5
-1 4 6
-1 4 7
-1 4 8
-3 3 9
-3 2 9
-3 1 9
-1 4 4
-1 4 5
-1 4 6
-1 4 7
-1 4 8
-3 3 9
-3 2 9
-3 1 9
-1 4 3
-1 4 4
-1 4 5
-1 4 6
-1 4 7
-1 4 8
-3 3 9
-3 2 9
-3 1 9
-1 4 2
-1 4 3
-...

result:

ok puzzle solved

Test #56:

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

input:

20 20 1
MTyQWXYPbcRrlWTNp2gb
pbUxseIpI1qDfXY4ATGt
BgsP0KFYq11KhtABmZEO
NPE0GhdqS4mihnmkLcHE
0JZplwonGUDMi1iEu2kV
HNikWhlH4dzCtYqTTmA7
x3WtZWfBnoDaXEvx64af
K30MRaZvYEpE5Ip51q9h
X163WTD13G7eOaBCFa1v
DHqbYu6spwQcnttUZuLN
kNT6ENcr5hgF0iBosE8j
Q8HiYw5B3ecBCWfO8fhI
9Bkg627vX4a0Gn50a4FR
wWRQOALozYP3eietg6M...

output:

7431
-1 20 18
-1 20 17
-1 20 18
-1 20 19
-1 20 16
-1 20 15
-1 20 16
-1 20 17
-1 20 18
-1 20 14
-1 20 13
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 17
-1 20 18
-1 20 10
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 9
-1 20 10
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 17...

result:

ok puzzle solved

Test #57:

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

input:

20 20 2
ICU6S9xtPkIBJsYrGYgR
iLzLD9fvM5ESJqU6jq1L
Fjdi8vR1uWJo0yUeu2mP
Fx3OqhMVM790yvZXURTZ
uPcB6UUiBMcs2oOnAZI4
x9sSLaN4ww2mpfAgdICj
suNyjd1bnWnmx15lXuHh
m78P26ljNyEYsGT1K636
J8UHVXoU07WzGMR0bwZJ
AWIdmMM7JuW0g1VNDEPW
OhIthm0Bh9EXGdIeuXG1
HhqnidqnvgfZ0erZ8gFN
418jNfv6KIWt7VbnLbWN
UxpbHFUVrw8xQzXqfqS...

output:

11071
-3 19 20
-1 20 19
-1 20 18
-1 20 17
-1 20 16
-1 20 15
-1 20 14
-1 20 13
-1 20 12
-1 20 11
-1 20 10
-1 20 9
-1 20 8
-1 20 7
-1 20 6
-1 20 5
-1 20 4
-1 20 3
-1 20 2
-1 19 11
-1 19 12
-1 19 13
-1 19 14
-1 19 15
-1 19 16
-1 19 17
-1 19 18
-1 19 19
-3 18 20
-1 19 19
-1 19 18
-1 19 17
-1 19 16
-1 19...

result:

ok puzzle solved

Test #58:

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

input:

20 20 5
B0IWxFPgWe83QP8ztTsb
sm1dhQVQpnWsHJ46kDeM
TCJ6K49ylH08cdIYeNsS
9ljAn8Je4nyY8ISSLQD6
RV51Emzoj5h27UWzZ5MF
LrbmhL5a7MsFm53b4Ohr
8ERAYp60roJ4n651qQGl
WuAeIRuzpBhFmjsPo5Iu
AmbJanvMSnODErye5uSp
s0zzeVG1UmRUDCDMlmbF
0Ikvm1xcURQ4ZESTk7k5
mktjawfu8jo4g8MviaWc
D8GxOSCKM2WKCI8uyutO
Xxpwzayz74w8POmk8rX...

output:

11141
1 1 1
-1 15 13
-3 14 14
-3 13 14
-3 12 14
-3 11 14
-3 10 14
-3 9 14
-3 8 14
-3 7 14
-3 6 14
-3 5 14
-3 4 14
-3 3 14
-3 2 14
-3 1 14
-1 15 12
-1 15 13
-3 14 14
-3 13 14
-3 12 14
-3 11 14
-3 10 14
-3 9 14
-3 8 14
-3 7 14
-3 6 14
-3 5 14
-3 4 14
-3 3 14
-3 2 14
-3 1 14
-1 15 11
-1 15 12
-1 15 13
...

result:

ok puzzle solved

Test #59:

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

input:

20 20 10
VCCFEG3glLPUIajVoiVm
ls3rc8eHzbL8SAYEsAz2
4QlVn86PMrFiEkiNdPlw
fdgK8pdZkR8Aw87XpPdt
gbW9jptTojX2On6S3B7z
oWKiabJLInjNDkYxw46I
vTQM0zvOfMYvhPBxeK2v
TjyGQYa3C5pqu1WWQrgl
v6FNGY7sNcp92yV3ZHII
aNPDgEoytQ1ENFFofi6P
DDqXOdxGiZvKoMTMmlqB
Kqklmn5IMMxYuOXUUBPD
ORKPcWPmWwSAkvAFsDxT
jO6FUff3cnuMJV5iBP...

output:

10952
5 1 1
-1 15 12
-3 14 13
-3 13 13
-3 12 13
-3 11 13
-3 10 13
-3 9 13
-3 8 13
-3 7 13
-3 6 13
-3 5 13
-3 4 13
-3 3 13
-3 2 13
-3 1 13
-1 15 11
-1 15 12
-3 14 13
-3 13 13
-3 12 13
-3 11 13
-3 10 13
-3 9 13
-3 8 13
-3 7 13
-3 6 13
-3 5 13
-3 4 13
-3 3 13
-3 2 13
-3 1 13
-1 15 10
-1 15 11
-1 15 12
...

result:

ok puzzle solved

Test #60:

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

input:

20 20 10
WJS3QKFOQ4cAQd2lBPfF
iDKA6rm8PNKGU5q646Cx
pAKXVqnY395pi2XInQef
CUxvIUGpRCs2i5mP0iAi
mfIlQ50mJXA0ofnunbfC
PNEX2VBVSDd0RrWYbS31
YBvFPqNjsKQSotDbKyrK
U88a8pJ9Ymd5cH2PG5qa
NY7Azk814LycAaGUf08a
lAeq5FV585SBOaEzL54B
UZMZhheJJhYqZaCU9cxR
RgkbOmfDiuiTz0JaD48y
AQZJnQmpqESVXwuv4ozK
WYlUAePuI5A3Mq1N73...

output:

10898
7 1 1
-3 10 12
-3 11 12
-3 12 12
-3 13 12
-3 14 12
-3 15 12
-3 16 12
-3 17 12
-3 18 12
-3 19 12
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 17
-1 20 18
-1 20 19
-1 10 11
-1 10 12
-3 9 13
-3 8 13
-3 7 13
-3 6 13
-3 5 13
-3 4 13
-3 3 13
-3 2 13
-3 1 13
-1 10 10
-1 10 11
-1 10 12
-3 9 13
-...

result:

ok puzzle solved

Test #61:

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

input:

20 20 10
1np96bn08nWTfaJkaB5U
bUPWhuoIAav9iTKNq3s9
mUJBwmoBdLCimsYgBMua
3DeHjm7zrW9amrFUE5Ly
ftx5DJ70yLsUEJ8lO2yM
Ar84SWTJ56QUU5dECTLI
OrlBVQwoZ2j10f8TaX3a
6AEgF3fYX4JWnOj8Ixqi
hsxwHx8phLn5mbPsJ5Bv
KGYFOtTpxQARvMSutwHC
LyYBhBWquhsKKQfVwbNo
iZtjYsNjtPuBxRqDSXFl
sPEq7nEan47a0KS1BEqf
WIyT5E6SF0U0ouVxBX...

output:

10986
3 1 1
-1 8 11
-3 7 12
-3 6 12
-3 5 12
-3 4 12
-3 3 12
-3 2 12
-3 1 12
-1 8 10
-1 8 11
-3 7 12
-3 6 12
-3 5 12
-3 4 12
-3 3 12
-3 2 12
-3 1 12
-1 8 9
-1 8 10
-1 8 11
-3 7 12
-3 6 12
-3 5 12
-3 4 12
-3 3 12
-3 2 12
-3 1 12
-1 8 8
-1 8 9
-1 8 10
-1 8 11
-3 7 12
-3 6 12
-3 5 12
-3 4 12
-3 3 12
-3 ...

result:

ok puzzle solved

Test #62:

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

input:

20 20 10
kBz8KBHyk6reVlEGI0Ry
8OlKrcXOz0az1SaZ2kyI
3iNZJL5RgPKeBF5TXRnV
mo3LhbRB4Z3HrG5G9nQC
q5T3JcHtfC47qVhfDCv3
mwGcdvKPPBnuVJK3pKFu
i1CTJZT5TWKGVFV0jqcd
WEWUkcV868XD6X2ZsB5P
vdNAqbwRPUTL2dfSz2uD
CD29vbp5sSBktgfDVGJo
i02vBeOwiFltzaI8cgLj
3CarlGkaqLVlq3A5OFrr
MXuG1cEUGrLnlQtwFheY
gxgMQMPYMvxNKJSq9Y...

output:

9235
3 1 1
-1 3 11
-3 2 12
-3 1 12
-1 3 10
-1 3 11
-3 2 12
-3 1 12
-1 3 9
-1 3 10
-1 3 11
-3 2 12
-3 1 12
-1 3 8
-1 3 9
-1 3 10
-1 3 11
-3 2 12
-3 1 12
-1 3 7
-1 3 8
-1 3 9
-1 3 10
-1 3 11
-3 2 12
-3 1 12
-1 3 6
-1 3 7
-1 3 8
-1 3 9
-1 3 10
-1 3 11
-3 2 12
-3 1 12
-1 3 5
-1 3 6
-1 3 7
-1 3 8
-1 3 9
...

result:

ok puzzle solved

Test #63:

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

input:

20 20 20
B6Li3lbfg2kxNpH0AhVt
64CF9rXG2jC24tv28OPr
vxlCOLiSmKcKx35XxLvR
Bzf7imUQrwIedLgsc041
m80UUunkjjQzHn9cTNgA
S2PR23cWxck36vv0768A
TPgh3zhkPAM1QKJSN561
dwFSjW5LeASbhzKrkRrD
16FOuGm1bYttxsKxJm2D
qmwbV9hrAhq3u83BK243
Ag8fWW1rpzvi1NH3f1HW
MJa6y0Sayg1qjVPzAkWq
slZHTfRc4eSpTMJPIEBB
f2czqqDTJYcsI8wELW...

output:

10056
20 1 1
-1 19 9
-3 18 10
-3 17 10
-3 16 10
-3 15 10
-3 14 10
-3 13 10
-3 12 10
-3 11 10
-3 10 10
-3 9 10
-3 8 10
-3 7 10
-3 6 10
-3 5 10
-3 4 10
-3 3 10
-3 2 10
-3 1 10
-3 19 8
-1 20 8
-1 20 9
-1 20 10
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 17
-1 20 18
-1 20 19
-1 19 7
-1 1...

result:

ok puzzle solved

Test #64:

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

input:

20 20 20
g8X2nyhwY7LkLvxmpe9t
1d3ZV43wWRvOTq3ouHdN
CdtRvKJoNINzxAsEQ4sX
KtKR4KgAN9O6CzOdHOTp
UI9eYeAg5ck36hH0Fpav
WtjFXuC9Eq0uKhL005ZL
eglSeS2WW8ZLZk5q1iSy
XWPvilTk8Iyyxov6TqZF
yDwog6WRwkp6W0qIQmUR
LVjwvv4Yl8fGuOOqDFZ6
Dyvplr9tYhpZ1iUl8EHh
YvlAc7XY2UY3zA0KHwpa
cUBAAxt5TR9tpxpDG4VT
SLhsI6xvsZspir2lpQ...

output:

9018
15 1 1
-3 5 3
-3 6 3
-3 7 3
-3 8 3
-3 9 3
-3 10 3
-3 11 3
-3 12 3
-3 13 3
-3 14 3
-3 15 3
-3 16 3
-3 17 3
-3 18 3
-3 19 3
-1 20 3
-1 20 4
-1 20 5
-1 20 6
-1 20 7
-1 20 8
-1 20 9
-1 20 10
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 17
-1 20 18
-1 20 19
-3 5 2
-3 6 2
-3 7 2
-3 8 2...

result:

ok puzzle solved

Test #65:

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

input:

20 20 20
X2Gme643Y6EWWXHqQBxo
hcakWJGIgbbOUuqE55Mo
o20iphDkXoKUTnSvxOwh
VmkaZQtBKBFBfwc6tJyD
qRBQov6jSjAypnVJ048g
sfC4U3mJSvIZBs9E0iWM
Jrg1qepdBy4N8vaBWKPx
imtSJzEEIWNAuz1zSWJD
IlYeoh1dR3MwUVHBINA6
It4Dkr0rxK6NSwdE4Ue4
lWV5F6PT8XOlsd3gyU3r
jtPQMlmqBIbFpUKbh9dT
WL6c7bQzwlIciVJBQ4iI
z4uDSC3YMtcDVNbzYh...

output:

9379
3 1 1
-3 1 1
-3 2 1
-3 3 1
-3 4 1
-3 5 1
-3 6 1
-3 7 1
-3 8 1
-3 9 1
-3 10 1
-3 11 1
-3 12 1
-3 13 1
-3 14 1
-3 15 1
-3 16 1
-1 17 1
-1 17 2
-1 17 3
-1 17 4
-1 17 5
-1 17 6
-1 17 7
-1 17 8
-1 17 9
-1 17 10
-1 17 11
-1 17 12
-1 17 13
-1 17 14
-1 17 15
-1 17 16
-1 17 17
-1 17 18
-1 17 19
2 1 1
-1...

result:

ok puzzle solved

Test #66:

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

input:

20 20 20
VKvfNbABwRvVWBeUI1Sr
pv3zg3ue68PRGcrvjaHh
UNrPpZNl8nDQFXLkbe6p
rA4z2ImXQDguGstKggfJ
1N1n07Qej8GXf0fuNV4L
ZHYNPKHtUd6tbMSGiGM9
eUE9TQfEhcHG5T2PQyL2
CFKDRB4aORAnlswlD3lp
y2pzXHcgLhuRayW1Rq7e
d6iskxDQDKSHOiyo89mM
ztzdBMppclYqyqOhkA29
Ebc4lFVzkYR06aCvOxZC
tmF5okDKSfly78Jk2rw7
YnqdE5LfzTqF4uIu6I...

output:

5799
1 1 1
-1 20 17
-1 20 18
-1 20 16
-1 20 17
-1 20 14
-1 20 13
-1 20 14
-1 20 15
-1 20 12
-1 20 13
-1 20 14
-1 20 11
-1 20 10
-1 20 11
-1 20 9
-1 20 8
-1 20 9
-1 20 7
-1 20 8
-1 20 9
-1 20 10
-1 20 11
-1 20 12
-1 20 6
-1 20 7
-1 20 8
-1 20 9
-1 20 5
-1 20 6
-1 20 7
-1 20 8
-1 20 9
-1 20 10
-1 20 1...

result:

ok puzzle solved

Test #67:

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

input:

20 20 20
H3BSK2rj8WIR3DTD8v8e
kvcv33DjPwCEPCypKllF
7egrmiWciT8kkRhScdVX
K5rLFSTp9hfWzYpYafqn
KHBRxtKiXRapXDepxsEZ
DhJsFw4WA2fOfTg85md3
fzQpK8D5hOBEpyT6lUoN
gmrAUG7rYFdFBdq99X3T
OuijsolVxKNcMzhbnlww
pm3T6pJ5i92fMLzmebmT
es2sZeakDHLQnkYKfC5R
ZUXEAivFI1VTRojVvIsv
QmGwwzkgroUBdbVJLnij
hPsbizqRrdfWjo156Z...

output:

8783
3 1 1
-1 14 8
-3 13 9
-3 12 9
-3 11 9
-3 10 9
-3 9 9
-3 8 9
-3 7 9
-3 6 9
-3 5 9
-3 4 9
-3 3 9
-3 2 9
-3 1 9
-1 14 7
-1 14 8
-3 13 9
-3 12 9
-3 11 9
-3 10 9
-3 9 9
-3 8 9
-3 7 9
-3 6 9
-3 5 9
-3 4 9
-3 3 9
-3 2 9
-3 1 9
-1 14 6
-1 14 7
-1 14 8
-3 13 9
-3 12 9
-3 11 9
-3 10 9
-3 9 9
-3 8 9
-3 7 ...

result:

ok puzzle solved

Test #68:

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

input:

20 20 20
SPomST3xaIkgoNxUlolq
rUYsMr7yAmn8kNVfx1x2
UvXdWMxKR7twqSuFCa95
8WFftzea3ICiXLUJ1o2n
o8ms4dT8npS49zypDjNA
AmYCD2TVmIoBI4HQ4lk7
FaaRoNPdECGL83xdZL4j
n9bKLPv3UlyPLF5AFOKF
lJulCAWhBrAbcT6iPdNe
0VuXyXlyssZ1RCg7BPt4
hCaeJ2aFUEvtLqRn4U5d
gi5GRdy60LP9ct6tvjzX
AIHDg25tbsNfEkQMAbaC
XzBltKyM59jVM3hmlT...

output:

10674
5 1 1
-1 6 11
-3 5 12
-3 4 12
-3 3 12
-3 2 12
-3 1 12
-1 6 10
-1 6 11
-3 5 12
-3 4 12
-3 3 12
-3 2 12
-3 1 12
-1 6 9
-1 6 10
-1 6 11
-3 5 12
-3 4 12
-3 3 12
-3 2 12
-3 1 12
-1 6 8
-1 6 9
-1 6 10
-1 6 11
-3 5 12
-3 4 12
-3 3 12
-3 2 12
-3 1 12
-1 6 7
-1 6 8
-1 6 9
-1 6 10
-1 6 11
-3 5 12
-3 4 1...

result:

ok puzzle solved

Test #69:

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

input:

20 20 20
6HiGW2cPyGcogGWnNU9C
EQPvZsYpYYrsffSh3IPN
CZ8CRytUHq3XQQ27pbcp
Hkb7EwHEK8qJ4aTzbpJJ
I6JQBV75BJoCuSzxMMdi
ZI9XNcooyYsgEWjxhNWh
FDTAsvDMNWANXcxVpkfu
RryFEKw2RxZps6kQhY67
5lFN7XFvXQgJAWM77enW
KKJAI87fNZSpSlfdHKxX
yCPShxpLtqPbSkIU1WUv
ZKg5xsU0CMPpo7o3O8bV
cFNc8RsXCbi8yuFoNjtm
AZCmPoT2h1uHp1YPlC...

output:

11428
1 1 1
-3 7 2
-3 8 2
-3 9 2
-3 10 2
-3 11 2
-3 12 2
-3 13 2
-3 14 2
-3 15 2
-3 16 2
-3 17 2
-3 18 2
-3 19 2
-1 20 2
-1 20 3
-1 20 4
-1 20 5
-1 20 6
-1 20 7
-1 20 8
-1 20 9
-1 20 10
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 17
-1 20 18
-1 20 19
-1 7 1
-1 7 2
-3 6 3
-3 5 3
-3 4 ...

result:

ok puzzle solved

Test #70:

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

input:

20 20 20
1H4sCjmQWZFkjgm6fzyr
bgnkNyCmW6geFWX7JPQN
I5DegyUuVAuiufjmizsO
LQ5o6KjGlclKaiJZd8nA
fTd9bjd5z7TwinkzyfEr
iZafJTOapu1Vl5u4IMKA
KuApFQQ6VKiKbydrlz2V
sz5WQkIuiSnCuZm8MpJc
M4q7C1CzdmHWF9jJ7qZO
JQYbpyfZAe0MQBjt3zdp
IqOXbcetgQyEKANJ9L30
oq5aPDJeBtyB0ccmIxbQ
DpIQU2jUBPr2aIwEgGyg
PTRMduHB0Z12lvKnhu...

output:

8652
6 1 1
-1 15 15
-1 15 16
-1 15 17
-1 15 18
-1 15 19
-3 14 20
-1 15 14
-1 15 15
-3 14 16
-3 13 16
-3 12 16
-3 11 16
-3 10 16
-3 9 16
-3 8 16
-3 7 16
-3 6 16
-3 5 16
-3 4 16
-3 3 16
-3 2 16
-3 1 16
-1 15 13
-1 15 14
-1 15 15
-3 14 16
-3 13 16
-3 12 16
-3 11 16
-3 10 16
-3 9 16
-3 8 16
-3 7 16
-3 6...

result:

ok puzzle solved

Test #71:

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

input:

20 20 20
JPj4zapqy1Rknj5PNROn
ZpspEyHzyqcLOu0Xd4C6
VAsTmUYo16UQWdLYnuhq
chwAIJU9EUsf7TC137yn
ZNVzAB85lMo2T0jfiIaA
XCVUHJfP5aY8x4Sjmjjq
CdMKtc6BVtcEul1E3WNL
U8IXUuEHly5YJN7SibnG
RvbI0wQaVWXhg6ELOqte
V5UqbekqbEagP3jrdBdk
nhhjzIQvEc9WCGTc0K6V
F2IOdomk3syqClUMpIzF
1otlddVi6ZV2cyA33yfB
cq1KNQu5ObMkExbUhH...

output:

11123
9 1 1
-1 20 12
-3 19 13
-3 18 13
-3 17 13
-3 16 13
-3 15 13
-3 14 13
-3 13 13
-3 12 13
-3 11 13
-3 10 13
-3 9 13
-3 8 13
-3 7 13
-3 6 13
-3 5 13
-3 4 13
-3 3 13
-3 2 13
-3 1 13
-1 20 11
-1 20 12
-3 19 13
-3 18 13
-3 17 13
-3 16 13
-3 15 13
-3 14 13
-3 13 13
-3 12 13
-3 11 13
-3 10 13
-3 9 13
-...

result:

ok puzzle solved

Test #72:

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

input:

20 20 20
uUOURYEV94AEwVPXku3k
31yy5wI5vjCbcVU6gmL8
FEoEMXwl4Gh8ICCxrlL2
wczusVK9WGAoanUFdD7P
Bw6KdYVYouVEhGNw9urw
ihBqvumihelryWB2lpw8
YKsPbmxqRa8E2PiAbhnm
q6qVmj3AUCMeqk5dufdy
2iVY82hc8PkLtsIDRDQe
rU3qRgh9qfz0pnaFV6OU
Jy375ndLvhUGQhHydQ8o
OQinvRYf08IoLCebGlIr
FX8vHVbN8zpm2TFacUtf
BtX6OsaLnwoMsz1xk3...

output:

9132
20 1 1
-1 14 8
-3 13 9
-3 12 9
-3 11 9
-3 10 9
-3 9 9
-3 8 9
-3 7 9
-3 6 9
-3 5 9
-3 4 9
-3 3 9
-3 2 9
-3 1 9
-1 14 7
-1 14 8
-3 13 9
-3 12 9
-3 11 9
-3 10 9
-3 9 9
-3 8 9
-3 7 9
-3 6 9
-3 5 9
-3 4 9
-3 3 9
-3 2 9
-3 1 9
-1 14 6
-1 14 7
-1 14 8
-3 13 9
-3 12 9
-3 11 9
-3 10 9
-3 9 9
-3 8 9
-3 7...

result:

ok puzzle solved

Test #73:

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

input:

20 20 20
MFI92ZKlwYoHoWaqUdJx
f1pFiAz0TVGw3vVhQ72T
o9vUPFwvQaJEZEa4pq0q
6H0iLSdyD6pLlU2rnEWb
0ytgKydZJLv8C3SJpXVa
DzQLyI3Ltpo6CXdFCW1e
Y6czn893Vy2GEYujuUCw
UBNYed7uRS8WazgiYlz4
UIaeDp8qqiWqZvnohMeS
bNiZdw0NLMowv69HK1JZ
3CwOHRsR4VfkYfG5iNau
xjtRkekay9II0lwLUhgp
hQb0ACqqzlMn02xLpUMV
i1Y7e6v5ugDu9FAWgM...

output:

9618
16 1 1
-1 3 13
-3 2 14
-3 1 14
-1 3 12
-1 3 13
-3 2 14
-3 1 14
-1 3 11
-1 3 12
-1 3 13
-3 2 14
-3 1 14
-1 3 10
-1 3 11
-1 3 12
-1 3 13
-3 2 14
-3 1 14
-1 3 9
-1 3 10
-1 3 11
-1 3 12
-1 3 13
-3 2 14
-3 1 14
-1 3 8
-1 3 9
-1 3 10
-1 3 11
-1 3 12
-1 3 13
-3 2 14
-3 1 14
-1 3 7
-1 3 8
-1 3 9
-1 3 1...

result:

ok puzzle solved

Test #74:

score: 0
Accepted
time: 7ms
memory: 4196kb

input:

20 20 20
CKpcOk9yn6QCmuCmx0jq
6kqnPqvvXzKZPCZj6q96
vOQFnRuO3WRytEZOAFyW
pt9pKWjXTqTq2KOtajc8
pQcOkQqOEQtq6aW2cQxz
XkCEaZXFm83vF83jEqOR
kQtRuA2W0zZnv3jtCKq8
8kQFTxW8WvuKnXT8An6a
QjqTk83zkqZCjTx9mTyv
F8ujtRPtnnkCF2xEKWzT
nRzqWXTpWOP3u3TkyXRA
xWnzCCvxXXP2kCRz2t6y
Pcv88F88vyxT0naqv2my
x9K66vKknQykTCCREO...

output:

49124
-1 20 18
-1 20 19
-1 20 17
-1 20 16
-1 20 17
-1 20 15
-1 20 16
-1 20 17
-1 20 18
-1 20 19
-1 20 14
-1 20 15
-1 20 16
-1 20 13
-1 20 14
-1 20 12
-1 20 13
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 10
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 17
-1 20 18
-1 20 ...

result:

ok puzzle solved

Test #75:

score: 0
Accepted
time: 7ms
memory: 4124kb

input:

20 20 20
UIu9E4VYBWa1CQ1a9GUq
SLVBXkX06BSLNEB687NC
U4I0UVU7CrPG0Njm4XUc
SkPXQ0LQV4ajqr7LxEVr
PNxQ7CV0Y91Yzu7LB4Cc
8WP9N6k71XOuzWN8cL0X
XQxarQW4mc6aLGxGjOP7
GPN8EOm04jz4WCGxxxCm
GaNUmNQ91YWrOz7UujYx
q0az6Sq4L8S6jE0CCqmS
Sr4Y7QO6NaEa7GkNEB0P
q8EW7L4ECjjXBrEYcSU6
xBrjLUx0W0aO4L8NuzSE
VqIcL71YjzG0L41GQI...

output:

47614
-1 20 19
-1 20 16
-1 20 17
-1 20 18
-1 20 14
-1 20 15
-1 20 16
-1 20 17
-1 20 18
-1 20 19
-1 20 13
-1 20 14
-1 20 15
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 10
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 9
-1 20 10
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 1...

result:

ok puzzle solved

Test #76:

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

input:

20 20 20
dFugZdaOO5owXbpW5dXZ
CrOqreoY2EOdizXoxEZu
OttOiQQ5iFoOzpHiQwXe
QFCYagHt2XtYQzopzuY5
vZUUbqjHUttHrijbweio
CvoqaEjEFbtQxg5iqoOU
jO6YbFXvw5ObaxoYdWb6
oYZejzU5UgHQvpxpOtl6
Ya5ZOY6UwiawZQZwQCtH
zOCHvolxClQt2W5pWQoY
qoHYQ2lxjpFCq5geEqgt
5Xzr2tllCgoQizQCWmlE
ztx2xdioZt6o55oboavv
tZaUWjqOtuwpbXwY5m...

output:

49353
-1 20 17
-1 20 18
-1 20 19
-1 20 16
-1 20 17
-1 20 15
-1 20 16
-1 20 17
-1 20 18
-1 20 14
-1 20 15
-1 20 16
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 17
-1 20 12
-1 20 13
-1 20 14
-1 20 11
-1 20 10
-1 20 11
-1 20 9
-1 20 10
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 17
-1 20 1...

result:

ok puzzle solved

Test #77:

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

input:

20 20 20
6yUSeY7PHaU2n1o7n7kO
rnyH2xekekx1lZCoIovh
6aFUx7rLnFnTyy03M1Ya
ePm712oUUPS7hIlL2MhL
ClWFU266PeYZC3Ux1akL
xnyWMUOCIPmUSIyHZ1kO
orvOSZx0TyUTmLkHYvkC
eWxy1Tne1LHZW8vLT3Zm
eakCkkhh2IlFmUeklHIW
Tm6Ix3l16xare1ClO327
0MLMTUUeynLWkLU73ZY8
FHHlYUSvheYklLSCTaHU
2yyyk6WmOMULSIkMTomO
6WYLM27U7rI0eTrr6o...

output:

66349
-1 20 16
-1 20 17
-1 20 18
-1 20 13
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 9
-1 20 10
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 8
-1 20 9
-1 20 10
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 7
-1 20 8
-1 20 9
-1 20 10
-1 ...

result:

ok puzzle solved

Test #78:

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

input:

20 20 20
n0fr3nQ8OYLN8z1B8gTT
LfMmUtU1LitzV5NU8185
BcsNnm0Tz3Yfch5fTfmm
TcsmOiicTNwOh8t5chgQ
BQwY8tU10tThh1hYmxBO
NrBNJxrYmJknOOB0f38h
0wFKJVBUOkMKJz3fJkJ3
tLnFtzBgcN8Kms1tUgYO
TwchYrM0f8xNtMOBYBfY
zQKJKgxhc5czMJMtLQ8k
g8YKfxzMmLfOJTct0TnO
cYMVBnLwYhkVwNJ5xwFZ
1QiVikgm5NfkTFrmQctx
LwgZ01s8mgQ31t81TL...

output:

49749
-1 20 19
-1 20 18
-1 20 19
-1 20 17
-1 20 18
-1 20 19
-1 20 16
-1 20 17
-1 20 14
-1 20 15
-1 20 16
-1 20 17
-1 20 18
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 12
-1 20 10
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 17
-1 20 9
-1 20 10
-1 20 8
-1 20 9
-1 20 7
-1 20 8
-1 20 6
-1 ...

result:

ok puzzle solved

Test #79:

score: 0
Accepted
time: 2ms
memory: 4236kb

input:

20 20 20
ab95SFEwWnqa5SbCOS7q
2WO4iHZFLpWwZWCpMEvV
VBvEWwJWOtCrw2Cb2Ehp
rVHJhFNtBJhtSb4asaL2
hECNFnLvsQvrSLwFtv7W
ChswyBtEhvsJLMVbB4bO
B4yBMhi4QBhqE5CEEQ9L
LVbC242JE2rpNJwpHZqi
br9tVtbENEQS4hQVEnrq
OpS9n4r7FH774p5BHZLq
aCwpZBB9iNFE5Fn2bytO
nhZ2E4Bi9NnwsnnhwtBp
2S7ONaSbw277OBVpFpiS
iVrMabHWNEnVVECW2y...

output:

48931
-1 20 18
-1 20 19
-1 20 17
-1 20 18
-1 20 19
-1 20 16
-1 20 15
-1 20 16
-1 20 17
-1 20 18
-1 20 14
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 17
-1 20 18
-1 20 12
-1 20 13
-1 20 14
-1 20 11
-1 20 12
-1 20 13
-1 20 9
-1 20 10
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 17
-1 20 8...

result:

ok puzzle solved

Test #80:

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

input:

20 20 20
8Q84udHHOsNsJB9Ar8Kw
uAboSXmCKWkX0RmJoAd2
1CK8oK84C8rJsXGR1XRH
NH0r1QXns44QB2doN0sG
CGWA8J9CK4OBIq1AS9mu
oG9WGOb2u91AJbJ9KS4A
u9kQ0Qss8NJXQdIUX1kN
JOCwrJOUR2U0CbJuUb9I
WnKKdmwuR2qNrISHm82Q
KmmNbkSNwXqwsJUUIHsK
GA4duAwIs42sGXmInAuQ
WASXo8JuIk2HkJowmQBX
RIJAw4XJ0Xu1XnXbXBSU
dw8uKJ09UkqX4bC4C4...

output:

88423
-1 20 18
-1 20 16
-1 20 17
-1 20 15
-1 20 14
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 17
-1 20 18
-1 20 10
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 17
-1 20 9
-1 20 8
-1 20 9
-1 20 10
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 7
-1 20 8
-1 20 9
-1 ...

result:

ok puzzle solved

Test #81:

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

input:

20 20 20
D9lK7ccTL8Eri5JUYLJq
79JwKpYwafaax3iYKr3C
JlHZpXCXflCL9Ca4JpJT
xCU8piVaZJBTc3EwTDYV
w383ET9YOrUrHqB3C54l
8a5JJZOw3ECfCcZ5iflc
93Y4fExTKppX4O48C7Jl
8ELWaWDE58LOaEiYw7Cp
KH7f4H48xOT8x9UTfai5
lKXWaz5aBU8H5Uw5YL4E
EXlfL7pXY8lw9CXplaHw
OaTaVT7zOEp5aaY9KEpa
K87VrK8pK4xDiX7UJUrl
ZrKqJaCcOfwYzKVqJc...

output:

76376
-1 20 19
-1 20 18
-1 20 19
-1 20 17
-1 20 16
-1 20 17
-1 20 15
-1 20 16
-1 20 17
-1 20 18
-1 20 14
-1 20 15
-1 20 16
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 10
-1 20 11
-1 20 9
-1 20 10
-1 20 11
-1 20 8
-1 20 9
-1 20 10
-1 20 11
-1 20 12
...

result:

ok puzzle solved

Test #82:

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

input:

20 20 20
mwTEj1UG4wnGUMhODG22
Bc2Bgmko2wlPhX2ycEau
hTklU2T4PhDnobMLL4yo
fDlJMgXlBgnnoBlOEEOX
1MbM3uDcwLXna5jBoBfV
gbfTuXTkDOlwOcwcDTbB
OuEy4UMOoOGuXXUnT2b4
O3MmBlw5EbDjmm5ugLMP
hycMEfDjGoG5cJD2uDnB
23y5bcjPEMTPjP23b1BL
mTVhwBG1yOLBOEy2nuEw
VTDgGE4GlmGGDoUmkJD4
1ounLGXhmkL3acMPTuOG
Pu1TVOa2VUaoE1GUwh...

output:

82187
-1 20 17
-1 20 16
-1 20 15
-1 20 16
-1 20 17
-1 20 18
-1 20 19
-1 20 13
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 17
-1 20 18
-1 20 11
-1 20 10
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 9
-1 20 10
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 17
-1 20 8...

result:

ok puzzle solved

Test #83:

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

input:

20 20 20
5gZhZeyUW5yg2eKXbZHY
H3iUe57EENigBcv2ZKDc
ecDEJAPX9Qb2E6XPsDBS
ciQiQY5DDQZSK2gDsDsb
Uc3G27sQKhiHs8UJGEJY
ESAghgbPY3XBciSe5hZW
W37NKh6N9gE58GeBZbN7
gyy3EGJ9DUKK6G625Z5s
is2Wh2iJXE9GWhEbUW23
9WEXigcWGW6Nc6XyX8e9
3HHvcHDGyS5bAU9UZb6P
7G567y3eQbZPDbvEvYgi
PZgKy5DUeZvYJhiUcDJB
35HYZJQYWUBUZvXccU...

output:

50790
-1 20 19
-1 20 17
-1 20 18
-1 20 16
-1 20 17
-1 20 18
-1 20 15
-1 20 16
-1 20 17
-1 20 18
-1 20 14
-1 20 15
-1 20 16
-1 20 17
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 17
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 17
-1 20 18
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 10
-1 20 ...

result:

ok puzzle solved

Test #84:

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

input:

20 20 20
zP4AluHxqnwA2n2l1Hwg
6qqAJlagyxaJdH6yIj2I
H2n1VaxdHZLjIq44Z4jp
JaSuVxIQ4SxZJLzzVwaz
yaH6qrPpuPJSqaoS4loz
224j4Ppr4gjAw2yyhjjH
dS1oQlLAoedInJp11wxL
1ZpSyeHqwXohd61lqIoX
4LLpojh2yJ4Ju1HL1Xdh
o6jXr6wydpPenPwNnpxl
eggSjhQAdJXopSxJlq2a
41Jez1hH1126SPg1lhgZ
wL1n1SywLVrHJNL6nhVh
AxlweaxJN1Qy2re1SX...

output:

49821
-1 20 18
-1 20 19
-1 20 17
-1 20 18
-1 20 16
-1 20 15
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 17
-1 20 11
-1 20 10
-1 20 9
-1 20 10
-1 20 11
-1 20 12
-1 20 13
-1 20 8
-1 20 9
-1 20 10
-1 20 11
-1 20 12
-1 20 7
-1 20 8
-1 20 9
-1 20 10
-1 20 11
-1 20 6
-1 20 7
-1 20 8
-1 20 9
-1 20 10
-1 20 1...

result:

ok puzzle solved

Test #85:

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

input:

20 20 20
mfasw73wtgikkyO8Y4td
i4NHmprDcadxyryE4aJw
cykbb8cyrHEmyeDgtyiO
fDWrwNW7YbVi0mWNVVia
YsYVpsTrJ0OEd8kwidsw
Ts7DVf4g33iPDx4Oi34D
TyrEaisirdkmsyWTTEia
sxk3mT8HDHNbDxx4Jsmi
iP7E7cDycT0WaibYP83a
ygwVTsNNJwDDkJWJ3NOP
kPWmmfk7sxiO8srsgkNT
8afipbk70NHY0p0V7pJ0
kVHweDiNbyyHigEdcrmb
wxHcJtr0fWfxTTptP0...

output:

50698
-1 20 17
-1 20 18
-1 20 19
-1 20 15
-1 20 16
-1 20 14
-1 20 15
-1 20 16
-1 20 17
-1 20 18
-1 20 19
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 17
-1 20 18
-1 20 19
-1 20 12
-1 20 13
-1 20 14
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 10
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 ...

result:

ok puzzle solved

Test #86:

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

input:

20 20 20
YM5KKZsVmmOMK5zt1nzT
MnYjZyCs1lCaDK9BzTne
5CV8NYPNtONTrY5wBNhz
VDD1MeUMjCsorT319aYl
ysyPKXBKKCynUBn9OVl8
Vs1DBhXzCnrDo1B8zsr9
3U9rzVZVlOmTD3OD159V
3nZoKemKjwTzssmoyOBm
NNP1ZszXThXjlNsPYZzs
Y5MPnlKK9wX8MVyejzr3
w9PzZjyXarOljtTTyUzn
hBVrNVaCXllB9rowTDDD
YayMPm5h5MyZj1wYOBCP
PtKhOCDC5XBlVPDMeV...

output:

88359
-1 20 18
-1 20 17
-1 20 18
-1 20 15
-1 20 14
-1 20 15
-1 20 13
-1 20 14
-1 20 11
-1 20 12
-1 20 13
-1 20 10
-1 20 11
-1 20 9
-1 20 10
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 8
-1 20 9
-1 20 10
-1 20 11
-1 20 12
-1 20 13
-1 20 7
-1 20 8
-1 20 9
-1 20 10
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 ...

result:

ok puzzle solved

Test #87:

score: 0
Accepted
time: 6ms
memory: 5192kb

input:

20 20 20
RWT7kvT7vMZt97GPDGLa
D9v0xkZA7tI0aXqCZCIr
bGrLA0DWRLt7JGxdRraI
yXTxabDJkrGaTaeuxiyT
a1aKZbX0xgXIAbGZLaCr
DiAeZGRMk0K1i090MyJb
RXIy1Dd0WIAtRguqvuIM
Jkk7dPvTrPduLuICRvdG
Prgart0Pd0AgikRi1tKC
rx9e1AtTPRbdT0CiGvMI
PeALDGa1PraWLqkirCAW
eMMZvJMiCZXtkeyitr1u
PZTvdL0Ra77qtJR1yuJA
IditIW0arq1gb9bAGr...

output:

74485
-1 20 19
-1 20 17
-1 20 18
-1 20 19
-1 20 15
-1 20 16
-1 20 17
-1 20 14
-1 20 13
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 9
-1 20 10
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 8
-1 20 9
-1 20 7
-1 20 8
-1 20 9
-1 20 10
-1 20 11
-1 20 12
-1 ...

result:

ok puzzle solved

Test #88:

score: 0
Accepted
time: 10ms
memory: 5248kb

input:

20 20 20
rv4XOQlv5OleShb4P594
hy5jXZhhhmM8XjeMJGbk
ZQ58mvVnNynE7Xvoy5MN
oFFoeEOo714N4PvZ7FLZ
jGjjZXFl1h9PE7VvroVX
VbNGZLJ9yF7brRJQ7V9R
8lMrvh5E7rR7PyZVeERS
8mZ8evVLPvrJejGmrOjS
vjeXnZSPPmo7GGr7GvXG
5j4G5G1hvyMyn4ykVlbE
9rFGSoMoyv5jL7XGyVPP
SmRPEMyQQjeOO4mj4bXo
VJ8OFFOk7ZPoFnv9r7VZ
jF8on4ejGR7JrXbEEk...

output:

80378
-1 20 19
-1 20 17
-1 20 18
-1 20 16
-1 20 17
-1 20 18
-1 20 19
-1 20 15
-1 20 14
-1 20 15
-1 20 16
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 17
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 10
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 ...

result:

ok puzzle solved

Test #89:

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

input:

20 20 20
vM9i8W0llFAagG50yoia
IAAkRJGv3Lckv8k1xd1y
MW0Ql3kcyil8uQ3xdRSG
oGPogcS2PWagMx0Ak3xn
RvIJARd151Mocgou54xR
kv5nIQFaSnlJ3uLQ8y88
xLSyM4Inuk1k4xk4v20g
A9PvynWx4vFaJIayWSlI
x5My0LgRFlaFoyigk4Wu
S1GM2i35MQFa2S3Q51o5
RoFgLnnvR8Ldy1G0WF13
k2aLgWuIi3SJn1vn5lAo
9FRaJd8RAdWxi311lIFP
loWQiuQyW0M5k2xG9G...

output:

69214
-1 20 19
-1 20 18
-1 20 19
-1 20 17
-1 20 16
-1 20 15
-1 20 14
-1 20 15
-1 20 16
-1 20 17
-1 20 18
-1 20 13
-1 20 12
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 17
-1 20 18
-1 20 19
-1 20 8
-1 20 7
-1 20 6
-1 20 7
-1 20 8
-1 20 9
-1 20 5
-1 20 6
-1 20 7
-1 20 8
-1 20 4
-1 20 3
...

result:

ok puzzle solved

Test #90:

score: 0
Accepted
time: 7ms
memory: 5172kb

input:

20 20 20
z2hcHoMMiGEiwuQQtt0Q
yyOieykRki0O7H2RkfkR
NHTljcBcOufhGMNQhJGe
zm4TNlezZlTQKzfZ4uKh
QhHuR0mOHOKEftlZotG0
GBJgGMfNE4oloHH24JKc
Qoulcy77BiyoOMtMlMKt
yoZt7uJQ2efh4GHflzu7
ooZcTZMm7cQZ2BcMkoki
BluRKkyKlOKg04fG04mi
4OthgmQKNfT7h24zck2l
NZ7luJKGEgZgclQBleZB
TK7R0wGMT2gglfTtywwy
KKkGOMBJiewzM7J72f...

output:

74820
-1 20 17
-1 20 18
-1 20 19
-1 20 16
-1 20 15
-1 20 16
-1 20 17
-1 20 18
-1 20 14
-1 20 15
-1 20 16
-1 20 13
-1 20 14
-1 20 12
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 17
-1 20 10
-1 20 11
-1 20 9
-1 20 10
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 8
-1 20 9
-1 20 10
...

result:

ok puzzle solved

Test #91:

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

input:

20 20 20
i1lJiDDDgkJB7Y3uiYUD
io7E1k7rMtlontrY5HDg
rMpMYxwtuv6tYwkuED5z
8ukJ56rdu8riDuMYdYzp
po3BLYE8EgdBz3v7YLnx
zUHnE6YdBw3wiJ5EHl3n
YzRxr3EHvwgxgHdRG18w
p1vtiHxlntpqvpBdYipG
YBDkMlriLLpk1u6E66ii
GgzrvEDLwqt3tG8nt7Lp
G1xwlYHHEoRBERx38pRp
RB1g6dvt7vzR8uUBvod8
51LiwEpgq6Jdowo6lg5v
JdxL175puoM3dR5rnJ...

output:

81902
-1 20 19
-1 20 18
-1 20 17
-1 20 18
-1 20 19
-1 20 16
-1 20 17
-1 20 15
-1 20 16
-1 20 14
-1 20 15
-1 20 16
-1 20 17
-1 20 18
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 12
-1 20 13
-1 20 11
-1 20 12
-1 20 13
-1 20 10
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 9
-1 20 10
-1 20 11
-1 20 1...

result:

ok puzzle solved

Test #92:

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

input:

20 20 20
5yxbTumbHXn9rBb951uq
p9rnfT1ua23KcOQxrOJ3
yHZX53ycbn3yJ8jQZpb8
6KxQ8BTNnZnAeQN1JTR6
xf5BKyB3JKumraXb2Nr2
BQc1Xb35mOx12Nr8ZBeN
3caBx25rcrNAXARfN36O
bZOR6a1rarupKOqyxaeX
8Q93urZ3uquH6ux5QfKb
HJrQ19nTcZBebcTcr2qf
QyRmAR29Nf89bfy6cJuB
xmAXpBb2KbZJH1Jcnb9T
6KAJN11y1xmJZNeBxB1B
HR5QBfbZeKNfj6eHuA...

output:

53484
-1 20 19
-1 20 17
-1 20 18
-1 20 16
-1 20 17
-1 20 18
-1 20 15
-1 20 14
-1 20 13
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 17
-1 20 11
-1 20 12
-1 20 10
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 17
-1 20 9
-1 20 10
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 7...

result:

ok puzzle solved

Test #93:

score: 0
Accepted
time: 6ms
memory: 5296kb

input:

20 20 20
6yUtXJ2rN2RB8cNBqJra
TqlLRzGBcJ4k6ZaAtdaU
lDHcDclqGN5atzyTkDtL
ANzBzzNDJ1MNNNHdqk2G
1rXylklNXcqB1ycBJUly
JXhrA5RyUBzrDRZqMqL5
DZT55LLheeG2BZ1SGDMe
GZJMJJrRMhhkka1cL8tq
5hD8tycMSSHqT28U2Lcy
446GdAAhN28NhXeNZ8yX
84RMTRHBzZAXNNkGcJ4y
k4kJ1LML688yGURaZq1L
4e6yyhZr5h5GXcrytZ61
551y6y56zBe65H2qSB...

output:

80811
-1 20 19
-1 20 17
-1 20 18
-1 20 19
-1 20 16
-1 20 15
-1 20 16
-1 20 17
-1 20 14
-1 20 15
-1 20 16
-1 20 17
-1 20 18
-1 20 19
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 17
-1 20 18
-1 20 19
-1 20 12
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 17
-1 20 18
-1 20 19
-1 20 10
-1 20 ...

result:

ok puzzle solved

Test #94:

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

input:

20 20 20
0HcqeAQ5A2U0J3R6772t
RSS5Aelc5e3m5Qawcrr6
H03QueUEH46QearSpw3R
XgwHqgc6yoly5tmw2xcp
EeeRxUlc0E3w7ctgAoTu
S2Xr2QjpojjTyuatu5Jy
UqXgUQowgTx72l72llal
g0H3uEtX4ujJTQlx6Eel
wQmeoTa2ETEtrmq6g44o
4XHeoAp43X77U2yg4a4c
3aET57EmAmQjcJuwwoAw
yum03q7e7QUo44wUmm3p
4EuuoEj63r4qTXxyAT3m
6wEoewlHT54qlcggUr...

output:

80808
-1 20 19
-1 20 17
-1 20 18
-1 20 19
-1 20 16
-1 20 17
-1 20 15
-1 20 16
-1 20 17
-1 20 18
-1 20 19
-1 20 14
-1 20 15
-1 20 16
-1 20 13
-1 20 14
-1 20 15
-1 20 16
-1 20 17
-1 20 18
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 11
-1 20 12
-1 20 13
-1 20 14
-1 20 15
-1 20 10
-1 20 11
-1 20 12
-1 20 ...

result:

ok puzzle solved

Test #95:

score: 0
Accepted
time: 7ms
memory: 3752kb

input:

20 20 2
CCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCC...

output:

7101
2 1 1
-3 10 20
-3 11 20
-3 12 20
-3 13 20
-3 14 20
-3 15 20
-3 16 20
-3 17 20
-3 18 20
-3 19 20
-1 20 19
-1 20 18
-1 20 17
-1 20 16
-1 20 15
-1 20 14
-1 20 13
-1 20 12
-1 20 11
-1 20 10
-1 20 9
-1 20 8
-1 20 7
-1 20 6
-1 20 5
-1 20 4
-1 20 3
-1 20 2
-1 20 1
2 1 1
-3 10 20
-3 11 20
-3 12 20
-3 1...

result:

ok puzzle solved