Problem:
Move One Coin
Some coins are placed on grid points on a two-dimensional plane. No two coins are stacked on the same point. Let's call this placement of coins the
source pattern
. Another placement of the same number of coins, called the
target pattern
, is also given.
The source pattern does not match the target pattern, but by moving exactly one coin in the source pattern to an empty grid point, the resulting new pattern matches the target pattern. Your task is to find out such a coin move.
Here, two patterns are said to match if one pattern is obtained from the other by applying some number of 90-degree rotations on the plane and a parallel displacement if necessary, but without mirroring. For example, in the source pattern on the left of Figure D.1, by moving the coin at $(1, 0)$ to $(3, 1)$, we obtain the pattern on the right that matches the target pattern shown in Figure D.2.
Figure D.1. Source pattern and a move
Figure D.2. Target Pattern
Input
The input consists of a single test case of the following format.
$h$ $w$
$p_{0,0} \cdots p_{0,w-1}$
$\vdots$
$p_{h-1,0} \cdots p_{h-1,w-1}$
$H$ $W$
$P_{0,0} \cdots P_{0, W-1}$
$\vdots$ 
$P_{H-1,0} \cdots P_{H-1,W-1}$
The first line consists of two integers $h$ and $w$, both between $1$ and $500$, inclusive. $h$ is the height and $w$ is the width of the source pattern description. The next $h$ lines each consisting of $w$ characters describe the source pattern. The character $p_{y,x}$ being
'o'
means that a coin is placed at $(x, y)$, while
'x'
means no coin is there.
The following lines with integers $H$ and $W$, and characters $P_{y,x}$ describe the target pattern in the same way.
Output
If the answer is to move the coin at $(x_0, y_0)$ to $(x_1, y_1)$, print $x_0$ and $y_0$ in this order separated by a space character in the first line, and print $x_1$ and $y_1$ in this order separated by a space character in the second line.
It is ensured there is at least one move that satisfies the requirement. When multiple solutions exist, print any one of them.
Note that $0 \leq x_0 \lt w$ and $0 \leq y_0 \lt h$ always hold but $x_1$ and/or $y_1$ can be out of these ranges.
Sample Input 1
2 3
xox
ooo
4 2
ox
ox
ox
ox
Sample Output 1
1 0
3 1
Sample Input 2
3 3
xox
oxo
xox
4 4
oxxx
xxox
xoxo
xxxx
Sample Output 2
1 2
-1 -1

Submitted solutions:

code_snippet: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
#define vi vector<int>
#define vl vector<ll>
#define vii vector<pair<int,int>>
#define vll vector<pair<ll,ll>>
#define vvi vector<vector<int>>
#define vvl vector<vector<ll>>
#define vvii vector<vector<pair<int,int>>>
#define vvll vector<vector<pair<ll,ll>>>
#define vst vector<string>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define mkunique(x) sort(all(x));(x).erase(unique(all(x)),(x).end())
#define fi first
#define se second
#define mp make_pair
#define si(x) int(x.size())
const int mod=998244353,MAX=300005,INF=15<<26;

//modint+畳み込み+逆元テーブル

// from: https://gist.github.com/yosupo06/ddd51afb727600fd95d9d8ad6c3c80c9
// (based on AtCoder STL)

#include <algorithm>
#include <array>

#ifdef _MSC_VER
#include <intrin.h>
#endif

namespace atcoder {

namespace internal {

int ceil_pow2(int n) {
    int x = 0;
    while ((1U << x) < (unsigned int)(n)) x++;
    return x;
}

int bsf(unsigned int n) {
#ifdef _MSC_VER
    unsigned long index;
    _BitScanForward(&index, n);
    return index;
#else
    return __builtin_ctz(n);
#endif
}

}  // namespace internal

}  // namespace atcoder



#include <utility>

namespace atcoder {

namespace internal {

constexpr long long safe_mod(long long x, long long m) {
    x %= m;
    if (x < 0) x += m;
    return x;
}

struct barrett {
    unsigned int _m;
    unsigned long long im;
    
    barrett(unsigned int m) : _m(m), im((unsigned long long)(-1) / m + 1) {}
    
    unsigned int umod() const { return _m; }
    
    unsigned int mul(unsigned int a, unsigned int b) const {
        
        unsigned long long z = a;
        z *= b;
#ifdef _MSC_VER
        unsigned long long x;
        _umul128(z, im, &x);
#else
        unsigned long long x =
        (unsigned long long)(((unsigned __int128)(z)*im) >> 64);
#endif
        unsigned int v = (unsigned int)(z - x * _m);
        if (_m <= v) v += _m;
        return v;
    }
};

constexpr long long pow_mod_constexpr(long long x, long long n, int m) {
    if (m == 1) return 0;
    unsigned int _m = (unsigned int)(m);
    unsigned long long r = 1;
    unsigned long long y = safe_mod(x, m);
    while (n) {
        if (n & 1) r = (r * y) % _m;
        y = (y * y) % _m;
        n >>= 1;
    }
    return r;
}

constexpr bool is_prime_constexpr(int n) {
    if (n <= 1) return false;
    if (n == 2 || n == 7 || n == 61) return true;
    if (n % 2 == 0) return false;
    long long d = n - 1;
    while (d % 2 == 0) d /= 2;
    for (long long a : {2, 7, 61}) {
        long long t = d;
        long long y = pow_mod_constexpr(a, t, n);
        while (t != n - 1 && y != 1 && y != n - 1) {
            y = y * y % n;
            t <<= 1;
        }
        if (y != n - 1 && t % 2 == 0) {
            return false;
        }
    }
    return true;
}
template <int n> constexpr bool is_prime = is_prime_constexpr(n);

constexpr std::pair<long long, long long> inv_gcd(long long a, long long b) {
    a = safe_mod(a, b);
    if (a == 0) return {b, 0};
    
    long long s = b, t = a;
    long long m0 = 0, m1 = 1;
    
    while (t) {
        long long u = s / t;
        s -= t * u;
        m0 -= m1 * u;  // |m1 * u| <= |m1| * s <= b
        
        
        auto tmp = s;
        s = t;
        t = tmp;
        tmp = m0;
        m0 = m1;
        m1 = tmp;
    }
    if (m0 < 0) m0 += b / s;
    return {s, m0};
}

constexpr int primitive_root_constexpr(int m) {
    if (m == 2) return 1;
    if (m == 167772161) return 3;
    if (m == 469762049) return 3;
    if (m == 754974721) return 11;
    if (m == 998244353) return 3;
    int divs[20] = {};
    divs[0] = 2;
    int cnt = 1;
    int x = (m - 1) / 2;
    while (x % 2 == 0) x /= 2;
    for (int i = 3; (long long)(i)*i <= x; i += 2) {
        if (x % i == 0) {
            divs[cnt++] = i;
            while (x % i == 0) {
                x /= i;
            }
        }
    }
    if (x > 1) {
        divs[cnt++] = x;
    }
    for (int g = 2;; g++) {
        bool ok = true;
        for (int i = 0; i < cnt; i++) {
            if (pow_mod_constexpr(g, (m - 1) / divs[i], m) == 1) {
                ok = false;
                break;
            }
        }
        if (ok) return g;
    }
}
template <int m> constexpr int primitive_root = primitive_root_constexpr(m);

}  // namespace internal

}  // namespace atcoder


#include <cassert>
#include <numeric>
#include <type_traits>

namespace atcoder {

namespace internal {

#ifndef _MSC_VER
template <class T>
using is_signed_int128 =
typename std::conditional<std::is_same<T, __int128_t>::value ||
std::is_same<T, __int128>::value,
std::true_type,
std::false_type>::type;

template <class T>
using is_unsigned_int128 =
typename std::conditional<std::is_same<T, __uint128_t>::value ||
std::is_same<T, unsigned __int128>::value,
std::true_type,
std::false_type>::type;

template <class T>
using make_unsigned_int128 =
typename std::conditional<std::is_same<T, __int128_t>::value,
__uint128_t,
unsigned __int128>;

template <class T>
using is_integral = typename std::conditional<std::is_integral<T>::value ||
is_signed_int128<T>::value ||
is_unsigned_int128<T>::value,
std::true_type,
std::false_type>::type;

template <class T>
using is_signed_int = typename std::conditional<(is_integral<T>::value &&
                                                 std::is_signed<T>::value) ||
is_signed_int128<T>::value,
std::true_type,
std::false_type>::type;

template <class T>
using is_unsigned_int =
typename std::conditional<(is_integral<T>::value &&
                           std::is_unsigned<T>::value) ||
is_unsigned_int128<T>::value,
std::true_type,
std::false_type>::type;

template <class T>
using to_unsigned = typename std::conditional<
is_signed_int128<T>::value,
make_unsigned_int128<T>,
typename std::conditional<std::is_signed<T>::value,
std::make_unsigned<T>,
std::common_type<T>>::type>::type;

#else

template <class T> using is_integral = typename std::is_integral<T>;

template <class T>
using is_signed_int =
typename std::conditional<is_integral<T>::value && std::is_signed<T>::value,
std::true_type,
std::false_type>::type;

template <class T>
using is_unsigned_int =
typename std::conditional<is_integral<T>::value &&
std::is_unsigned<T>::value,
std::true_type,
std::false_type>::type;

template <class T>
using to_unsigned = typename std::conditional<is_signed_int<T>::value,
std::make_unsigned<T>,
std::common_type<T>>::type;

#endif

template <class T>
using is_signed_int_t = std::enable_if_t<is_signed_int<T>::value>;

template <class T>
using is_unsigned_int_t = std::enable_if_t<is_unsigned_int<T>::value>;

template <class T> using to_unsigned_t = typename to_unsigned<T>::type;

}  // namespace internal

}  // namespace atcoder

#include <cassert>
#include <numeric>
#include <type_traits>

#ifdef _MSC_VER
#include <intrin.h>
#endif

namespace atcoder {

namespace internal {

struct modint_base {};
struct static_modint_base : modint_base {};

template <class T> using is_modint = std::is_base_of<modint_base, T>;
template <class T> using is_modint_t = std::enable_if_t<is_modint<T>::value>;

}  // namespace internal

template <int m, std::enable_if_t<(1 <= m)>* = nullptr>
struct static_modint : internal::static_modint_base {
    using mint = static_modint;
    
public:
    static constexpr int mod() { return m; }
    static mint raw(int v) {
        mint x;
        x._v = v;
        return x;
    }
    
    static_modint() : _v(0) {}
    template <class T, internal::is_signed_int_t<T>* = nullptr>
    static_modint(T v) {
        long long x = (long long)(v % (long long)(umod()));
        if (x < 0) x += umod();
        _v = (unsigned int)(x);
    }
    template <class T, internal::is_unsigned_int_t<T>* = nullptr>
    static_modint(T v) {
        _v = (unsigned int)(v % umod());
    }
    static_modint(bool v) { _v = ((unsigned int)(v) % umod()); }
    
    unsigned int val() const { return _v; }
    
    mint& operator++() {
        _v++;
        if (_v == umod()) _v = 0;
        return *this;
    }
    mint& operator--() {
        if (_v == 0) _v = umod();
        _v--;
        return *this;
    }
    mint operator++(int) {
        mint result = *this;
        ++*this;
        return result;
    }
    mint operator--(int) {
        mint result = *this;
        --*this;
        return result;
    }
    
    mint& operator+=(const mint& rhs) {
        _v += rhs._v;
        if (_v >= umod()) _v -= umod();
        return *this;
    }
    mint& operator-=(const mint& rhs) {
        _v -= rhs._v;
        if (_v >= umod()) _v += umod();
        return *this;
    }
    mint& operator*=(const mint& rhs) {
        unsigned long long z = _v;
        z *= rhs._v;
        _v = (unsigned int)(z % umod());
        return *this;
    }
    mint& operator/=(const mint& rhs) { return *this = *this * rhs.inv(); }
    
    mint operator+() const { return *this; }
    mint operator-() const { return mint() - *this; }
    
    mint pow(long long n) const {
        assert(0 <= n);
        mint x = *this, r = 1;
        while (n) {
            if (n & 1) r *= x;
            x *= x;
            n >>= 1;
        }
        return r;
    }
    mint inv() const {
        if (prime) {
            assert(_v);
            return pow(umod() - 2);
        } else {
            auto eg = internal::inv_gcd(_v, m);
            assert(eg.first == 1);
            return eg.second;
        }
    }
    
    friend mint operator+(const mint& lhs, const mint& rhs) {
        return mint(lhs) += rhs;
    }
    friend mint operator-(const mint& lhs, const mint& rhs) {
        return mint(lhs) -= rhs;
    }
    friend mint operator*(const mint& lhs, const mint& rhs) {
        return mint(lhs) *= rhs;
    }
    friend mint operator/(const mint& lhs, const mint& rhs) {
        return mint(lhs) /= rhs;
    }
    friend bool operator==(const mint& lhs, const mint& rhs) {
        return lhs._v == rhs._v;
    }
    friend bool operator!=(const mint& lhs, const mint& rhs) {
        return lhs._v != rhs._v;
    }
    
private:
    unsigned int _v;
    static constexpr unsigned int umod() { return m; }
    static constexpr bool prime = internal::is_prime<m>;
};

template <int id> struct dynamic_modint : internal::modint_base {
    using mint = dynamic_modint;
    
public:
    static int mod() { return (int)(bt.umod()); }
    static void set_mod(int m) {
        assert(1 <= m);
        bt = internal::barrett(m);
    }
    static mint raw(int v) {
        mint x;
        x._v = v;
        return x;
    }
    
    dynamic_modint() : _v(0) {}
    template <class T, internal::is_signed_int_t<T>* = nullptr>
    dynamic_modint(T v) {
        long long x = (long long)(v % (long long)(mod()));
        if (x < 0) x += mod();
        _v = (unsigned int)(x);
    }
    template <class T, internal::is_unsigned_int_t<T>* = nullptr>
    dynamic_modint(T v) {
        _v = (unsigned int)(v % mod());
    }
    dynamic_modint(bool v) { _v = ((unsigned int)(v) % mod()); }
    
    unsigned int val() const { return _v; }
    
    mint& operator++() {
        _v++;
        if (_v == umod()) _v = 0;
        return *this;
    }
    mint& operator--() {
        if (_v == 0) _v = umod();
        _v--;
        return *this;
    }
    mint operator++(int) {
        mint result = *this;
        ++*this;
        return result;
    }
    mint operator--(int) {
        mint result = *this;
        --*this;
        return result;
    }
    
    mint& operator+=(const mint& rhs) {
        _v += rhs._v;
        if (_v >= umod()) _v -= umod();
        return *this;
    }
    mint& operator-=(const mint& rhs) {
        _v += mod() - rhs._v;
        if (_v >= umod()) _v -= umod();
        return *this;
    }
    mint& operator*=(const mint& rhs) {
        _v = bt.mul(_v, rhs._v);
        return *this;
    }
    mint& operator/=(const mint& rhs) { return *this = *this * rhs.inv(); }
    
    mint operator+() const { return *this; }
    mint operator-() const { return mint() - *this; }
    
    mint pow(long long n) const {
        assert(0 <= n);
        mint x = *this, r = 1;
        while (n) {
            if (n & 1) r *= x;
            x *= x;
            n >>= 1;
        }
        return r;
    }
    mint inv() const {
        auto eg = internal::inv_gcd(_v, mod());
        assert(eg.first == 1);
        return eg.second;
    }
    
    friend mint operator+(const mint& lhs, const mint& rhs) {
        return mint(lhs) += rhs;
    }
    friend mint operator-(const mint& lhs, const mint& rhs) {
        return mint(lhs) -= rhs;
    }
    friend mint operator*(const mint& lhs, const mint& rhs) {
        return mint(lhs) *= rhs;
    }
    friend mint operator/(const mint& lhs, const mint& rhs) {
        return mint(lhs) /= rhs;
    }
    friend bool operator==(const mint& lhs, const mint& rhs) {
        return lhs._v == rhs._v;
    }
    friend bool operator!=(const mint& lhs, const mint& rhs) {
        return lhs._v != rhs._v;
    }
    
private:
    unsigned int _v;
    static internal::barrett bt;
    static unsigned int umod() { return bt.umod(); }
};
template <int id> internal::barrett dynamic_modint<id>::bt = 998244353;

using modint998244353 = static_modint<998244353>;
using modint1000000007 = static_modint<1000000007>;
using modint = dynamic_modint<-1>;

namespace internal {

template <class T>
using is_static_modint = std::is_base_of<internal::static_modint_base, T>;

template <class T>
using is_static_modint_t = std::enable_if_t<is_static_modint<T>::value>;

template <class> struct is_dynamic_modint : public std::false_type {};
template <int id>
struct is_dynamic_modint<dynamic_modint<id>> : public std::true_type {};

template <class T>
using is_dynamic_modint_t = std::enable_if_t<is_dynamic_modint<T>::value>;

}  // namespace internal

}  // namespace atcoder

#include <cassert>
#include <type_traits>
#include <vector>

namespace atcoder {

namespace internal {

template <class mint, internal::is_static_modint_t<mint>* = nullptr>
void butterfly(std::vector<mint>& a) {
    static constexpr int g = internal::primitive_root<mint::mod()>;
    int n = int(a.size());
    int h = internal::ceil_pow2(n);
    
    static bool first = true;
    static mint sum_e[30];  // sum_e[i] = ies[0] * ... * ies[i - 1] * es[i]
    if (first) {
        first = false;
        mint es[30], ies[30];  // es[i]^(2^(2+i)) == 1
        int cnt2 = bsf(mint::mod() - 1);
        mint e = mint(g).pow((mint::mod() - 1) >> cnt2), ie = e.inv();
        for (int i = cnt2; i >= 2; i--) {
            es[i - 2] = e;
            ies[i - 2] = ie;
            e *= e;
            ie *= ie;
        }
        mint now = 1;
        for (int i = 0; i < cnt2 - 2; i++) {
            sum_e[i] = es[i] * now;
            now *= ies[i];
        }
    }
    for (int ph = 1; ph <= h; ph++) {
        int w = 1 << (ph - 1), p = 1 << (h - ph);
        mint now = 1;
        for (int s = 0; s < w; s++) {
            int offset = s << (h - ph + 1);
            for (int i = 0; i < p; i++) {
                auto l = a[i + offset];
                auto r = a[i + offset + p] * now;
                a[i + offset] = l + r;
                a[i + offset + p] = l - r;
            }
            now *= sum_e[bsf(~(unsigned int)(s))];
        }
    }
}

template <class mint, internal::is_static_modint_t<mint>* = nullptr>
void butterfly_inv(std::vector<mint>& a) {
    static constexpr int g = internal::primitive_root<mint::mod()>;
    int n = int(a.size());
    int h = internal::ceil_pow2(n);
    
    static bool first = true;
    static mint sum_ie[30];  // sum_ie[i] = es[0] * ... * es[i - 1] * ies[i]
    if (first) {
        first = false;
        mint es[30], ies[30];  // es[i]^(2^(2+i)) == 1
        int cnt2 = bsf(mint::mod() - 1);
        mint e = mint(g).pow((mint::mod() - 1) >> cnt2), ie = e.inv();
        for (int i = cnt2; i >= 2; i--) {
            es[i - 2] = e;
            ies[i - 2] = ie;
            e *= e;
            ie *= ie;
        }
        mint now = 1;
        for (int i = 0; i < cnt2 - 2; i++) {
            sum_ie[i] = ies[i] * now;
            now *= es[i];
        }
    }
    
    for (int ph = h; ph >= 1; ph--) {
        int w = 1 << (ph - 1), p = 1 << (h - ph);
        mint inow = 1;
        for (int s = 0; s < w; s++) {
            int offset = s << (h - ph + 1);
            for (int i = 0; i < p; i++) {
                auto l = a[i + offset];
                auto r = a[i + offset + p];
                a[i + offset] = l + r;
                a[i + offset + p] =
                (unsigned long long)(mint::mod() + l.val() - r.val()) *
                inow.val();
            }
            inow *= sum_ie[bsf(~(unsigned int)(s))];
        }
    }
}

}  // namespace internal

template <class mint, internal::is_static_modint_t<mint>* = nullptr>
std::vector<mint> convolution(std::vector<mint> a, std::vector<mint> b) {
    int n = int(a.size()), m = int(b.size());
    if (!n || !m) return {};
    if (std::min(n, m) <= 60) {
        if (n < m) {
            std::swap(n, m);
            std::swap(a, b);
        }
        std::vector<mint> ans(n + m - 1);
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                ans[i + j] += a[i] * b[j];
            }
        }
        return ans;
    }
    int z = 1 << internal::ceil_pow2(n + m - 1);
    a.resize(z);
    internal::butterfly(a);
    b.resize(z);
    internal::butterfly(b);
    for (int i = 0; i < z; i++) {
        a[i] *= b[i];
    }
    internal::butterfly_inv(a);
    a.resize(n + m - 1);
    mint iz = mint(z).inv();
    for (int i = 0; i < n + m - 1; i++) a[i] *= iz;
    return a;
}

template <unsigned int mod = 998244353,
class T,
std::enable_if_t<internal::is_integral<T>::value>* = nullptr>
std::vector<T> convolution(const std::vector<T>& a, const std::vector<T>& b) {
    int n = int(a.size()), m = int(b.size());
    if (!n || !m) return {};
    
    using mint = static_modint<mod>;
    std::vector<mint> a2(n), b2(m);
    for (int i = 0; i < n; i++) {
        a2[i] = mint(a[i]);
    }
    for (int i = 0; i < m; i++) {
        b2[i] = mint(b[i]);
    }
    auto c2 = convolution(move(a2), move(b2));
    std::vector<T> c(n + m - 1);
    for (int i = 0; i < n + m - 1; i++) {
        c[i] = c2[i].val();
    }
    return c;
}

std::vector<long long> convolution_ll(const std::vector<long long>& a,
                                      const std::vector<long long>& b) {
    int n = int(a.size()), m = int(b.size());
    if (!n || !m) return {};
    
    static constexpr unsigned long long MOD1 = 754974721;  // 2^24
    static constexpr unsigned long long MOD2 = 167772161;  // 2^25
    static constexpr unsigned long long MOD3 = 469762049;  // 2^26
    static constexpr unsigned long long M2M3 = MOD2 * MOD3;
    static constexpr unsigned long long M1M3 = MOD1 * MOD3;
    static constexpr unsigned long long M1M2 = MOD1 * MOD2;
    static constexpr unsigned long long M1M2M3 = MOD1 * MOD2 * MOD3;
    
    static constexpr unsigned long long i1 =
    internal::inv_gcd(MOD2 * MOD3, MOD1).second;
    static constexpr unsigned long long i2 =
    internal::inv_gcd(MOD1 * MOD3, MOD2).second;
    static constexpr unsigned long long i3 =
    internal::inv_gcd(MOD1 * MOD2, MOD3).second;
    
    auto c1 = convolution<MOD1>(a, b);
    auto c2 = convolution<MOD2>(a, b);
    auto c3 = convolution<MOD3>(a, b);
    
    std::vector<long long> c(n + m - 1);
    for (int i = 0; i < n + m - 1; i++) {
        unsigned long long x = 0;
        x += (c1[i] * i1) % MOD1 * M2M3;
        x += (c2[i] * i2) % MOD2 * M1M3;
        x += (c3[i] * i3) % MOD3 * M1M2;
        long long diff =
        c1[i] - internal::safe_mod((long long)(x), (long long)(MOD1));
        if (diff < 0) diff += MOD1;
        static constexpr unsigned long long offset[5] = {
            0, 0, M1M2M3, 2 * M1M2M3, 3 * M1M2M3};
        x -= offset[diff % 5];
        c[i] = x;
    }
    
    return c;
}

}  // namespace atcoder

using mint=atcoder::modint998244353;

vector<mint> inv,fac,finv;

void make(){
    
    inv.resize(MAX);
    fac.resize(MAX);
    finv.resize(MAX);
    fac[0]=fac[1]=1;
    finv[0]=finv[1]=1;
    inv[1]=1;
    
    for(int i=2;i<MAX;i++){
        inv[i]=-inv[mod%i]*(mod/i);
        fac[i]=fac[i-1]*i;
        finv[i]=finv[i-1]*inv[i];
    }
}

mint comb(ll a,ll b){
    if(a<b) return 0;
    return fac[a]*finv[b]*finv[a-b];
}

mint perm(ll a,ll b){
    if(a<b) return 0;
    return fac[a]*finv[a-b];
}

int main(){
    
    std::ifstream in("text.txt");
    std::cin.rdbuf(in.rdbuf());
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int H1,W1;cin>>H1>>W1;
    vst S(H1);
    vii pos;
    for(int i=0;i<H1;i++){
        cin>>S[i];
        for(int j=0;j<W1;j++){
            if(S[i][j]=='o'){
                pos.pb(mp(i,j));
            }
        }
    }
    int H2,W2;cin>>H2>>W2;
    vst T(H2);
    for(int i=0;i<H2;i++){
        cin>>T[i];
    }
    int N=max({H1,W1,H2,W2});
    while(si(S)<N){
        S.pb(string(N,'x'));
    }
    for(int i=0;i<N;i++){
        while(si(S[i])<N) S[i]+='x';
    }
    while(si(T)<N){
        T.pb(string(N,'x'));
    }
    for(int i=0;i<N;i++){
        while(si(T[i])<N) T[i]+='x';
    }
    
    for(int q=0;q<4;q++){
        vector<mint> A(N*2*N),B(N*2*N);
        for(int i=0;i<N;i++){
            for(int j=0;j<N;j++){
                if(S[i][j]=='o'){
                    A[i*(2*N)+j]=1;
                }
                if(T[i][j]=='o'){
                    B[i*(2*N)+j]=1;
                }
            }
        }
        auto C=atcoder::convolution(A,B);
        for(int i=0;i<si(C);i++){
            if(C[i]==si(pos)){
                cout<<pos[0].se<<" "<<pos[0].fi<<"\n";
                cout<<pos[0].se<<" "<<pos[0].fi<<"\n";
                return 0;
            }
        }
        for(int i=0;i<si(C);i++){
            if(C[i]==si(pos)-1){
                int h=i/(2*N),w=i%(2*N);
                vii F,G;
                for(int a=0;a<N;a++){
                    for(int b=0;b<N;b++){
                        if(S[a][b]=='o'){
                            int c=h-a,d=w-b;
                            if(0<=c&&c<N&&0<=d&&d<N){
                                if(T[c][d]=='o'){
                                    
                                }else{
                                    F.pb(mp(a,b));
                                }
                            }else{
                                F.pb(mp(a,b));
                            }
                        }
                        if(T[a][b]=='o'){
                            int c=h-a,d=w-b;
                            if(0<=c&&c<N&&0<=d&&d<N){
                                if(S[c][d]=='o'){
                                    
                                }else{
                                    G.pb(mp(c,d));
                                }
                            }else{
                                G.pb(mp(c,d));
                            }
                        }
                    }
                }
                
                if(si(F)==1&&si(G)==1){
                    cout<<F[0].se<<" "<<F[0].fi<<"\n";
                    cout<<G[0].se<<" "<<G[0].fi<<"\n";
                    return 0;
                }
            }
        }
        
        vst X(N,string(N,'x'));
        for(int i=0;i<N;i++){
            for(int j=0;j<N;j++){
                X[N-1-j][i]=T[i][j];
            }
        }
        T=X;
    }
}
accuracy: 1
time_ms: 240
memory_kb: 20632
final_rank: 8

code_snippet: #include <bits/stdc++.h>
using namespace std;

int main(){
    int h,w;
    cin >> h >> w;
    vector<string> p(h);
    for(int i=0;i<h;i++){
        cin >> p.at(i);
    }
    int coin = 0;
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            if(p.at(i).at(j) == 'o') coin++;
        }
    }
    int H,W;
    cin >> H >> W;
    vector<string> P(H);
    for(int i=0;i<H;i++){
        cin >> P.at(i);
    }
    vector<pair<int,int>> cp(0);
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            if(p.at(i).at(j) == 'o'){
                cp.emplace_back(i, j);
                if(cp.size() == 2) break;
            }
        }
        if(cp.size() == 2) break;
    }



    vector<pair<int,int>> cP(0);
    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            if(P.at(i).at(j) == 'o'){
                cP.emplace_back(i, j);
                if(cP.size() == 2) break;
            }
        }
        if(cP.size() == 2) break;
    }
    for(int i=0;i<2;i++){
        for(int j=0;j<2;j++){
            auto c = cp.at(i);
            auto C = cP.at(j);
            int dx = C.first - c.first;
            int dy = C.second - c.second;
            int cnt = 0;        
            for(int k=0;k<h;k++){
                for(int l=0;l<w;l++){
                    char cs = p.at(k).at(l);
                    char cd = 'x';
                    if(k + dx >= 0 && k + dx < H && l + dy >= 0 && l + dy < W && P.at(k + dx).at(l + dy) == 'o'){
                        cd = 'o';
                    }
                    if(cs == 'o' && cd == 'o'){
                        cnt++;
                    } 
                }
            }
            if(cnt == coin){
                for(int k=0;k<2;k++){
                    cout << c.second << ' ' << c.first << endl;
                }
                    return 0;
            }else if(cnt == coin - 1){
                int sx,sy,dex,dey;
                bool f = true;
                for(int k=0;k<h;k++){
                    for(int l=0;l<w;l++){
                        char cs = p.at(k).at(l);
                        char cd = 'x';
                        if(k + dx >= 0 && k + dx < H && l + dy >= 0 && l + dy < W && P.at(k + dx).at(l + dy) == 'o'){
                            cd = 'o';
                        }
                        if(cs == 'o' && cd == 'x'){
                            sx = k; sy = l;
                        }else if(cs == 'x' && cd == 'o'){
                            dex = k; dey = l;
                            f = false;
                        }
                    }
                }
                if(f){
                    for(int k=0;k<H;k++){
                        for(int l=0;l<W;l++){
                            if((k - dx < 0 || k - dx >= h || l - dy < 0 || l - dy >= w) && P.at(k).at(l) == 'o'){
                                dex = k - dx; dey = l - dy;
                            }
                        }
                    }
                }
                cout << sy << ' ' << sx << endl << dey << ' ' << dex << endl;
                return 0;
            }
        }
    }

    vector<string> P_new(W);
    for(int i=0;i<W;i++){
        for(int j=0;j<H;j++){
            P_new.at(i).push_back(P.at(H-j-1).at(i));
        }
    }
    int tmp = W;
    W = H;
    H = tmp;
    P.clear();
    P.resize(H);
    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            P.at(i).push_back(P_new.at(i).at(j));
        }
    }
    cP.clear();


    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            if(P.at(i).at(j) == 'o'){
                cP.emplace_back(i, j);
                if(cP.size() == 2) break;
            }
        }
        if(cP.size() == 2) break;
    }
    for(int i=0;i<2;i++){
        for(int j=0;j<2;j++){
            auto c = cp.at(i);
            auto C = cP.at(j);
            int dx = C.first - c.first;
            int dy = C.second - c.second;
            int cnt = 0;        
            for(int k=0;k<h;k++){
                for(int l=0;l<w;l++){
                    char cs = p.at(k).at(l);
                    char cd = 'x';
                    if(k + dx >= 0 && k + dx < H && l + dy >= 0 && l + dy < W && P.at(k + dx).at(l + dy) == 'o'){
                        cd = 'o';
                    }
                    if(cs == 'o' && cd == 'o'){
                        cnt++;
                    } 
                }
            }
            if(cnt == coin){
                for(int k=0;k<2;k++){
                    cout << c.second << ' ' << c.first << endl;
                }
                    return 0;
            }else if(cnt == coin - 1){
                int sx,sy,dex,dey;
                bool f = true;
                for(int k=0;k<h;k++){
                    for(int l=0;l<w;l++){
                        char cs = p.at(k).at(l);
                        char cd = 'x';
                        if(k + dx >= 0 && k + dx < H && l + dy >= 0 && l + dy < W && P.at(k + dx).at(l + dy) == 'o'){
                            cd = 'o';
                        }
                        if(cs == 'o' && cd == 'x'){
                            sx = k; sy = l;
                        }else if(cs == 'x' && cd == 'o'){
                            dex = k; dey = l;
                            f = false;
                        }
                    }
                }
                if(f){
                    for(int k=0;k<H;k++){
                        for(int l=0;l<W;l++){
                            if((k - dx < 0 || k - dx >= h || l - dy < 0 || l - dy >= w) && P.at(k).at(l) == 'o'){
                                dex = k - dx; dey = l - dy;
                            }
                        }
                    }
                }
                cout << sy << ' ' << sx << endl << dey << ' ' << dex << endl;
                return 0;
            }
        }
    }

    P_new.clear();
    P_new.resize(W);
    for(int i=0;i<W;i++){
        for(int j=0;j<H;j++){
            P_new.at(i).push_back(P.at(H-j-1).at(i));
        }
    }
    tmp = W;
    W = H;
    H = tmp;
    P.clear();
    P.resize(H);
    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            P.at(i).push_back(P_new.at(i).at(j));
        }
    }
    cP.clear();

    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            if(P.at(i).at(j) == 'o'){
                cP.emplace_back(i, j);
                if(cP.size() == 2) break;
            }
        }
        if(cP.size() == 2) break;
    }
    for(int i=0;i<2;i++){
        for(int j=0;j<2;j++){
            auto c = cp.at(i);
            auto C = cP.at(j);
            int dx = C.first - c.first;
            int dy = C.second - c.second;
            int cnt = 0;        
            for(int k=0;k<h;k++){
                for(int l=0;l<w;l++){
                    char cs = p.at(k).at(l);
                    char cd = 'x';
                    if(k + dx >= 0 && k + dx < H && l + dy >= 0 && l + dy < W && P.at(k + dx).at(l + dy) == 'o'){
                        cd = 'o';
                    }
                    if(cs == 'o' && cd == 'o'){
                        cnt++;
                    } 
                }
            }
            if(cnt == coin){
                for(int k=0;k<2;k++){
                    cout << c.second << ' ' << c.first << endl;
                }
                    return 0;
            }else if(cnt == coin - 1){
                int sx,sy,dex,dey;
                bool f = true;
                for(int k=0;k<h;k++){
                    for(int l=0;l<w;l++){
                        char cs = p.at(k).at(l);
                        char cd = 'x';
                        if(k + dx >= 0 && k + dx < H && l + dy >= 0 && l + dy < W && P.at(k + dx).at(l + dy) == 'o'){
                            cd = 'o';
                        }
                        if(cs == 'o' && cd == 'x'){
                            sx = k; sy = l;
                        }else if(cs == 'x' && cd == 'o'){
                            dex = k; dey = l;
                            f = false;
                        }
                    }
                }
                if(f){
                    for(int k=0;k<H;k++){
                        for(int l=0;l<W;l++){
                            if((k - dx < 0 || k - dx >= h || l - dy < 0 || l - dy >= w) && P.at(k).at(l) == 'o'){
                                dex = k - dx; dey = l - dy;
                            }
                        }
                    }
                }
                cout << sy << ' ' << sx << endl << dey << ' ' << dex << endl;
                return 0;
            }
        }
    }

    P_new.clear();
    P_new.resize(W);
    for(int i=0;i<W;i++){
        for(int j=0;j<H;j++){
            P_new.at(i).push_back(P.at(H-j-1).at(i));
        }
    }
    tmp = W;
    W = H;
    H = tmp;
    P.clear();
    P.resize(H);
    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            P.at(i).push_back(P_new.at(i).at(j));
        }
    }
    cP.clear();

    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            if(P.at(i).at(j) == 'o'){
                cP.emplace_back(i, j);
                if(cP.size() == 2) break;
            }
        }
        if(cP.size() == 2) break;
    }
    for(int i=0;i<2;i++){
        for(int j=0;j<2;j++){
            auto c = cp.at(i);
            auto C = cP.at(j);
            int dx = C.first - c.first;
            int dy = C.second - c.second;
            int cnt = 0;        
            for(int k=0;k<h;k++){
                for(int l=0;l<w;l++){
                    char cs = p.at(k).at(l);
                    char cd = 'x';
                    if(k + dx >= 0 && k + dx < H && l + dy >= 0 && l + dy < W && P.at(k + dx).at(l + dy) == 'o'){
                        cd = 'o';
                    }
                    if(cs == 'o' && cd == 'o'){
                        cnt++;
                    } 
                }
            }
            if(cnt == coin){
                for(int k=0;k<2;k++){
                    cout << c.second << ' ' << c.first << endl;
                }
                    return 0;
            }else if(cnt == coin - 1){
                int sx,sy,dex,dey;
                bool f = true;
                for(int k=0;k<h;k++){
                    for(int l=0;l<w;l++){
                        char cs = p.at(k).at(l);
                        char cd = 'x';
                        if(k + dx >= 0 && k + dx < H && l + dy >= 0 && l + dy < W && P.at(k + dx).at(l + dy) == 'o'){
                            cd = 'o';
                        }
                        if(cs == 'o' && cd == 'x'){
                            sx = k; sy = l;
                        }else if(cs == 'x' && cd == 'o'){
                            dex = k; dey = l;
                            f = false;
                        }
                    }
                }
                if(f){
                    for(int k=0;k<H;k++){
                        for(int l=0;l<W;l++){
                            if((k - dx < 0 || k - dx >= h || l - dy < 0 || l - dy >= w) && P.at(k).at(l) == 'o'){
                                dex = k - dx; dey = l - dy;
                            }
                        }
                    }
                }
                cout << sy << ' ' << sx << endl << dey << ' ' << dex << endl;
                return 0;
            }
        }
    }

    P_new.clear();
    P_new.resize(W);
    for(int i=0;i<W;i++){
        for(int j=0;j<H;j++){
            P_new.at(i).push_back(P.at(H-j-1).at(i));
        }
    }
    tmp = W;
    W = H;
    H = tmp;
    P.clear();
    P.resize(H);
    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            P.at(i).push_back(P_new.at(i).at(j));
        }
    }
    cP.clear();


}
accuracy: 1
time_ms: 20
memory_kb: 5120
final_rank: 1

code_snippet: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, s, t) for (ll i = s; i < (ll)(t); i++)
#define all(x) begin(x), end(x)

template <class T> bool chmin(T& x, T y) {
	return x > y ? (x = y, true) : false;
}
template <class T> bool chmax(T& x, T y) {
	return x < y ? (x = y, true) : false;
}

int main() {
	int h, w;
	cin >> h >> w;
	vector<string> p(h);
	rep(i, 0, h) cin >> p[i];
	int H, W;
	cin >> H >> W;
	vector<string> P(H);
	rep(i, 0, H) cin >> P[i];
	int hshf = 0;
	while (p.back() == string(w, 'x')) p.pop_back();
	while (p.front() == string(w, 'x')) p.erase(p.begin()), hshf++;
	h = p.size();
	while (P.back() == string(W, 'x')) P.pop_back();
	while (P.front() == string(W, 'x')) P.erase(P.begin());
	H = P.size();
	{
		int flag = 0;
		while (1) {
			rep(i, 0, H) flag |= (P[i].back() != 'x');
			if (flag) break;
			rep(i, 0, H) P[i].pop_back();
		}
		flag = 0;
		while (1) {
			rep(i, 0, H) flag |= (P[i].front() != 'x');
			if (flag) break;
			rep(i, 0, H) P[i].erase(P[i].begin());
		}
	}
	int h2 = 0;
	rep(i, 1, h) {
		int flag = 0;
		rep(j, 0, w) flag |= (p[i][j] != 'x');
		if (flag) {
			h2 = i;
			break;
		}
	}
	int H2 = 0;
	rep(i, 1, H) {
		int flag = 0;
		rep(j, 0, W) flag |= (P[i][j] != 'x');
		if (flag) {
			H2 = i;
			break;
		}
	}
	auto check = [&](int sx, int sy) {
		int flg = 0;
		rep(i, 0, H) {
			rep(j, 0, W) {
				if (P[i][j] == 'o') {
					if (i + sx < 0 || i + sx >= h || j + sy < 0 ||
						j + sy >= w) {
						if (flg) return 0;
						flg = 1;
					} else if (p[i + sx][j + sy] != 'o') {
						if (flg) return 0;
						flg = 1;
					}
				}
			}
		}
		return flg;
	};
	vector<pair<int, int>> ans;
	auto get_ans = [&](int sx, int sy) {
		rep(i, 0, h) {
			rep(j, 0, w) {
				if (p[i][j] == 'o') {
					if (i - sx < 0 || i - sx >= H || j - sy < 0 ||
						j - sy >= W) {
						ans.push_back({i, j});
						break;
					} else if (P[i - sx][j - sy] != 'o') {
						ans.push_back({i, j});
						break;
					}
				}
			}
		}
		rep(i, 0, H) {
			rep(j, 0, W) {
				if (P[i][j] == 'o') {
					if (i + sx < 0 || i + sx >= h || j + sy < 0 ||
						j + sy >= w) {
						ans.push_back({i + sx, j + sy});
						break;
					} else if (p[i + sx][j + sy] != 'o') {
						ans.push_back({i + sx, j + sy});
						break;
					}
				}
			}
		}
		assert(ans.size() == 2);
	};
	auto rotate_s = [&]() {
		vector<string> nP(W, string(H, 'x'));
		rep(i, 0, H) rep(j, 0, W) {
			nP[W - 1 - j][i] = P[i][j];
		}
		swap(nP, P);
		swap(H, W);
		H2 = 0;
		rep(i, 1, H) {
			int flag = 0;
			rep(j, 0, W) flag |= (P[i][j] != 'x');
			if (flag) {
				H2 = i;
				break;
			}
		}
	};
	auto get_all = [&]() -> vector<int> {
		return {0, 0 - H2, h2 - 0, h2 - H2};
	};
	rep(lp, 0, 4) {
		for (auto sx : get_all()) rep(sy, -500, 501) {
				if (check(sx, sy)) {
					get_ans(sx, sy);
					for (auto [a, b] : ans)
						cout << b << " " << a + hshf << endl;
					return 0;
				}
			}
		rotate_s();
	}
}
accuracy: 1
time_ms: 320
memory_kb: 4864
final_rank: 6

code_snippet: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, s, t) for (ll i = s; i < (ll)(t); i++)
#define all(x) begin(x), end(x)

template <class T> bool chmin(T& x, T y) {
	return x > y ? (x = y, true) : false;
}
template <class T> bool chmax(T& x, T y) {
	return x < y ? (x = y, true) : false;
}

int main() {
	int h, w;
	cin >> h >> w;
	vector<string> p(h);
	rep(i, 0, h) cin >> p[i];
	int H, W;
	cin >> H >> W;
	vector<string> P(H);
	rep(i, 0, H) cin >> P[i];
	int hsh = 0;
	while (p.back() == string(w, 'x')) p.pop_back();
	while (p.front() == string(w, 'x')) p.erase(p.begin()), hsh++;
	h = p.size();
	while (P.back() == string(W, 'x')) P.pop_back();
	while (P.front() == string(W, 'x')) P.erase(P.begin());
	H = P.size();
	{
		int flag = 0;
		while (1) {
			rep(i, 0, H) flag |= (P[i].back() != 'x');
			if (flag) break;
			rep(i, 0, H) P[i].pop_back();
		}
		flag = 0;
		while (1) {
			rep(i, 0, H) flag |= (P[i].front() != 'x');
			if (flag) break;
			rep(i, 0, H) P[i].erase(P[i].begin());
		}
	}
	int h2 = 0;
	rep(i, 1, h) {
		int flag = 0;
		rep(j, 0, w) flag |= (p[i][j] != 'x');
		if (flag) {
			h2 = i;
			break;
		}
	}
	int H2 = 0;
	rep(i, 1, H) {
		int flag = 0;
		rep(j, 0, W) flag |= (P[i][j] != 'x');
		if (flag) {
			H2 = i;
			break;
		}
	}
	auto check = [&](int sx, int sy) {
		int flg = 0;
		rep(i, 0, H) {
			rep(j, 0, W) {
				if (P[i][j] == 'o') {
					if (i + sx < 0 || i + sx >= h || j + sy < 0 ||
						j + sy >= w) {
						if (flg) return 0;
						flg = 1;
					} else if (p[i + sx][j + sy] != 'o') {
						if (flg) return 0;
						flg = 1;
					}
				}
			}
		}
		return 1;
	};
	vector<pair<int, int>> ans;
	auto get_ans = [&](int sx, int sy) {
		rep(i, 0, h) {
			rep(j, 0, w) {
				if (p[i][j] == 'o') {
					if (i - sx < 0 || i - sx >= H || j - sy < 0 ||
						j - sy >= W) {
						ans.push_back({i, j});
						break;
					} else if (P[i - sx][j - sy] != 'o') {
						ans.push_back({i, j});
						break;
					}
				}
			}
		}
		rep(i, 0, H) {
			rep(j, 0, W) {
				if (P[i][j] == 'o') {
					if (i + sx < 0 || i + sx >= h || j + sy < 0 ||
						j + sy >= w) {
						ans.push_back({i + sx, j + sy});
						break;
					} else if (p[i + sx][j + sy] != 'o') {
						ans.push_back({i + sx, j + sy});
						break;
					}
				}
			}
		}
		assert(ans.size() == 2);
	};
	auto rotate_s = [&]() {
		vector<string> nP(W, string(H, 'x'));
		rep(i, 0, H) rep(j, 0, W) {
			nP[W - 1 - j][i] = P[i][j];
		}
		swap(nP, P);
		swap(H, W);
		H2 = 0;
		rep(i, 1, H) {
			int flag = 0;
			rep(j, 0, W) flag |= (P[i][j] != 'x');
			if (flag) {
				H2 = i;
				break;
			}
		}
	};
	auto get_all = [&]() -> vector<int> {
		return {0, 0 - h2, H2 - 0, H2 - h2};
	};
	rep(lp, 0, 4) {
		for (auto sx : get_all()) rep(sy, -500, 501) {
				if (check(sx, sy)) {
					get_ans(sx, sy);
					for (auto [a, b] : ans) cout << b << " " << a + hsh << endl;
					return 0;
				}
			}
		rotate_s();
	}
}
accuracy: 0.015384615384615385
time_ms: 300
memory_kb: 4480
final_rank: 20

code_snippet: #include <bits/stdc++.h>
using namespace std;
#define all(v) (v).begin(),(v).end()
#define pb(a) push_back(a)
#define rep(i, n) for(int i=0;i<n;i++)
#define foa(e, v) for(auto&& e : v)
using ll = long long;
const ll MOD7 = 1000000007, MOD998 = 998244353, INF = (1LL << 60);
#define dout(a) cout<<fixed<<setprecision(10)<<a<<endl;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int h, w; cin >> h >> w;
    vector<string> s(h);
    rep(i, h) cin >> s[i];
    int H, W; cin >> H >> W;
    vector<string> t(H);
    rep(i, H) {
        cin >> t[i];
    }
    pair<int, int> Min{1 << 30, 0}, Max{-1, 0};
    rep(i, h) rep(j, w) if(s[i][j] == 'o') {
        Min = min(Min, make_pair(i, j));
        Max = max(Max, make_pair(i, j));
    }
    rep(_, 4) {
        vector<pair<int, int>> vec;
        rep(i, H) rep(j, W) if(t[i][j] == 'o') {
            vec.push_back({i, j});
        }
        sort(all(vec));
        vector<pair<int, int>> can1, can2;
        {
            int mm = vec[0].first, cnt = 0;
            for(auto [x, y] : vec) {
                if(mm == x) {
                    cnt ++;
                    if(cnt <= 2) can1.push_back({x, y});
                } else {
                    can1.push_back({x, y});
                    break;
                }
            }
        } {
            reverse(all(vec));
            int mm = vec[0].first, cnt = 0;
            for(auto [x, y] : vec) {
                if(mm == x) {
                    cnt ++;
                    if(cnt <= 2) can2.push_back({x, y});
                } else {
                    can2.push_back({x, y});
                    break;
                }
            }
            reverse(all(vec));
        }
        auto check = [&](int dy, int dx) -> bool {
            vector ex(H, vector(W, false));
            int idi = -1, idj = -1;
            rep(i, h) rep(j, w) {
                if(s[i][j] == 'o') {
                    int y = i + dy;
                    int x = j + dx;
                    if(y < 0 or x < 0 or x >= W or y >= H) {
                        if(idi != -1) return false;
                        idi = i;
                        idj = j;
                        continue;
                    }
                    if(t[y][x] != 'o') {
                        if(idi != -1) return false;
                        idi = i;
                        idj = j;
                        continue;
                    }
                    ex[y][x] = 1;
                }
            }
            // assert(idi != -1);
            int ty = -1, tx = -1;
            rep(i, H) rep(j, W) if(t[i][j] == 'o' and !ex[i][j]) {
                // assert(ty == -1);
                ty = i;
                tx = j;
            }
            // assert(ty != -1);
            cout << idj << " " << idi << endl;
            cout << tx - dx << " " << ty - dy << endl;
            return true;
        };
        for(auto [basey, basex] : can1) {
            int diffy = basey - Min.first;
            int diffx = basex - Min.second;
            if(check(diffy, diffx)) {
                return 0;
            }
        }
        for(auto [basey, basex] : can2) {
            int diffy = basey - Max.first;
            int diffx = basex - Max.second;
            if(check(diffy, diffx)) {
                return 0;
            }
        }
        {
            vector<string> nx(W, string(H, 'x'));
            rep(i, H) rep(j, W) {
                nx[W - 1 - j][i] = t[i][j];
            }
            swap(nx, t);
            swap(H, W);
        }
    }
    assert(0);
    return 0;
}
accuracy: 1
time_ms: 10
memory_kb: 6164
final_rank: 2

code_snippet: #ifdef NACHIA
#define _GLIBCXX_DEBUG
#endif

#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <queue>
using namespace std;
using ll = long long;
template<class A, class B> void chmax(A& a, const B& b){ if(a < b) a = b; }
template<class A, class B> void chmin(A& a, const B& b){ if(b < a) a = b; }
using PLL = pair<ll, ll>;
#define rep(i,n) for(ll i=0; i<ll(n); i++)

ll maxX(const vector<pair<ll, ll>>& A, ll n = -1){
    if(n == -1) n = A.size();
    ll F = -1ll << 60;
    rep(i,n) chmax(F, A[i].first);
    return F;
}
ll maxY(const vector<pair<ll, ll>>& A, ll n = -1){
    if(n == -1) n = A.size();
    ll F = -1ll << 60;
    rep(i,n) chmax(F, A[i].second);
    return F;
}
ll minX(const vector<pair<ll, ll>>& A, ll n = -1){
    if(n == -1) n = A.size();
    ll F = 1ll << 60;
    rep(i,n) chmin(F, A[i].first);
    return F;
}
ll minY(const vector<pair<ll, ll>>& A, ll n = -1){
    if(n == -1) n = A.size();
    ll F = 1ll << 60;
    rep(i,n) chmin(F, A[i].second);
    return F;
}

struct Res {
    ll f;
    ll x, y, X, Y;
};

ll buf[500][500] = {};
ll markid = 2;

Res exact(vector<pair<ll, ll>> a, vector<pair<ll, ll>> b){
    //cout << "exact "; for(auto [x,y] : a){ cout << "(" << x << "," << y << ")"; } cout << " - "; for(auto [x,y] : b){ cout << "(" << x << "," << y << ")"; } cout << endl; 
    auto mxa = minX(a); for(auto& [x,y] : a) x -= mxa;
    auto mxb = minX(b); for(auto& [x,y] : b) x -= mxb;
    auto mya = minY(a); for(auto& [x,y] : a) y -= mya;
    auto myb = minY(b); for(auto& [x,y] : b) y -= myb;
    pair<ll,ll> diffa, diffb;
    ll found = 0;
    //sort(a.begin(), a.end()); sort(b.begin(), b.end());
    //set_symmetric_difference(a.begin(), a.end(), b.begin(), b.end(), back_inserter(diff));
    for(auto [x,y] : a) buf[x][y] = markid;
    for(auto [x,y] : b){
        if(buf[x][y] != markid){
            if(found) return {0,0,0,0,0};
            diffb = {x,y}; found = 1;
        }
        buf[x][y] = markid + 1;
    }
    if(!found){ return {0,0,0,0,0}; }
    for(auto [x,y] : a) if(buf[x][y] != markid+1) diffa = {x,y};
    markid += 2;
    //auto [x,y] = diff[0];
    //auto [X,Y] = diff[1];
    auto [x,y] = diffa;
    auto [X,Y] = diffb;
    //if(!binary_search(a.begin(), a.end(), diff[0])){ swap(x,X); swap(y,Y); }
    x += mxa; X += mxa; y += mya; Y += mya;
    //cout << "  found " << x << " " << y << " " << X << " " << Y << endl;
    return {1,x,y,X,Y};
}

bool offset_same(vector<pair<ll, ll>> a, vector<pair<ll, ll>> b, ll N){
    bool ans = true;
    sort(a.begin(), a.begin() + N);
    sort(b.begin(), b.begin() + N);
    rep(i,N){
        if(a[i].first - a[0].first != b[i].first - b[0].first) ans = false;
        if(a[i].second - a[0].second != b[i].second - b[0].second) ans = false;
    }
    return ans;
}

void testcase(){
    ll h, w; cin >> h >> w;
    vector<pair<ll, ll>> A, B;
    rep(y,h) rep(x,w){ char c; cin >> c; if(c == 'o') A.push_back({x,y}); }
    ll H, W; cin >> H >> W;
    rep(y,H) rep(x,W){ char c; cin >> c; if(c == 'o') B.push_back({x,y}); }
    ll N = A.size();
    ll ans1x = 0, ans1y = 0;
    ll ans2x = 0, ans2y = 0;
    ll ans_found = 0;
    auto proc = [&](Res res) -> void {
        if(res.f){
            ans_found = 1;
            ans1x = res.x; ans2x = res.X; ans1y = res.y; ans2y = res.Y;
        }
    };
    rep(cya,4){
        rep(cy,4){
            proc(exact(A, B));
            for(auto& [x,y] : B){ swap(x,y); x = -x; }
        }
        for(auto& [x,y] : A){ swap(x,y); x = -x; }
        swap(ans1x, ans1y); ans1x *= -1;
        swap(ans2x, ans2y); ans2x *= -1;
    }
    vector<ll> posb, posa;
    rep(sw,2){
        posb.push_back(max_element(B.begin(), B.end()) - B.begin());
        posb.push_back(min_element(B.begin(), B.end()) - B.begin());
        for(auto& [x,y] : B){ swap(x,y); }
    }
    rep(sw,2){
        posa.push_back(max_element(A.begin(), A.end()) - A.begin());
        posa.push_back(min_element(A.begin(), A.end()) - A.begin());
        for(auto& [x,y] : A){ swap(x,y); }
    }
    rep(cy,4){
        for(auto bi : posb){
            swap(B[bi], B.back());
            for(auto ai : posa){
                swap(A[ai], A.back());
                ll offx = minX(B, N-1) - minX(A, N-1);
                ll offy = minY(B, N-1) - minY(A, N-1);
                if(offset_same(A, B, N-1)){
                    //cout << A.back().first << " " << A.back().second << "\n" << B.back().first << " " << B.back().second << "\n";
                    proc({ 1, A.back().first, A.back().second, B.back().first - offx, B.back().second - offy });
                }
                swap(A[ai], A.back());
            }
            swap(B[bi], B.back());
        }
        for(auto& [x,y] : B){ swap(x,y); x = -x; }
    }
    
    #ifdef NACHIA
    cout << ans_found << "\n";
    #endif
    if(!ans_found) exit(1);
    cout << ans1x << " " << ans1y << "\n" << ans2x << " " << ans2y << "\n";
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    #ifdef NACHIA
    ll T; cin >> T; rep(t,T){
    #endif
    testcase();
    
    #ifdef NACHIA
    cout << "---------------------" << endl; }
    #endif
    return 0;
}
accuracy: 0.676923076923077
time_ms: 1570
memory_kb: 20712
final_rank: 12

code_snippet: #ifdef NACHIA
#define _GLIBCXX_DEBUG
#endif

#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <queue>
using namespace std;
using ll = long long;
template<class A, class B> void chmax(A& a, const B& b){ if(a < b) a = b; }
template<class A, class B> void chmin(A& a, const B& b){ if(b < a) a = b; }
using PLL = pair<ll, ll>;
#define rep(i,n) for(ll i=0; i<ll(n); i++)

ll maxX(const vector<pair<ll, ll>>& A, ll n = -1){
    if(n == -1) n = A.size();
    ll F = -1ll << 60;
    rep(i,n) chmax(F, A[i].first);
    return F;
}
ll maxY(const vector<pair<ll, ll>>& A, ll n = -1){
    if(n == -1) n = A.size();
    ll F = -1ll << 60;
    rep(i,n) chmax(F, A[i].second);
    return F;
}
ll minX(const vector<pair<ll, ll>>& A, ll n = -1){
    if(n == -1) n = A.size();
    ll F = 1ll << 60;
    rep(i,n) chmin(F, A[i].first);
    return F;
}
ll minY(const vector<pair<ll, ll>>& A, ll n = -1){
    if(n == -1) n = A.size();
    ll F = 1ll << 60;
    rep(i,n) chmin(F, A[i].second);
    return F;
}

struct Res {
    ll f;
    ll x, y, X, Y;
};

ll buf[500][500] = {};
ll markid = 2;

Res exact(vector<pair<ll, ll>> a, vector<pair<ll, ll>> b){
    //cout << "exact "; for(auto [x,y] : a){ cout << "(" << x << "," << y << ")"; } cout << " - "; for(auto [x,y] : b){ cout << "(" << x << "," << y << ")"; } cout << endl; 
    auto mxa = minX(a); for(auto& [x,y] : a) x -= mxa;
    auto mxb = minX(b); for(auto& [x,y] : b) x -= mxb;
    auto mya = minY(a); for(auto& [x,y] : a) y -= mya;
    auto myb = minY(b); for(auto& [x,y] : b) y -= myb;
    pair<ll,ll> diffa, diffb;
    ll found = 0;
    //sort(a.begin(), a.end()); sort(b.begin(), b.end());
    //set_symmetric_difference(a.begin(), a.end(), b.begin(), b.end(), back_inserter(diff));
    for(auto [x,y] : a) buf[x][y] = markid;
    for(auto [x,y] : b){
        if(buf[x][y] != markid){
            if(found) return {0,0,0,0,0};
            diffb = {x,y}; found = 1;
        }
        buf[x][y] = markid + 1;
    }
    if(!found){ return {0,0,0,0,0}; }
    for(auto [x,y] : a) if(buf[x][y] != markid+1) diffa = {x,y};
    markid += 2;
    //auto [x,y] = diff[0];
    //auto [X,Y] = diff[1];
    auto [x,y] = diffa;
    auto [X,Y] = diffb;
    //if(!binary_search(a.begin(), a.end(), diff[0])){ swap(x,X); swap(y,Y); }
    x += mxa; X += mxa; y += mya; Y += mya;
    //cout << "  found " << x << " " << y << " " << X << " " << Y << endl;
    return {1,x,y,X,Y};
}

bool offset_same(vector<pair<ll, ll>> a, vector<pair<ll, ll>> b, ll N){
    bool ans = true;
    sort(a.begin(), a.begin() + N);
    sort(b.begin(), b.begin() + N);
    rep(i,N){
        if(a[i].first - a[0].first != b[i].first - b[0].first) ans = false;
        if(a[i].second - a[0].second != b[i].second - b[0].second) ans = false;
    }
    return ans;
}

void testcase(){
    ll h, w; cin >> h >> w;
    vector<pair<ll, ll>> A, B;
    rep(y,h) rep(x,w){ char c; cin >> c; if(c == 'o') A.push_back({x,y}); }
    ll H, W; cin >> H >> W;
    rep(y,H) rep(x,W){ char c; cin >> c; if(c == 'o') B.push_back({x,y}); }
    ll N = A.size();
    ll ans1x = 0, ans1y = 0;
    ll ans2x = 0, ans2y = 0;
    ll ans_found = 0;
    auto proc = [&](Res res) -> void {
        if(res.f){
            ans_found = 1;
            ans1x = res.x; ans2x = res.X; ans1y = res.y; ans2y = res.Y;
        }
    };
    rep(cya,4){
        rep(cy,4){
            rep(sw,2){
                proc(exact(A, B));
                for(auto& [x,y] : A){ swap(x,y); }
                for(auto& [x,y] : B){ swap(x,y); }
                swap(ans1x, ans1y);
                swap(ans2x, ans2y);
            }
            for(auto& [x,y] : B){ swap(x,y); x = -x; }
        }
        for(auto& [x,y] : A){ swap(x,y); x = -x; }
        swap(ans1x, ans1y); ans1x *= -1;
        swap(ans2x, ans2y); ans2x *= -1;
    }
    vector<ll> posb, posa;
    rep(sw,2){
        posb.push_back(max_element(B.begin(), B.end()) - B.begin());
        posb.push_back(min_element(B.begin(), B.end()) - B.begin());
        for(auto& [x,y] : B){ swap(x,y); }
    }
    rep(sw,2){
        posa.push_back(max_element(A.begin(), A.end()) - A.begin());
        posa.push_back(min_element(A.begin(), A.end()) - A.begin());
        for(auto& [x,y] : A){ swap(x,y); }
    }
    rep(cy,4){
        for(auto bi : posb){
            swap(B[bi], B.back());
            for(auto ai : posa){
                swap(A[ai], A.back());
                ll offx = minX(B, N-1) - minX(A, N-1);
                ll offy = minY(B, N-1) - minY(A, N-1);
                if(offset_same(A, B, N-1)){
                    //cout << A.back().first << " " << A.back().second << "\n" << B.back().first << " " << B.back().second << "\n";
                    proc({ 1, A.back().first, A.back().second, B.back().first - offx, B.back().second - offy });
                }
                swap(A[ai], A.back());
            }
            swap(B[bi], B.back());
        }
        for(auto& [x,y] : B){ swap(x,y); x = -x; }
    }
    
    #ifdef NACHIA
    cout << ans_found << "\n";
    #endif
    cout << ans1x << " " << ans1y << "\n" << ans2x << " " << ans2y << "\n";
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    #ifdef NACHIA
    ll T; cin >> T; rep(t,T){
    #endif
    testcase();
    
    #ifdef NACHIA
    cout << "---------------------" << endl; }
    #endif
    return 0;
}
accuracy: 0.676923076923077
time_ms: 1630
memory_kb: 20864
final_rank: 13

code_snippet: #ifdef NACHIA
#define _GLIBCXX_DEBUG
#endif

#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <queue>
using namespace std;
using ll = long long;
template<class A, class B> void chmax(A& a, const B& b){ if(a < b) a = b; }
template<class A, class B> void chmin(A& a, const B& b){ if(b < a) a = b; }
using PLL = pair<ll, ll>;
#define rep(i,n) for(ll i=0; i<ll(n); i++)

ll maxX(const vector<pair<ll, ll>>& A, ll n = -1){
    if(n == -1) n = A.size();
    ll F = -1ll << 60;
    rep(i,n) chmax(F, A[i].first);
    return F;
}
ll maxY(const vector<pair<ll, ll>>& A, ll n = -1){
    if(n == -1) n = A.size();
    ll F = -1ll << 60;
    rep(i,n) chmax(F, A[i].second);
    return F;
}
ll minX(const vector<pair<ll, ll>>& A, ll n = -1){
    if(n == -1) n = A.size();
    ll F = 1ll << 60;
    rep(i,n) chmin(F, A[i].first);
    return F;
}
ll minY(const vector<pair<ll, ll>>& A, ll n = -1){
    if(n == -1) n = A.size();
    ll F = 1ll << 60;
    rep(i,n) chmin(F, A[i].second);
    return F;
}

struct Res {
    ll f;
    ll x, y, X, Y;
};

ll buf[500][500] = {};
ll markid = 0;

Res exact(vector<pair<ll, ll>> a, vector<pair<ll, ll>> b){
    //cout << "exact "; for(auto [x,y] : a){ cout << "(" << x << "," << y << ")"; } cout << " - "; for(auto [x,y] : b){ cout << "(" << x << "," << y << ")"; } cout << endl; 
    auto mxa = minX(a); for(auto& [x,y] : a) x -= mxa;
    auto mxb = minX(b); for(auto& [x,y] : b) x -= mxb;
    auto mya = minY(a); for(auto& [x,y] : a) y -= mya;
    auto myb = minY(b); for(auto& [x,y] : b) y -= myb;
    pair<ll,ll> diffa, diffb;
    ll found = 0;
    //sort(a.begin(), a.end()); sort(b.begin(), b.end());
    //set_symmetric_difference(a.begin(), a.end(), b.begin(), b.end(), back_inserter(diff));
    for(auto [x,y] : a) buf[x][y] = markid;
    for(auto [x,y] : b){
        if(buf[x][y] != markid){
            if(found) return {0,0,0,0,0};
            diffb = {x,y}; found = 1;
        }
        buf[x][y] = markid + 1;
    }
    if(!found){ return {0,0,0,0,0}; }
    for(auto [x,y] : a) if(buf[x][y] != markid+1) diffa = {x,y};
    markid += 2;
    //auto [x,y] = diff[0];
    //auto [X,Y] = diff[1];
    auto [x,y] = diffa;
    auto [X,Y] = diffb;
    //if(!binary_search(a.begin(), a.end(), diff[0])){ swap(x,X); swap(y,Y); }
    x += mxa; X += mxa; y += mya; Y += mya;
    //cout << "  found " << x << " " << y << " " << X << " " << Y << endl;
    return {1,x,y,X,Y};
}

bool offset_same(vector<pair<ll, ll>> a, vector<pair<ll, ll>> b, ll N){
    bool ans = true;
    sort(a.begin(), a.begin() + N);
    sort(b.begin(), b.begin() + N);
    rep(i,N){
        if(a[i].first - a[0].first != b[i].first - b[0].first) ans = false;
        if(a[i].second - a[0].second != b[i].second - b[0].second) ans = false;
    }
    return ans;
}

void testcase(){
    ll h, w; cin >> h >> w;
    vector<pair<ll, ll>> A, B;
    rep(y,h) rep(x,w){ char c; cin >> c; if(c == 'o') A.push_back({x,y}); }
    ll H, W; cin >> H >> W;
    rep(y,H) rep(x,W){ char c; cin >> c; if(c == 'o') B.push_back({x,y}); }
    ll N = A.size();
    ll ans1x = 0, ans1y = 0;
    ll ans2x = 0, ans2y = 0;
    ll ans_found = 0;
    auto proc = [&](Res res) -> void {
        if(res.f){
            ans_found = 1;
            ans1x = res.x; ans2x = res.X; ans1y = res.y; ans2y = res.Y;
        }
    };
    rep(cya,4){
        rep(cy,4){
            rep(sw,2){
                proc(exact(A, B));
                for(auto& [x,y] : A){ swap(x,y); }
                for(auto& [x,y] : B){ swap(x,y); }
                swap(ans1x, ans1y);
                swap(ans2x, ans2y);
            }
            for(auto& [x,y] : B){ swap(x,y); x = -x; }
        }
        for(auto& [x,y] : A){ swap(x,y); x = -x; }
        swap(ans1x, ans1y); ans1x *= -1;
        swap(ans2x, ans2y); ans2x *= -1;
    }
    vector<ll> posb, posa;
    rep(sw,2){
        posb.push_back(max_element(B.begin(), B.end()) - B.begin());
        posb.push_back(min_element(B.begin(), B.end()) - B.begin());
        for(auto& [x,y] : B){ swap(x,y); }
    }
    rep(sw,2){
        posa.push_back(max_element(A.begin(), A.end()) - A.begin());
        posa.push_back(min_element(A.begin(), A.end()) - A.begin());
        for(auto& [x,y] : A){ swap(x,y); }
    }
    rep(cy,4){
        for(auto bi : posb){
            swap(B[bi], B.back());
            for(auto ai : posa){
                swap(A[ai], A.back());
                ll offx = minX(B, N-1) - minX(A, N-1);
                ll offy = minY(B, N-1) - minY(A, N-1);
                if(offset_same(A, B, N-1)){
                    //cout << A.back().first << " " << A.back().second << "\n" << B.back().first << " " << B.back().second << "\n";
                    proc({ 1, A.back().first, A.back().second, B.back().first - offx, B.back().second - offy });
                }
                swap(A[ai], A.back());
            }
            swap(B[bi], B.back());
        }
        for(auto& [x,y] : B){ swap(x,y); x = -x; }
    }
    
    #ifdef NACHIA
    cout << ans_found << "\n";
    #endif
    cout << ans1x << " " << ans1y << "\n" << ans2x << " " << ans2y << "\n";
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    #ifdef NACHIA
    ll T; cin >> T; rep(t,T){
    #endif
    testcase();
    
    #ifdef NACHIA
    cout << "---------------------" << endl; }
    #endif
    return 0;
}
accuracy: 0.5846153846153846
time_ms: 1640
memory_kb: 20736
final_rank: 14

code_snippet: #include <bits/stdc++.h>
using namespace std;

const int inf = 1e9;

void rot(vector<pair<int, int>> & p) {
    for (int i = 0; i < (int)p.size(); ++i) {
        p[i] = {-p[i].second, p[i].first};
    }
}

pair<pair<int, int>, pair<int, int>> get(vector<pair<int, int>> p1, vector<pair<int, int>> p2) {
    sort(p2.begin(), p2.begin());
    vector<int> used((int)p2.size());
    pair<int, int> nu;
    int cnt = 0;
    for (auto & [x, y] : p1) {
        int t = lower_bound(p2.begin(), p2.end(), make_pair(x, y)) - p2.begin();
        if (t == (int)p2.size() || p2[t] != make_pair(x, y)) {
            nu = {x, y};
            ++cnt;
        } else {
            used[t] = 1;
        }
    }
    pair<int, int> snu;
    for (int i = 0; i < (int)p2.size(); ++i) {
        if (!used[i]) {
            snu = p2[i];
        }
    }
    if (cnt == 1) {
        return {nu, snu};
    } else {
        return {{-inf, -inf}, {-inf, -inf}};
    }
}

pair<pair<int, int>, pair<int, int>> check(vector<pair<int, int>> p1, vector<pair<int, int>> p2) {
    sort(p1.begin(), p1.end());
    sort(p2.begin(), p2.end());
    for (int i = 0; i <= 1; ++i) {
        for (int j = 0; j <= 1; ++j) {
            auto np1 = p1, np2 = p2;
            for (auto & [x, y] : np1) {
                x -= p1[i].first;
                y -= p1[i].second;
            }
            for (auto & [x, y] : np2) {
                x -= p2[j].first;
                y -= p2[j].second;
            }
            auto ans = get(np1, np2);
            if (ans.first != make_pair(-inf, -inf)) {
                auto [x1, y1] = ans.first;
                auto [x2, y2] = ans.second;
                return {{x1 + p1[i].first, y1 + p1[i].second}, {x2 + p1[i].first, y2 + p1[i].second}};
            }
        }
    }
    return {{-inf, -inf}, {-inf, -inf}};
}

signed main() {
    int n1, m1; cin >> n1 >> m1;
    vector<pair<int, int>> p1, p2;
    for (int i = 0; i < n1; ++i) {
        for (int j = 0; j < m1; ++j) {
            char t; cin >> t;
            if (t == 'o') p1.push_back({j, i});
        }
    }
    int n2, m2; cin >> n2 >> m2;
    for (int i = 0; i < n2; ++i) {
        for (int j = 0; j < m2; ++j) {
            char t; cin >> t;
            if (t == 'o') p2.push_back({j, i});
        }
    }
    if ((int)p1.size() == 1) {
        cout << p1[0].first + 1 << " " << p1[0].second + 1 << "\n";
        return 0;
    }
    sort(p1.begin(), p1.end());
    sort(p2.begin(), p2.end());
    for (int i = 0; i < 4; ++i) {
        auto ans = check(p1, p2);
        if (ans.first != make_pair(-inf, -inf)) {
            cout << ans.first.first << " " << ans.first.second << "\n" << ans.second.first << " " << ans.second.second << "\n";
            break;
        }
        rot(p2);
    }
    return 0;
}
accuracy: 1
time_ms: 130
memory_kb: 19684
final_rank: 5

code_snippet: #include <bits/stdc++.h>
using namespace std;

const int inf = 1e9;

void rot(vector<pair<int, int>> & p) {
    for (int i = 0; i < (int)p.size(); ++i) {
        p[i] = {-p[i].second, p[i].first};
    }
}

pair<pair<int, int>, pair<int, int>> get(vector<pair<int, int>> p1, vector<pair<int, int>> p2) {
    sort(p2.begin(), p2.begin());
    vector<int> used((int)p2.size());
    pair<int, int> nu;
    int cnt = 0;
    for (auto & [x, y] : p1) {
        int t = lower_bound(p2.begin(), p2.end(), make_pair(x, y)) - p2.begin();
        if (t == (int)p2.size() || p2[t] != make_pair(x, y)) {
            nu = {x, y};
            ++cnt;
        } else {
            used[t] = 1;
        }
    }
    pair<int, int> snu;
    for (int i = 0; i < (int)p2.size(); ++i) {
        if (!used[i]) {
            snu = p2[i];
        }
    }
    if (cnt == 1) {
        return {nu, snu};
    } else {
        return {{-inf, -inf}, {-inf, -inf}};
    }
}

pair<pair<int, int>, pair<int, int>> check(vector<pair<int, int>> p1, vector<pair<int, int>> p2) {
    for (int i = 0; i <= 1; ++i) {
        for (int j = 0; j <= 1; ++j) {
            auto np1 = p1, np2 = p2;
            for (auto & [x, y] : np1) {
                x -= p1[i].first;
                y -= p1[i].second;
            }
            for (auto & [x, y] : np2) {
                x -= p2[j].first;
                y -= p2[j].second;
            }
            auto ans = get(np1, np2);
            if (ans.first != make_pair(-inf, -inf)) {
                auto [x1, y1] = ans.first;
                auto [x2, y2] = ans.second;
                return {{x1 + p1[i].first, y1 + p1[i].second}, {x2 + p1[i].first, y2 + p1[i].second}};
            }
        }
    }
    return {{-inf, -inf}, {-inf, -inf}};
}

signed main() {
    int n1, m1; cin >> n1 >> m1;
    vector<pair<int, int>> p1, p2;
    for (int i = 0; i < n1; ++i) {
        for (int j = 0; j < m1; ++j) {
            char t; cin >> t;
            if (t == 'o') p1.push_back({j, i});
        }
    }
    int n2, m2; cin >> n2 >> m2;
    for (int i = 0; i < n2; ++i) {
        for (int j = 0; j < m2; ++j) {
            char t; cin >> t;
            if (t == 'o') p2.push_back({j, i});
        }
    }
    if ((int)p1.size() == 1) {
        cout << p1[0].first + 1 << " " << p1[0].second + 1 << "\n";
        return 0;
    }
    sort(p1.begin(), p1.end());
    sort(p2.begin(), p2.end());
    for (int i = 0; i < 4; ++i) {
        auto ans = check(p1, p2);
        if (ans.first != make_pair(-inf, -inf)) {
            cout << ans.first.first << " " << ans.first.second << "\n" << ans.second.first << " " << ans.second.second << "\n";
            break;
        }
        rot(p2);
    }
    return 0;
}
accuracy: 0.06153846153846154
time_ms: 10
memory_kb: 3360
final_rank: 15

code_snippet: #include <bits/stdc++.h>
using namespace std;

const int inf = 1e9;

void rot(vector<pair<int, int>> & p) {
    for (int i = 0; i < (int)p.size(); ++i) {
        p[i] = {-p[i].second, p[i].first};
    }
}

pair<pair<int, int>, pair<int, int>> get(vector<pair<int, int>> p1, vector<pair<int, int>> p2) {
    sort(p2.begin(), p2.begin());
    vector<int> used((int)p2.size());
    pair<int, int> nu;
    int cnt = 0;
    for (auto & [x, y] : p1) {
        int t = lower_bound(p2.begin(), p2.end(), make_pair(x, y)) - p2.begin();
        if (t == (int)p2.size() || p2[t] != make_pair(x, y)) {
            nu = {x, y};
            ++cnt;
        } else {
            used[t] = 1;
        }
    }
    pair<int, int> snu;
    for (int i = 0; i < (int)p2.size(); ++i) {
        if (!used[i]) {
            snu = p2[i];
        }
    }
    if (cnt == 1) {
        return {nu, snu};
    } else {
        return {{-inf, -inf}, {-inf, -inf}};
    }
}

pair<pair<int, int>, pair<int, int>> check(vector<pair<int, int>> p1, vector<pair<int, int>> p2) {
    for (int i = 0; i <= 1; ++i) {
        for (int j = 0; j <= 1; ++j) {
            auto np1 = p1, np2 = p2;
            for (auto & [x, y] : np1) {
                x -= p1[i].first;
                y -= p1[i].second;
            }
            for (auto & [x, y] : np2) {
                x -= p2[j].first;
                y -= p2[j].second;
            }
            auto ans = get(np1, np2);
            if (ans.first != make_pair(-inf, -inf)) {
                auto [x1, y1] = ans.first;
                auto [x2, y2] = ans.second;
                return {{x1 + p1[i].first, y1 + p1[i].second}, {x2 + p1[i].first, y2 + p1[i].second}};
            }
        }
    }
    return {{-inf, -inf}, {-inf, -inf}};
}

signed main() {
    int n1, m1; cin >> n1 >> m1;
    vector<pair<int, int>> p1, p2;
    for (int i = 0; i < n1; ++i) {
        for (int j = 0; j < m1; ++j) {
            char t; cin >> t;
            if (t == 'o') p1.push_back({j, i});
        }
    }
    int n2, m2; cin >> n2 >> m2;
    for (int i = 0; i < n2; ++i) {
        for (int j = 0; j < m2; ++j) {
            char t; cin >> t;
            if (t == 'o') p2.push_back({j, i});
        }
    }
    sort(p1.begin(), p1.end());
    sort(p2.begin(), p2.end());
    for (int i = 0; i < 4; ++i) {
        auto ans = check(p1, p2);
        if (ans.first != make_pair(-inf, -inf)) {
            cout << ans.first.first << " " << ans.first.second << "\n" << ans.second.first << " " << ans.second.second << "\n";
            break;
        }
        rot(p2);
    }
    return 0;
}
accuracy: 0.06153846153846154
time_ms: 10
memory_kb: 3440
final_rank: 16

code_snippet: #include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
  #include "settings/debug.cpp"
#else
  #define Debug(...) void(0)
#endif
#define rep(i, n) for (int i = 0; i < (n); ++i)
using ll = long long;
using ull = unsigned long long;

int main() {
  cin.tie(nullptr)->sync_with_stdio(false);
  int h1, w1, h2, w2;
  cin >> h1 >> w1;
  vector source(h1, vector<char>(w1));
  rep(i, h1) rep(j, w1) cin >> source[i][j];
  cin >> h2 >> w2;
  vector target(h2, vector<char>(w2));
  rep(i, h2) rep(j, w2) cin >> target[i][j];

  auto RotateSrc = [&]() {
    vector<vector<char>> rotated(w1, vector<char>(h1));
    rep(i, w1) rep(j, h1) rotated[i][j] = source[h1 - 1 - j][i];
    swap(h1, w1);
    swap(source, rotated);
  };

  auto getOriginalPoint = [&](int rotateCnt, int x, int y) {
    int h = h1, w = w1;
    while (rotateCnt--) {
      swap(h, w);
      int nx = h - 1 - y, ny = x;
      x = nx, y = ny;
    }
    return make_pair(x, y);
  };

  vector<int> tx(h2, 0), ty(w2, 0);
  rep(i, h2) rep(j, w2) {
    if (target[i][j] == 'o') tx[i]++, ty[j]++;
  }

  rep(_, 4) {
    vector<int> sx(h1, 0), sy(w1, 0);
    rep(i, h1) rep(j, w1) {
      if (source[i][j] == 'o') sx[i]++, sy[j]++;
    }
    vector<int> candx, candy;
    for (int offset = -500; offset <= 500; ++offset) {
      int sum = 0;
      rep(i, h1) {
        int j = i + offset;
        if (j < 0 || j >= h2)
          sum += abs(sx[i] - 0);
        else
          sum += abs(sx[i] - tx[j]);
      }
      if (sum <= 2) candx.push_back(offset);
    }
    for (int offset = -500; offset <= 500; ++offset) {
      int sum = 0;
      rep(i, w1) {
        int j = i + offset;
        if (j < 0 || j >= w2)
          sum += abs(sy[i] - 0);
        else
          sum += abs(sy[i] - ty[j]);
      }
      if (sum <= 2) candy.push_back(offset);
    }

    for (int offsetx : candx) {
      for (int offsety : candy) {
        vector<int> fromx, fromy, tox, toy;
        rep(i, h1) rep(j, w1) {
          int x = i + offsetx, y = j + offsety;
          if (source[i][j] == 'x') continue;
          if (x < 0 || x >= h2 || y < 0 || y >= w2 || target[x][y] == 'x') {
            fromx.push_back(i), fromy.push_back(j);
          }
        }
        rep(i, h2) rep(j, w2) {
          int x = i - offsetx, y = j - offsety;
          if (target[i][j] == 'x') continue;
          if (x < 0 || x >= h1 || y < 0 || y >= w1 || source[x][y] == 'x') {
            tox.push_back(x), toy.push_back(y);
          }
        }
        if (fromx.size() == 1 && tox.size() == 1) {
          auto [fx, fy] = getOriginalPoint(_, fromx[0], fromy[0]);
          auto [tx, ty] = getOriginalPoint(_, tox[0], toy[0]);
          cout << fy << ' ' << fx << '\n';
          cout << ty << ' ' << tx << '\n';
          return 0;
        }
      }
    }

    RotateSrc();
  }
  assert(false);
  return 0;
}
accuracy: 1
time_ms: 50
memory_kb: 4480
final_rank: 3

code_snippet: //tekitou hash demo tooru to uresii
#include<bits/stdc++.h>
using namespace std;

using ll = long long;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep2(i,s,t) for(int i=s;i<t;i++)

using vi = vector<int>;


int main() {

    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    int h, w,H,W;
    cin >> h >> w;
    vector<string> s(h);
    rep(i, h)cin >> s[i];
    cin >> H >> W;
    vector<string> S(H);
    rep(i, H)cin >> S[i];

    vector<array<int, 2>> p;
    rep(i, h)rep(j, w)if (s[i][j] == 'o')p.push_back({ i,j });
    rep(_, 4) {
        vector<array<int, 2>> P;
        rep(i, H)rep(j, W)if (S[i][j] == 'o')P.push_back({ i,j });
        assert(p.size()==P.size());
        rep(u, 2)rep(v, 2) {
            int dh = p[u][0] - P[v][0];
            int dw = p[u][1] - P[v][1];
            set<array<int, 2>> SS;
            for (auto s : P)SS.insert(s);
            array<int, 2>ans;
            for (auto s : p) {
                if (!SS.count({ s[0] - dh,s[1] - dw }))ans = s;
                else SS.erase({ s[0] - dh,s[1] - dw });
            }
            if (SS.size() == 1) {
                auto bns = *(SS.begin());
                cout << ans[1] << " " << ans[0] << "\n" << bns[1] + dw << " " << bns[0] + dh << endl;
                return 0;
            }
        }
        vector<string> NS(W);
        rep(j, W)rep(i, H)NS[j].push_back(S[H-i-1][j]);
        swap(H, W);
        swap(S, NS);
    }
}
accuracy: 1
time_ms: 310
memory_kb: 19124
final_rank: 9

code_snippet: //tekitou hash demo tooru to uresii
#include<bits/stdc++.h>
using namespace std;

using ll = long long;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep2(i,s,t) for(int i=s;i<t;i++)

using vi = vector<int>;


int main() {

    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    int h, w;
    cin >> h >> w;
    vector<string> s(h);
    rep(i, h)cin >> s[i];
    int H, W;
    cin >> H >> W;
    vector<string> S(H);
    rep(i, H)cin >> S[i];

    vector<array<int, 2>> p;
    rep(i, h)rep(j, w)if (s[i][j] == 'o')p.push_back({ i,j });
    if (p.size() == 1) {
        cout << p[0][1] << " " << p[0][0] << " " << p[0][1] << " " << p[0][0] << endl;
        return 0;
    }
    rep(_, 4) {
        vector<array<int, 2>> P;
        rep(i, H)rep(j, W)if (S[i][j] == 'o')P.push_back({ i,j });

        assert(p.size()==P.size());
        rep(u, 2)rep(v, 2) {
            int dh = p[u][0] - P[v][0];
            int dw = p[u][1] - P[v][1];
            // cout<<dh<<" "<<dw<<endl;
            set<array<int, 2>> SS;
            for (auto s : P)SS.insert(s);
            array<int, 2>ans;
            for (auto s : p) {
                if (!SS.count({ s[0] - dh,s[1] - dw })) {
                    ans = s;
                }
                else SS.erase({ s[0] - dh,s[1] - dw });
            }
            if (SS.size() == 1) {
                auto bns = *(SS.begin());
                cout << ans[1] << " " << ans[0] << "\n" << bns[1] + dw << " " << bns[0] + dh << endl;
                return 0;
            }
        }

        vector<string> NS(W);
        rep(j, W)rep(i, H)NS[j].push_back(S[H-i-1][j]);
        swap(H, W);
        swap(S, NS);
    }

}
accuracy: 1
time_ms: 310
memory_kb: 19304
final_rank: 10

code_snippet: #include <bits/stdc++.h>
using namespace std;
using ll=long long;
using ull=unsigned long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define loop(n) for (int tjh = 0; tjh < (int)(n); tjh++)
constexpr int maxH=1500;
constexpr int mH=500;
constexpr ull MOD=(1UL<<61)-1UL;
constexpr int maxa=maxH*maxH;
constexpr ull base=37UL;
constexpr ull baseinv=2181202846553494278UL;
array<ull,maxa+1>tab;array<ull,maxa+1>tabinv;
unordered_map<ull,int>tabmap;
int h1,h2,w1,w2;vector<string>S1;vector<string>S2;
array<int,2>off1;array<int,4>off2;
array<ull,4> S2hash;ull S1hash;
vector<int>S1h,S1w;
int h0,w0;vector<string>S0;
int re0,X,Y,Z,W;bool fl1;
ull dec(ull a,ull b){
  ull res=a+MOD-b;
  return res>=MOD?res-MOD:res;
}
ull mul(ull a,ull b){
  __int128_t t=(__int128_t)a*(__int128_t)b;
  ull res=(ull)((t>>61)+(t&(__int128_t)MOD));
  return res>=MOD?res-MOD:res;
}
int main() {
  cin.tie(0)->sync_with_stdio(0);
  cout<<fixed<<setprecision(16);
  tab[0]=1UL;tabinv[0]=1UL;
  rep(i,maxa){
    tab[i+1]=mul(tab[i],base);
    tabinv[i+1]=mul(tabinv[i],baseinv);
  }
  rep(i,maxa+1)tabmap[tab[i]]=i;
  {
    cin>>h0>>w0;S0.resize(h0);
    rep(i,h0)cin>>S0[i];
    int hmin=h0;int hmax=-1;int wmin=w0;int wmax=-1;
    rep(i,h0){
      rep(j,w0){
	if(S0[i][j]=='o'){
	  if(i<hmin)hmin=i;
	  if(i>hmax)hmax=i;
	  if(j<wmin)wmin=j;
	  if(j>wmax)wmax=j;
	}
      }
    }
    off1={hmin,wmin};
    hmax++;wmax++;
    h1=hmax-hmin;w1=wmax-wmin;
    S1.resize(h1);
    for(int i=hmin;i<hmax;i++){
      for(int j=wmin;j<wmax;j++){
	S1[i-hmin]+=S0[i][j];
      }
    }
  }
  {
    cin>>h0>>w0;S0.resize(h0);
    rep(i,h0)cin>>S0[i];
    int hmin=h0;int hmax=-1;int wmin=w0;int wmax=-1;
    rep(i,h0){
      rep(j,w0){
	if(S0[i][j]=='o'){
	  if(i<hmin)hmin=i;
	  if(i>hmax)hmax=i;
	  if(j<wmin)wmin=j;
	  if(j>wmax)wmax=j;
	}
      }
    }
    hmax++;wmax++;
    h2=hmax-hmin;w2=wmax-wmin;
    S2.resize(h2);
    for(int i=hmin;i<hmax;i++){
      for(int j=wmin;j<wmax;j++){
	S2[i-hmin]+=S0[i][j];
      }
    }
  }
  {
    fl1=false;
    rep(i,h2){
      rep(j,w2){
	if(S2[i][j]=='o'){
	  if(!fl1){fl1=true;off2[0]=(i+mH)*maxH+(j+mH);}
	  S2hash[0]+=tab[(i+mH)*maxH+(j+mH)];
	  if(S2hash[0]>=MOD)S2hash[0]-=MOD;
	}
      }
    }
    fl1=false;
    rep(i,h2){
      rep(j,w2){
	if(S2[h2-1-i][w2-1-j]=='o'){
	  if(!fl1){fl1=true;off2[1]=(i+mH)*maxH+(j+mH);}
	  S2hash[1]+=tab[(i+mH)*maxH+(j+mH)];
	  if(S2hash[1]>=MOD)S2hash[1]-=MOD;
	}
      }
    }
    fl1=false;
    rep(i,w2){
      rep(j,h2){
	if(S2[h2-1-j][i]=='o'){
	  if(!fl1){fl1=true;off2[2]=(i+mH)*maxH+(j+mH);}
	  S2hash[2]+=tab[(i+mH)*maxH+(j+mH)];
	  if(S2hash[2]>=MOD)S2hash[2]-=MOD;
	}
      }
    }
    fl1=false;
    rep(i,w2){
      rep(j,h2){
	if(S2[j][w2-1-i]=='o'){
	  if(!fl1){fl1=true;off2[3]=(i+mH)*maxH+(j+mH);}
	  S2hash[3]+=tab[(i+mH)*maxH+(j+mH)];
	  if(S2hash[3]>=MOD)S2hash[3]-=MOD;
	}
      }
    }
  }
  rep(i,h1){
    rep(j,w1){
      if(S1[i][j]=='o'){
	S1h.push_back(i);
	S1w.push_back(j);
	S1hash+=tab[i*maxH+j];
	if(S1hash>=MOD)S1hash-=MOD;
      }
    }
  }
  rep(i,h1){
    rep(j,w1){
      if(S1[i][j]=='o'){
	ull te1=dec(S1hash,tab[i*maxH+j]);
	if(i==S1h[0]&&j==S1w[0])te1=mul(te1,tabinv[S1h[1]*maxH+S1w[1]]);
	else te1=mul(te1,tabinv[S1h[0]*maxH+S1w[0]]);
	rep(k,S2hash.size()){
	  ull S=S2hash[k];
	  ull te2=mul(te1,tab[off2[k]]);
	  if(tabmap.find(dec(S,te2))!=tabmap.end()){
	    re0=tabmap[dec(S,te2)];
	    X=i;Y=j;Z=re0/maxH-mH;W=re0%maxH-mH;
	    if(i==S1h[0]&&j==S1w[0]){
	      Z+=S1h[1]-(off2[k]/maxH-mH);
	      W+=S1w[1]-(off2[k]%maxH-mH);
	    }else{
	      Z+=S1h[0]-(off2[k]/maxH-mH);
	      W+=S1w[0]-(off2[k]%maxH-mH);
	    }
	    X+=off1[0];Y+=off1[1];Z+=off1[0];W+=off1[1];
	    cout<<Y<<' '<<X<<'\n'<<W<<' '<<Z<<'\n';
	    return 0;
	  }
	}
      }
    }
  }
  S1hash=0UL;
  reverse(S1h.begin(),S1h.end());reverse(S1w.begin(),S1w.end());
  rep(i,S1h.size())S1h[i]=h1-1-S1h[i];
  rep(i,S1w.size())S1w[i]=w1-1-S1w[i];
  rep(i,h1){
    rep(j,w1){
      if(S1[h1-1-i][w1-1-j]=='o'){
	S1hash+=tab[i*maxH+j];
	if(S1hash>=MOD)S1hash-=MOD;
      }
    }
  }
  rep(i,h1){
    rep(j,w1){
      if(S1[h1-1-i][w1-1-j]=='o'){
	ull te1=dec(S1hash,tab[i*maxH+j]);
	if(i==S1h[0]&&j==S1w[0])te1=mul(te1,tabinv[S1h[1]*maxH+S1w[1]]);
	else te1=mul(te1,tabinv[S1h[0]*maxH+S1w[0]]);
	rep(k,S2hash.size()){
	  ull S=S2hash[k];
	  ull te2=mul(te1,tab[off2[k]]);
	  if(tabmap.find(dec(S,te2))!=tabmap.end()){
	    re0=tabmap[dec(S,te2)];
	    X=i;Y=j;Z=re0/maxH-mH;W=re0%maxH-mH;
	    if(i==S1h[0]&&j==S1w[0]){
	      Z+=S1h[1]-(off2[k]/maxH-mH);
	      W+=S1w[1]-(off2[k]%maxH-mH);
	    }else{
	      Z+=S1h[0]-(off2[k]/maxH-mH);
	      W+=S1w[0]-(off2[k]%maxH-mH);
	    }
	    X=h1-1-X;Y=w1-1-Y;Z=h1-1-Z;W=w1-1-W;
	    X+=off1[0];Y+=off1[1];Z+=off1[0];W+=off1[1];
	    cout<<Y<<' '<<X<<'\n'<<W<<' '<<Z<<'\n';
	    return 0;
	  }
	}
      }
    }
  }
  return 1;
}
accuracy: 1
time_ms: 500
memory_kb: 136336
final_rank: 11

code_snippet: #include <bits/stdc++.h>
using namespace std;
using ll=long long;
using ull=unsigned long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define loop(n) for (int tjh = 0; tjh < (int)(n); tjh++)
constexpr int maxH=500;
constexpr ull MOD=(1UL<<61)-1UL;
constexpr int maxa=maxH*maxH;
constexpr ull base=37UL;
constexpr ull baseinv=2181202846553494278UL;
array<ull,maxa+1>tab;array<ull,maxa+1>tabinv;
unordered_map<ull,int>tabmap;
int h1,h2,w1,w2;vector<string>S1;vector<string>S2;
array<int,2>off1;
array<ull,4> S2hash;ull S1hash;
vector<int>S1h,S1w;
int h0,w0;vector<string>S0;
int re0,X,Y,Z,W;bool fl1;
ull dec(ull a,ull b){
  ull res=a+MOD-b;
  return res>=MOD?res-MOD:res;
}
ull mul(ull a,ull b){
  __int128_t t=(__int128_t)a*(__int128_t)b;
  ull res=(ull)((t>>61)+(t&(__int128_t)MOD));
  return res>=MOD?res-MOD:res;
}
ull pow(ull a,ull b){
  ull res=1UL;
  ull bas=a;
  for(;b;){
    if(b&1)res=mul(res,bas);
    bas=mul(bas,bas);
    b>>=1;
  }
  return res;
}
int main() {
  cin.tie(0)->sync_with_stdio(0);
  cout<<fixed<<setprecision(16);
  tab[0]=1UL;tabinv[0]=1UL;
  rep(i,maxa){
    tab[i+1]=mul(tab[i],base);
    tabinv[i+1]=mul(tabinv[i],baseinv);
  }
  rep(i,maxa+1)tabmap[tab[i]]=i;
  {
    cin>>h0>>w0;S0.resize(h0);
    rep(i,h0)cin>>S0[i];
    int hmin=h0;int hmax=-1;int wmin=w0;int wmax=-1;
    rep(i,h0){
      rep(j,w0){
	if(S0[i][j]=='o'){
	  if(i<hmin)hmin=i;
	  if(i>hmax)hmax=i;
	  if(j<wmin)wmin=j;
	  if(j>wmax)wmax=j;
	}
      }
    }
    off1={hmin,wmin};
    hmax++;wmax++;
    h1=hmax-hmin;w1=wmax-wmin;
    S1.resize(h1);
    for(int i=hmin;i<hmax;i++){
      for(int j=wmin;j<wmax;j++){
	S1[i-hmin]+=S0[i][j];
      }
    }
  }
  {
    cin>>h0>>w0;S0.resize(h0);
    rep(i,h0)cin>>S0[i];
    int hmin=h0;int hmax=-1;int wmin=w0;int wmax=-1;
    rep(i,h0){
      rep(j,w0){
	if(S0[i][j]=='o'){
	  if(i<hmin)hmin=i;
	  if(i>hmax)hmax=i;
	  if(j<wmin)wmin=j;
	  if(j>wmax)wmax=j;
	}
      }
    }
    hmax++;wmax++;
    h2=hmax-hmin;w2=wmax-wmin;
    S2.resize(h2);
    for(int i=hmin;i<hmax;i++){
      for(int j=wmin;j<wmax;j++){
	S2[i-hmin]+=S0[i][j];
      }
    }
  }
  {
    rep(i,h2){
      rep(j,w2){
	if(S2[i][j]=='o'){
	  S2hash[0]+=tab[i*maxH+j];
	  if(S2hash[0]>=MOD)S2hash[0]-=MOD;
	}
      }
    }
    rep(i,h2){
      rep(j,w2){
	if(S2[h2-1-i][w2-1-j]=='o'){
	  S2hash[1]+=tab[i*maxH+j];
	  if(S2hash[1]>=MOD)S2hash[1]-=MOD;
	}
      }
    }
    rep(i,w2){
      rep(j,h2){
	if(S2[h2-1-j][i]=='o'){
	  S2hash[2]+=tab[i*maxH+j];
	  if(S2hash[2]>=MOD)S2hash[2]-=MOD;
	}
      }
    }
    rep(i,w2){
      rep(j,h2){
	if(S2[j][w2-1-i]=='o'){
	  S2hash[3]+=tab[i*maxH+j];
	  if(S2hash[3]>=MOD)S2hash[3]-=MOD;
	}
      }
    }
  }
  rep(i,h1){
    rep(j,w1){
      if(S1[i][j]=='o'){
	S1h.push_back(i);
      }
    }
  }
  rep(i,w1){
    rep(j,h1){
      if(S1[j][i]=='o'){
	S1w.push_back(i);
      }
    }
  }
  rep(i,h1){
    rep(j,w1){
      if(S1[i][j]=='o'){
	S1hash+=tab[i*maxH+j];
	if(S1hash>=MOD)S1hash-=MOD;
      }
    }
  }
  rep(i,h1){
    rep(j,w1){
      if(S1[i][j]=='o'){
	ull te1=dec(S1hash,tab[i*maxH+j]);
	if(i==S1h[0]&&S1h[0]!=S1h[1])te1=mul(te1,tabinv[maxH*(S1h[1]-S1h[0])]);
	if(j==S1w[0]&&S1w[0]!=S1w[1])te1=mul(te1,tabinv[S1w[1]-S1w[0]]);
	for(ull S:S2hash){
	  if(tabmap.find(dec(S,te1))!=tabmap.end()){
	    re0=tabmap[dec(S,te1)];
	    X=i;Y=j;Z=re0/maxH;W=re0%maxH;
	    if(i==S1h[0]&&S1h[0]!=S1h[1])Z+=S1h[1]-S1h[0];
	    if(j==S1w[0]&&S1w[0]!=S1w[1])W+=S1w[1]-S1w[0];
	    X+=off1[0];Y+=off1[1];Z+=off1[0];W+=off1[1];
	    cout<<Y<<' '<<X<<'\n'<<W<<' '<<Z<<'\n';
	    return 0;
	  }
	}
      }
    }
  }
  S1hash=0UL;
  reverse(S1h.begin(),S1h.end());reverse(S1w.begin(),S1w.end());
  rep(i,S1h.size())S1h[i]=h1-1-S1h[i];
  rep(i,S1w.size())S1w[i]=w1-1-S1w[i];
  rep(i,h1){
    rep(j,w1){
      if(S1[h1-1-i][w1-1-j]=='o'){
	S1hash+=tab[i*maxH+j];
	if(S1hash>=MOD)S1hash-=MOD;
      }
    }
  }
  rep(i,h1){
    rep(j,w1){
      if(S1[h1-1-i][w1-1-j]=='o'){
	ull te1=dec(S1hash,tab[i*maxH+j]);
	if(i==S1h[0]&&S1h[0]!=S1h[1])te1=mul(te1,tabinv[maxH*(S1h[1]-S1h[0])]);
	if(j==S1w[0]&&S1w[0]!=S1w[1])te1=mul(te1,tabinv[S1w[1]-S1w[0]]);
	for(ull S:S2hash){
	  if(tabmap.find(dec(S,te1))!=tabmap.end()){
	    re0=tabmap[dec(S,te1)];
	    X=i;Y=j;Z=re0/maxH;W=re0%maxH;
	    if(i==S1h[0]&&S1h[0]!=S1h[1])Z+=S1h[1]-S1h[0];
	    if(j==S1w[0]&&S1w[0]!=S1w[1])W+=S1w[1]-S1w[0];
	    X=h1-1-X;Y=w1-1-Y;Z=h1-1-Z;W=w1-1-W;
	    X+=off1[0];Y+=off1[1];Z+=off1[0];W+=off1[1];
	    cout<<Y<<' '<<X<<'\n'<<W<<' '<<Z<<'\n';
	    return 0;
	  }
	}
      }
    }
  }
  return 1;
}
accuracy: 0.03076923076923077
time_ms: 20
memory_kb: 18548
final_rank: 19

code_snippet: #include <bits/stdc++.h>
using namespace std;
using ll=long long;
using ull=unsigned long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define loop(n) for (int tjh = 0; tjh < (int)(n); tjh++)
constexpr int maxH=500;
constexpr ull MOD=(1UL<<61)-1UL;
constexpr int maxa=maxH*maxH;
constexpr ull base=37UL;
constexpr ull baseinv=2181202846553494278UL;
array<ull,maxa+1>tab;array<ull,maxa+1>tabinv;
unordered_map<ull,int>tabmap;
int h1,h2,w1,w2;vector<string>S1;vector<string>S2;
array<int,2>off1;
array<ull,4> S2hash;ull S1hash;
vector<int>S1h,S1w;
int h0,w0;vector<string>S0;
vector<vector<int>>S3;
int re0,X,Y,Z,W;
ull dec(ull a,ull b){
  ull res=a+MOD-b;
  return res>=MOD?res-MOD:res;
}
ull mul(ull a,ull b){
  __int128_t t=(__int128_t)a*(__int128_t)b;
  ull res=(ull)((t>>61)+(t&(__int128_t)MOD));
  return res>=MOD?res-MOD:res;
}
ull pow(ull a,ull b){
  ull res=1UL;
  ull bas=a;
  for(;b;){
    if(b&1)res=mul(res,bas);
    bas=mul(bas,bas);
    b>>=1;
  }
  return res;
}
int main() {
  cin.tie(0)->sync_with_stdio(0);
  cout<<fixed<<setprecision(16);
  tab[0]=1UL;tabinv[0]=1UL;
  rep(i,maxa){
    tab[i+1]=mul(tab[i],base);
    tabinv[i+1]=mul(tabinv[i],baseinv);
  }
  rep(i,maxa+1)tabmap[tab[i]]=i;
  {
    cin>>h0>>w0;S0.resize(h0);
    rep(i,h0)cin>>S0[i];
    int hmin=h0;int hmax=-1;int wmin=w0;int wmax=-1;
    rep(i,h0){
      rep(j,w0){
	if(S0[i][j]=='o'){
	  if(i<hmin)hmin=i;
	  if(i>hmax)hmax=i;
	  if(j<wmin)wmin=j;
	  if(j>wmax)wmax=j;
	}
      }
    }
    off1={hmin,wmin};
    hmax++;wmax++;
    h1=hmax-hmin;w1=wmax-wmin;
    S1.resize(h1);
    for(int i=hmin;i<hmax;i++){
      for(int j=wmin;j<wmax;j++){
	S1[i-hmin]+=S0[i][j];
      }
    }
  }
  {
    cin>>h0>>w0;S0.resize(h0);
    rep(i,h0)cin>>S0[i];
    int hmin=h0;int hmax=-1;int wmin=w0;int wmax=-1;
    rep(i,h0){
      rep(j,w0){
	if(S0[i][j]=='o'){
	  if(i<hmin)hmin=i;
	  if(i>hmax)hmax=i;
	  if(j<wmin)wmin=j;
	  if(j>wmax)wmax=j;
	}
      }
    }
    hmax++;wmax++;
    h2=hmax-hmin;w2=wmax-wmin;
    S2.resize(h2);
    for(int i=hmin;i<hmax;i++){
      for(int j=wmin;j<wmax;j++){
	S2[i-hmin]+=S0[i][j];
      }
    }
  }
  {
    rep(i,h2){
      rep(j,w2){
	if(S2[i][j]=='o'){
	  S2hash[0]+=tab[i*maxH+j];
	  if(S2hash[0]>=MOD)S2hash[0]-=MOD;
	}
      }
    }
    rep(i,h2){
      rep(j,w2){
	if(S2[h2-1-i][w2-1-j]=='o'){
	  S2hash[1]+=tab[i*maxH+j];
	  if(S2hash[1]>=MOD)S2hash[1]-=MOD;
	}
      }
    }
    rep(i,w2){
      rep(j,h2){
	if(S2[h2-1-j][i]=='o'){
	  S2hash[2]+=tab[i*maxH+j];
	  if(S2hash[2]>=MOD)S2hash[2]-=MOD;
	}
      }
    }
    rep(i,w2){
      rep(j,h2){
	if(S2[j][w2-1-i]=='o'){
	  S2hash[3]+=tab[i*maxH+j];
	  if(S2hash[3]>=MOD)S2hash[3]-=MOD;
	}
      }
    }
  }
  S1h.resize(h1);S1w.resize(w1);
  rep(i,h1){
    rep(j,w1){
      if(S1[i][j]=='o'){
	S1h[i]++;S1w[j]++;
	S1hash+=tab[i*maxH+j];
	if(S1hash>=MOD)S1hash-=MOD;
      }
    }
  }
  rep(i,h1){
    rep(j,w1){
      if(S1[i][j]=='o'){
	ull te1=dec(S1hash,tab[i*maxH+j]);
	if(i==0&&S1h[i]==1)te1=mul(te1,tabinv[maxH]);
	if(j==0&&S1w[j]==1)te1=mul(te1,tabinv[1]);
	for(ull S:S2hash){
	  if(tabmap.find(dec(S,te1))!=tabmap.end()){
	    re0=tabmap[dec(S,te1)];
	    X=i;Y=j;Z=re0/maxH;W=re0%maxH;
	    if(i==0&&S1h[i]==1)Z++;
	    if(j==0&&S1w[j]==1)W++;
	    X+=off1[0];Y+=off1[1];Z+=off1[0];W+=off1[1];
	    cout<<Y<<' '<<X<<'\n'<<W<<' '<<Z<<'\n';
	    return 0;
	  }
	}
      }
    }
  }
  S1hash=0UL;
  reverse(S1h.begin(),S1h.end());reverse(S1w.begin(),S1w.end());
  rep(i,h1){
    rep(j,w1){
      if(S1[h1-1-i][w1-1-j]=='o'){
	S1hash+=tab[i*maxH+j];
	if(S1hash>=MOD)S1hash-=MOD;
      }
    }
  }
  rep(i,h1){
    rep(j,w1){
      if(S1[h1-1-i][w1-1-j]=='o'){
	ull te1=dec(S1hash,tab[i*maxH+j]);
	if(i==0&&S1h[i]==1)te1=mul(te1,tabinv[maxH]);
	if(j==0&&S1w[j]==1)te1=mul(te1,tabinv[1]);
	for(ull S:S2hash){
	  if(tabmap.find(dec(S,te1))!=tabmap.end()){
	    re0=tabmap[dec(S,te1)];
	    X=i;Y=j;Z=re0/maxH;W=re0%maxH;
	    if(i==0&&S1h[i]==1)Z++;
	    if(j==0&&S1w[j]==1)W++;
	    X=h1-1-X;Y=w1-1-Y;Z=h1-1-Z;W=w1-1-W;
	    X+=off1[0];Y+=off1[1];Z+=off1[0];W+=off1[1];
	    cout<<Y<<' '<<X<<'\n'<<W<<' '<<Z<<'\n';
	    return 0;
	  }
	}
      }
    }
  }
  return 1;
}
accuracy: 0.03076923076923077
time_ms: 10
memory_kb: 18548
final_rank: 17

code_snippet: #include <bits/stdc++.h>
using namespace std;
using ll=long long;
using ull=unsigned long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define loop(n) for (int tjh = 0; tjh < (int)(n); tjh++)
constexpr int maxH=500;
constexpr ull MOD=(1UL<<61)-1UL;
constexpr int maxa=maxH*maxH;
constexpr ull base=37UL;
constexpr ull baseinv=2181202846553494278UL;
array<ull,maxa+1>tab;array<ull,maxa+1>tabinv;
unordered_map<ull,int>tabmap;
int h1,h2,w1,w2;vector<string>S1;vector<string>S2;
array<int,2>off1;
array<ull,4> S2hash;ull S1hash;
vector<int>S1h,S1w;
int h0,w0;vector<string>S0;
vector<vector<int>>S3;
int re0,X,Y,Z,W;
ull dec(ull a,ull b){
  ull res=a+MOD-b;
  return res>=MOD?res-MOD:res;
}
ull mul(ull a,ull b){
  __int128_t t=(__int128_t)a*(__int128_t)b;
  ull res=(ull)((t>>61)+(t&(__int128_t)MOD));
  return res>=MOD?res-MOD:res;
}
ull pow(ull a,ull b){
  ull res=1UL;
  ull bas=a;
  for(;b;){
    if(b&1)res=mul(res,bas);
    bas=mul(bas,bas);
    b>>=1;
  }
  return res;
}
int main() {
  cin.tie(0)->sync_with_stdio(0);
  cout<<fixed<<setprecision(16);
  tab[0]=1UL;tabinv[0]=1UL;
  rep(i,maxa){
    tab[i+1]=mul(tab[i],base);
    tabinv[i+1]=mul(tabinv[i],baseinv);
  }
  rep(i,maxa+1)tabmap[tab[i]]=i;
  {
    cin>>h0>>w0;S0.resize(h0);
    rep(i,h0)cin>>S0[i];
    int hmin=h0;int hmax=-1;int wmin=w0;int wmax=-1;
    rep(i,h0){
      rep(j,w0){
	if(S0[i][j]=='o'){
	  if(i<hmin)hmin=i;
	  if(i>hmax)hmax=i;
	  if(j<wmin)wmin=j;
	  if(j>wmax)wmax=j;
	}
      }
    }
    off1={hmin,wmin};
    hmax++;wmax++;
    h1=hmax-hmin;w1=wmax-wmin;
    S1.resize(h1);
    for(int i=hmin;i<hmax;i++){
      for(int j=wmin;j<wmax;j++){
	S1[i-hmin]+=S0[i][j];
      }
    }
  }
  {
    cin>>h0>>w0;S0.resize(h0);
    rep(i,h0)cin>>S0[i];
    int hmin=h0;int hmax=-1;int wmin=w0;int wmax=-1;
    rep(i,h0){
      rep(j,w0){
	if(S0[i][j]=='o'){
	  if(i<hmin)hmin=i;
	  if(i>hmax)hmax=i;
	  if(j<wmin)wmin=j;
	  if(j>wmax)wmax=j;
	}
      }
    }
    hmax++;wmax++;
    h2=hmax-hmin;w2=wmax-wmin;
    S2.resize(h2);
    for(int i=hmin;i<hmax;i++){
      for(int j=wmin;j<wmax;j++){
	S2[i-hmin]+=S0[i][j];
      }
    }
  }
  {
    rep(i,h2){
      rep(j,w2){
	if(S2[i][j]=='o'){
	  S2hash[0]+=tab[i*maxH+j];
	  if(S2hash[0]>=MOD)S2hash[0]-=MOD;
	}
      }
    }
    rep(i,h2){
      rep(j,w2){
	if(S2[h2-1-i][w2-1-j]=='o'){
	  S2hash[1]+=tab[i*maxH+j];
	  if(S2hash[1]>=MOD)S2hash[1]-=MOD;
	}
      }
    }
    rep(i,w2){
      rep(j,h2){
	if(S2[h2-1-j][i]=='o'){
	  S2hash[2]+=tab[i*maxH+j];
	  if(S2hash[2]>=MOD)S2hash[2]-=MOD;
	}
      }
    }
    rep(i,w2){
      rep(j,h2){
	if(S2[j][w2-1-i]=='o'){
	  S2hash[3]+=tab[i*maxH+j];
	  if(S2hash[3]>=MOD)S2hash[3]-=MOD;
	}
      }
    }
  }
  S1h.resize(h1);S1w.resize(w1);
  rep(i,h1){
    rep(j,w1){
      if(S1[i][j]=='o'){
	S1h[i]++;S1w[j]++;
	S1hash+=tab[i*maxH+j];
	if(S1hash>=MOD)S1hash-=MOD;
      }
    }
  }
  rep(i,h1){
    rep(j,w1){
      if(S1[i][j]=='o'){
	ull te1=dec(S1hash,tab[i*maxH+j]);
	if(i==0&&S1h[i]==1)te1=mul(te1,tabinv[maxH]);
	if(j==0&&S1w[j]==1)te1=mul(te1,tabinv[1]);
	for(ull S:S2hash){
	  if(tabmap.find(dec(S,te1))!=tabmap.end()){
	    re0=tabmap[dec(S,te1)];
	    X=i;Y=j;Z=re0/maxH;W=re0%maxH;
	    if(i==0&&S1h[i]==1)Z++;
	    if(j==0&&S1h[j]==1)W++;
	    X+=off1[0];Y+=off1[1];Z+=off1[0];W+=off1[1];
	    cout<<Y<<' '<<X<<'\n'<<W<<' '<<Z<<'\n';
	    return 0;
	  }
	}
      }
    }
  }
  S1hash=0UL;
  reverse(S1h.begin(),S1h.end());reverse(S1w.begin(),S1w.end());
  rep(i,h1){
    rep(j,w1){
      if(S1[h1-1-i][w1-1-j]=='o'){
	S1hash+=tab[i*maxH+j];
	if(S1hash>=MOD)S1hash-=MOD;
      }
    }
  }
  rep(i,h1){
    rep(j,w1){
      if(S1[h1-1-i][w1-1-j]=='o'){
	ull te1=dec(S1hash,tab[i*maxH+j]);
	if(i==0&&S1h[i]==1)te1=mul(te1,tabinv[maxH]);
	if(j==0&&S1w[j]==1)te1=mul(te1,tabinv[1]);
	for(ull S:S2hash){
	  if(tabmap.find(dec(S,te1))!=tabmap.end()){
	    re0=tabmap[dec(S,te1)];
	    X=i;Y=j;Z=re0/maxH;W=re0%maxH;
	    if(i==0&&S1h[i]==1)Z++;
	    if(j==0&&S1h[j]==1)W++;
	    X=h1-1-X;Y=w1-1-Y;Z=h1-1-Z;W=w1-1-W;
	    X+=off1[0];Y+=off1[1];Z+=off1[0];W+=off1[1];
	    cout<<Y<<' '<<X<<'\n'<<W<<' '<<Z<<'\n';
	    return 0;
	  }
	}
      }
    }
  }
}
accuracy: 0.03076923076923077
time_ms: 10
memory_kb: 18552
final_rank: 18

code_snippet: #include <bits/stdc++.h>
using namespace std;
vector<string> rotate90(const vector<string> &s) {
	int h = s.size(), w = s[0].size();
	vector<string> res(w, string(h, '-'));
	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			res[w - j - 1][i] = s[i][j];
		}
	}
	return res;
}

#define show(x) cerr << #x << " : ", showVal(x);

void showVal(int x) {
	cerr << x << endl;
}
void showVal(string s) { cerr << s << endl; }
void showVal(vector<string> x) {
	for (auto s : x) showVal(s);
}

int main() {
	vector<int> h(2), w(2);
	vector<vector<string>> s(2);
	for (int v = 0; v < 2; v++) {
		cin >> h[v] >> w[v];
		s[v].assign(h[v], string());
		for (int i = 0; i < h[v]; i++) {
			cin >> s[v][i];
		}
	}
	for (int rotate = 0; rotate < 4; rotate++) {
		vector<vector<pair<int, int>>> cis(2);
		for (int v = 0; v < 2; v++) {
			for (int i = 0; i < h[v]; i++) {
				for (int j = 0; j < w[v]; j++) {
					if (s[v][i][j] == 'o') {
						cis[v].push_back({i, j});
					}
				}
			}
		}
		// show(s[0]);
		// show(s[1]);
		for (int r0 = 0; r0 < 2; r0++) {
			for (int r1 = 0; r1 < 2; r1++) {
				set<pair<int, int>> cis0(cis[0].begin(), cis[0].end());
				// adj r-st
				int difi = cis[1][r1].first - cis[0][r0].first;
				int difj = cis[1][r1].second - cis[0][r0].second;
				vector<pair<int, int>> reqcoin;
				int cur = 0;
				for (auto [i, j] : cis[1]) {
					int ogi = i - difi;
					int ogj = j - difj;
					if (!cis0.count({ogi, ogj})) {
						reqcoin.push_back({ogi, ogj});
					} else {
						cis0.erase({ogi, ogj});
					}
					if (reqcoin.size() >= 2) break;
				}
				if (reqcoin.size() == 1) {
					assert(cis0.size() == 1);
					printf("%d %d\n%d %d\n", cis0.begin()->second, cis0.begin()->first, reqcoin[0].second, reqcoin[0].first);
					return 0;
				}
			}
		}
		s[1] = rotate90(s[1]);
		swap(h[1], w[1]);
	}
	return 0;
}
accuracy: 1
time_ms: 50
memory_kb: 19724
final_rank: 4

code_snippet: #include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define ALL(a) begin(a),end(a)
int h1,w1;
int h2,w2;
vector<string> s(500);
vector<string> t(500);

pair<int,int> rot(int x,int y,int cnt){
	for(int i = 0;i < cnt;i++){
		swap(x,y);
		x = -x;
	}
	return {x,y};
}

pair<int,int> irot(int x,int y,int cnt){
	for(int i = 0;i < cnt;i++){
		swap(x,y);
		y = -y;
	}
	return {x,y};
}

void f(int x1,int y1,int x2,int y2){
	for(int i = 0;i < 4;i++){
		int damecnt = 0;
		for(int x = 0;x < h1;x++){
			if(damecnt >= 2) break;
			for(int y = 0;y < w1;y++)if(s[x][y] == 'o'){
				auto [nx,ny] = rot(x - x1,y - y1,i);
				nx += x2;
				ny += y2;
				if(0 <= nx && nx < h2 && 0 <= ny && ny < w2 && t[nx][ny] == 'o');
				else if(damecnt == 0) damecnt++;
				else{
					damecnt++;
					break;
				}
			}
		}
		if(damecnt == 1){
			vector<vector<bool>> vis(h2,vector<bool>(w2,false));
			for(int x = 0;x < h1;x++)for(int y = 0;y < w1;y++)if(s[x][y] == 'o'){
				auto [nx,ny] = rot(x - x1,y - y1,i);
				nx += x2;
				ny += y2;
				if(0 <= nx && nx < h2 && 0 <= ny && ny < w2 && t[nx][ny] == 'o') vis[nx][ny] = true;
				else cout << y << ' ' << x << endl;
			}
			for(int x = 0;x < h2;x++)for(int y = 0;y < w2;y++)if(t[x][y] == 'o' && !vis[x][y]){
				auto [nx,ny] = irot(x - x2,y - y2,i);
				cout << ny + y1 << ' ' << nx + x1 << endl;
			}
			exit(0);
		}else if(damecnt == 0){
			for(int x = 0;x < h1;x++)for(int y = 0;y < w1;y++)if(s[x][y] == 'o'){
				cout << y << ' ' << x << endl;
				cout << y << ' ' << x << endl;
			}
			exit(0);
		}
	}
}

int main(){
	cin >> h1 >> w1;
	for(int i = 0;i < h1;i++) cin >> s[i];
	cin >> h2 >> w2;
	for(int i = 0;i < h2;i++) cin >> t[i];
	vector<pair<int,int>> v1;
	for(int i = 0;i < h1;i++)for(int j = 0;j < w1;j++)if(s[i][j] == 'o') v1.push_back({i,j});
	sort(ALL(v1));
	vector<int> vx,vy;
	for(int i = 0;i < h2;i++)for(int j = 0;j < w2;j++)if(t[i][j] == 'o'){
		vx.push_back(i);
		vy.push_back(j);
	}
	sort(ALL(vx));
	vx.erase(unique(ALL(vx)),vx.end());
	sort(ALL(vy));
	vy.erase(unique(ALL(vy)),vy.end());
	for(int i = 0;i < h2;i++)for(int j = 0;j < w2;j++)if(t[i][j] == 'o'){
		if(vx.size() == 1 || vy.size() == 1 || i <= vx[1] || j <= vy[1] || vx[vx.size() - 2] <= i || vy[vy.size() - 2] <= j){
			f(v1[0].first,v1[0].second,i,j);
			f(v1.back().first,v1.back().second,i,j);
		}
	}
	return 0;
}
accuracy: 1
time_ms: 360
memory_kb: 9596
final_rank: 7