Problem:
N: 3人協力ゲーム
リアクティブ問題です。
問題文
$1000$ ビットの非負整数が $200$ 個あり、$a_1, \ldots, a_{100}, b_1, \ldots, b_{100}$ とします。
アリスは $a_1, \ldots, a_{100}$ を確認し、$3000$ ビットのメモ $X$ をチャーリーのために残します。
ボブは $b_1, \ldots, b_{100}$ を確認し、$3000$ ビットのメモ $Y$ をチャーリーのために残します。
チャーリーはメモ $X, Y$ の情報をもとに、$100$ 個の質問に答えます。
$i$ 番目の質問は $1000$ ビットの非負整数 $c_i$ で表され、チャーリーは $a_{x_i}$ と $b_{y_i}$ のビットごとの排他的論理和が $c_i$ に等しくなるような $x_i, y_i$ を答えます。
$100$ 個の質問のうち、$95$ 個以上の質問に正答できる戦略を考えてください。
制約
$a_1, \ldots, a_{100}, b_1, \ldots, b_{100}, c_1, \ldots, c_{100}$ は $2$ 進数表記で与えられ、
0
，
1
からなる長さ $1000$ の文字列である。
$a_1, \ldots, a_{100}$ は互いに異なる。
$b_1, \ldots, b_{100}$ は互いに異なる。
$c_1, \ldots, c_{100}$ は互いに異なる。
$i = 1, 2, \ldots, 100$ について、$a_j$ と $b_k$ のビットごとの排他的論理和が $c_i$ になるような $j, k$ が存在する。
入出力とジャッジ
あなたのプログラムは $1$ つのテストケースに対して $3$ 回実行される。
$1$ 回目の実行では次の入力形式でアリスへの情報が与えられる。
Alice
$a_1$
$a_2$
$\vdots$
$a_{100}$
$1$ 行目に必ず
Alice
の文字列が与えられる。
この場合、入力を全て受け取った後
0
，
1
からなる長さ $3000$ の文字列 $X$ を出力し、プログラムを即座に終了させなければならない。
$2$ 回目の実行では次の入力形式でボブへの情報が与えられる。
Bob
$b_1$
$b_2$
$\vdots$
$b_{100}$
$1$ 行目に必ず
Bob
の文字列が与えられる。
この場合、入力を全て受け取った後
0
，
1
からなる長さ $3000$ の文字列 $Y$ を出力し、プログラムを即座に終了させなければならない。
$3$ 回目の実行では次の入力形式でチャーリーへの質問およびメモの情報が与えられる。
Charlie
$X$
$Y$
$c_1$
$c_2$
$\vdots$
$c_{100}$
$1$ 行目に必ず
Charlie
の文字列が与えられる。
入力を全て受け取った後 $1$ 以上 $100$ 以下の整数 $x_1, x_2, \ldots, x_{100}$ と $1$ 以上 $100$ 以下の整数 $y_1, y_2, \ldots, y_{100}$ を以下の形式で出力し、プログラムを即座に終了させなければならない。
$x_1$ $y_1$
$x_2$ $y_2$
$\vdots$
$x_{100}$ $y_{100}$
ジャッジは、$i = 1, 2, \ldots, 100$ について $a_{x_i}$ と $b_{y_i}$ のビットごとの排他的論理和が $c_i$ に一致するか調べ、一致数が $95$ 個以上であれば正答、そうでなければ誤答と判定する。
不正な値や不正な形式での出力があった場合にも誤答とする。
注意
出力の度に標準出力を flush せよ。そうしない場合、TLE となる可能性がある。
どの種類の入力の末尾にも EOF が与えられる。
プロセスは、上記によって規定された以外のいかなる通信も行ってはならない。
入出力例1
以下はビット数や非負整数の数、質問の数が異なるが、$a = (000, 011), b = (110, 111), c = (101, 100)$ としたときの対話例である。
解答プログラムの出力
解答プログラムへの入力
説明
解答プログラム（アリス）が実行される
Alice
$000$
$011$
アリスは $a = (000, 011)$ の情報を得る
$0000110\ldots 0$
アリスはメモ $X = 0000110\ldots 0$ を残す
解答プログラム（アリス）の実行が終了し、新たな解答プログラム（ボブ）が実行される
Bob
$110$
$111$
ボブは $b = (110, 111)$ の情報を得る
$1101110\ldots 0$
ボブはメモ $Y = 1101110\ldots 0$ を残す
解答プログラム（ボブ）の実行が終了し、新たな解答プログラム（チャーリー）が実行される
Charlie
$0000110\ldots 0$
$1101110\ldots 0$
$101$
$100$
チャーリーは $X, Y$ の情報を得たあと、質問の情報 $c = (101, 100)$ を得る
$2$ $1$
$2$ $2$
チャーリーは $1$ つ目の質問に対して $(x_1, y_1) = (2, 1)$、$2$ つ目の質問に対して $(x_2, y_2) = (2, 2)$ と回答する

Submitted solutions:

code_snippet: /*
 * _|_|_|_|_|  _|_|_|_|    _|_|_|  _|_|_|_|_|  _|_|_|      _|_|
 *       _|    _|        _|                _|        _|  _|    _|
 *     _|      _|_|_|      _|_|          _|      _|_|        _|
 *   _|        _|              _|      _|            _|    _|
 * _|_|_|_|_|  _|        _|_|_|      _|        _|_|_|    _|_|_|_|
 */

#include <bits/stdc++.h>

constexpr int L = 30;

std::string Encode(std::string S) {
  std::mt19937 engine(114514);
  std::reverse(S.begin(), S.end());
  std::string res(L, '0');
  int val = 0;
  for (int i = 0; i < (int) S.length(); i++) {
    int w = std::uniform_int_distribution<>(0, (1 << L) - 1)(engine);
    if (S[i] == '1') { val ^= w; }
  }
  for (int i = 0; i < L; i++) { res[i] = '0' + (val >> i & 1); }
  return res;
}

std::string operator^(const std::string &A, const std::string &B) {
  assert(A.size() == B.size());
  std::string S(A.size(), '0');
  for (int i = 0; i < (int) A.size(); i++) {
    if (A[i] != B[i]) { S[i] = '1'; }
  }
  return S;
}

std::string Alice(std::vector<std::string> A) {
  std::string ret;
  for (const auto &v: A) { ret += Encode(v); }
  return ret;
}

std::string Bob(std::vector<std::string> B) {
  std::string ret;
  for (const auto &v: B) { ret += Encode(v); }
  return ret;
}

std::vector<std::pair<int, int>> Catherine(std::string a, std::string b,
                                           std::vector<std::string> C) {
  int N = (int) a.length() / L;
  std::map<std::string, int> sA, sB;
  std::vector<std::string> A(N), B(N);
  for (int i = 0; i < N; i++) {
    A[i] = a.substr(i * L, L);
    B[i] = b.substr(i * L, L);
    sA[A[i]] = 1, sB[B[i]] = 1;
  }

  std::mt19937 engine(133446);
  std::vector<std::pair<int, int>> ans;
  for (const auto &v: C) {
    auto S = Encode(v);
    std::vector<std::pair<int, int>> tmp;
    for (int i = 0; i < N; i++) {
      for (int j = 0; j < N; j++) {
        if ((A[i] ^ B[j]) == S) { tmp.emplace_back(i, j); }
      }
    }
    assert(!tmp.empty());
    int p = std::uniform_int_distribution<>(0, (int) tmp.size() - 1)(engine);
    ans.emplace_back(tmp[p]);
  }

  return ans;
}

int main() {
  std::string type;
  std::cin >> type;
  if (type == "Alice" || type == "Bob") {
    std::vector<std::string> A(100);
    for (auto &v: A) { std::cin >> v; }
    std::cout << Alice(A) << '\n';
  } else {
    std::string a, b;
    std::vector<std::string> C(100);
    std::cin >> a >> b;
    for (auto &v: C) { std::cin >> v; }
    auto ans = Catherine(a, b, C);
    for (auto v: ans) {
      std::cout << v.first + 1 << ' ' << v.second + 1 << '\n';
    }
  }
  return 0;
}
accuracy: 1
time_ms: 140
memory_kb: 4352
final_rank: 7

code_snippet: /*
 * _|_|_|_|_|  _|_|_|_|    _|_|_|  _|_|_|_|_|  _|_|_|      _|_|
 *       _|    _|        _|                _|        _|  _|    _|
 *     _|      _|_|_|      _|_|          _|      _|_|        _|
 *   _|        _|              _|      _|            _|    _|
 * _|_|_|_|_|  _|        _|_|_|      _|        _|_|_|    _|_|_|_|
 */

#include <bits/stdc++.h>

constexpr int L = 30;

std::string Encode(std::string S) {
  constexpr int pMod = 998244853;
  std::reverse(S.begin(), S.end());
  std::string res(L, '0');
  int val = 0;
  for (int i = 0, pw = 1; i < (int) S.length(); i++, pw = pw * 2 % pMod) {
    if (S[i] == '1') { val ^= pw; }
  }
  for (int i = 0; i < L; i++) { res[i] = '0' + (val >> i & 1); }
  return res;
}

std::string operator^(const std::string &A, const std::string &B) {
  assert(A.size() == B.size());
  std::string S(A.size(), '0');
  for (int i = 0; i < (int) A.size(); i++) {
    if (A[i] != B[i]) { S[i] = '1'; }
  }
  return S;
}

std::string Alice(std::vector<std::string> A) {
  std::string ret;
  for (const auto &v: A) { ret += Encode(v); }
  return ret;
}

std::string Bob(std::vector<std::string> B) {
  std::string ret;
  for (const auto &v: B) { ret += Encode(v); }
  return ret;
}

std::vector<std::pair<int, int>> Catherine(std::string a, std::string b,
                                           std::vector<std::string> C) {
  int N = (int) a.length() / L;
  std::map<std::string, int> sA, sB;
  std::vector<std::string> A(N), B(N);
  for (int i = 0; i < N; i++) {
    A[i] = a.substr(i * L, L);
    B[i] = b.substr(i * L, L);
    sA[A[i]] = 1, sB[B[i]] = 1;
  }

  std::mt19937 engine(133447);
  std::vector<std::pair<int, int>> ans;
  for (const auto &v: C) {
    auto S = Encode(v);
    std::vector<std::pair<int, int>> tmp;
    for (int i = 0; i < N; i++) {
      for (int j = 0; j < N; j++) {
        if ((A[i] ^ B[j]) == S) { tmp.emplace_back(i, j); }
      }
    }
    assert(!tmp.empty());
    int p = std::uniform_int_distribution<>(0, (int) tmp.size() - 1)(engine);
    ans.emplace_back(tmp[p]);
  }

  return ans;
}

int main() {
  std::string type;
  std::cin >> type;
  if (type == "Alice" || type == "Bob") {
    std::vector<std::string> A(100);
    for (auto &v: A) { std::cin >> v; }
    std::cout << Alice(A) << '\n';
  } else {
    std::string a, b;
    std::vector<std::string> C(100);
    std::cin >> a >> b;
    for (auto &v: C) { std::cin >> v; }
    auto ans = Catherine(a, b, C);
    for (auto v: ans) {
      std::cout << v.first + 1 << ' ' << v.second + 1 << '\n';
    }
  }
  return 0;
}
accuracy: 1
time_ms: 140
memory_kb: 4352
final_rank: 7

code_snippet: /*
 * _|_|_|_|_|  _|_|_|_|    _|_|_|  _|_|_|_|_|  _|_|_|      _|_|
 *       _|    _|        _|                _|        _|  _|    _|
 *     _|      _|_|_|      _|_|          _|      _|_|        _|
 *   _|        _|              _|      _|            _|    _|
 * _|_|_|_|_|  _|        _|_|_|      _|        _|_|_|    _|_|_|_|
 */

#include <bits/stdc++.h>

constexpr int L = 30;

std::string Encode(std::string S) {
  std::mt19937 engine(114515);
  std::reverse(S.begin(), S.end());
  std::string res(L, '0');
  for (int i = 0; i < (int) S.length(); i++) {
    int p = i < L ? i : std::uniform_int_distribution<>(0, L - 1)(engine);
    if (S[i] == '1') { res[p] ^= 1; }
  }
  return res;
}

std::string operator^(const std::string &A, const std::string &B) {
  assert(A.size() == B.size());
  std::string S(A.size(), '0');
  for (int i = 0; i < (int) A.size(); i++) {
    if (A[i] != B[i]) { S[i] = '1'; }
  }
  return S;
}

std::string Alice(std::vector<std::string> A) {
  std::string ret;
  for (const auto &v: A) { ret += Encode(v); }
  return ret;
}

std::string Bob(std::vector<std::string> B) {
  std::string ret;
  for (const auto &v: B) { ret += Encode(v); }
  return ret;
}

std::vector<std::pair<int, int>> Catherine(std::string a, std::string b,
                                           std::vector<std::string> C) {
  int N = (int) a.length() / L;
  std::map<std::string, int> sA, sB;
  std::vector<std::string> A(N), B(N);
  for (int i = 0; i < N; i++) {
    A[i] = a.substr(i * L, L);
    B[i] = b.substr(i * L, L);
    sA[A[i]] = 1, sB[B[i]] = 1;
  }

  std::mt19937 engine(133448);
  std::vector<std::pair<int, int>> ans;
  for (const auto &v: C) {
    auto S = Encode(v);
    std::vector<std::pair<int, int>> tmp;
    for (int i = 0; i < N; i++) {
      for (int j = 0; j < N; j++) {
        if ((A[i] ^ B[j]) == S) { tmp.emplace_back(i, j); }
      }
    }
    assert(!tmp.empty());
    int p = std::uniform_int_distribution<>(0, (int) tmp.size() - 1)(engine);
    ans.emplace_back(tmp[p]);
  }

  return ans;
}

int main() {
  std::string type;
  std::cin >> type;
  if (type == "Alice" || type == "Bob") {
    std::vector<std::string> A(100);
    for (auto &v: A) { std::cin >> v; }
    std::cout << Alice(A) << '\n';
  } else {
    std::string a, b;
    std::vector<std::string> C(100);
    std::cin >> a >> b;
    for (auto &v: C) { std::cin >> v; }
    auto ans = Catherine(a, b, C);
    for (auto v: ans) {
      std::cout << v.first + 1 << ' ' << v.second + 1 << '\n';
    }
  }
  return 0;
}
accuracy: 0.3939393939393939
time_ms: 140
memory_kb: 4352
final_rank: 18

code_snippet: /*
 * _|_|_|_|_|  _|_|_|_|    _|_|_|  _|_|_|_|_|  _|_|_|      _|_|
 *       _|    _|        _|                _|        _|  _|    _|
 *     _|      _|_|_|      _|_|          _|      _|_|        _|
 *   _|        _|              _|      _|            _|    _|
 * _|_|_|_|_|  _|        _|_|_|      _|        _|_|_|    _|_|_|_|
 */

#include <bits/stdc++.h>

constexpr int L = 30;

std::string Encode(std::string S) {
  std::mt19937 engine(114515);
  std::reverse(S.begin(), S.end());
  std::string res(L, '0');
  for (int i = 0; i < (int) S.length(); i++) {
    int p = i < L ? i : std::uniform_int_distribution<>(0, L - 1)(engine);
    if (S[i] == '1') { res[p] ^= 1; }
  }
  return res;
}

std::string operator^(const std::string &A, const std::string &B) {
  assert(A.size() == B.size());
  std::string S(A.size(), '0');
  for (int i = 0; i < (int) A.size(); i++) {
    if (A[i] != B[i]) { S[i] = '1'; }
  }
  return S;
}

std::string Alice(std::vector<std::string> A) {
  std::string ret;
  for (const auto &v: A) { ret += Encode(v); }
  return ret;
}

std::string Bob(std::vector<std::string> B) {
  std::string ret;
  for (const auto &v: B) { ret += Encode(v); }
  return ret;
}

std::vector<std::pair<int, int>> Catherine(std::string a, std::string b,
                                           std::vector<std::string> C) {
  int N = (int) a.length() / L;
  std::map<std::string, int> sA, sB;
  std::vector<std::string> A(N), B(N);
  for (int i = 0; i < N; i++) {
    A[i] = a.substr(i * L, L);
    B[i] = b.substr(i * L, L);
    sA[A[i]] = 1, sB[B[i]] = 1;
  }

  std::mt19937 engine(133447);
  std::vector<std::pair<int, int>> ans;
  for (const auto &v: C) {
    auto S = Encode(v);
    std::vector<std::pair<int, int>> tmp;
    for (int i = 0; i < N; i++) {
      for (int j = 0; j < N; j++) {
        if ((A[i] ^ B[j]) == S) { tmp.emplace_back(i, j); }
      }
    }
    assert(!tmp.empty());
    int p = std::uniform_int_distribution<>(0, (int) tmp.size() - 1)(engine);
    ans.emplace_back(tmp[p]);
  }

  return ans;
}

int main() {
  std::string type;
  std::cin >> type;
  if (type == "Alice" || type == "Bob") {
    std::vector<std::string> A(100);
    for (auto &v: A) { std::cin >> v; }
    std::cout << Alice(A) << '\n';
  } else {
    std::string a, b;
    std::vector<std::string> C(100);
    std::cin >> a >> b;
    for (auto &v: C) { std::cin >> v; }
    auto ans = Catherine(a, b, C);
    for (auto v: ans) {
      std::cout << v.first + 1 << ' ' << v.second + 1 << '\n';
    }
  }
  return 0;
}
accuracy: 0.3939393939393939
time_ms: 140
memory_kb: 4352
final_rank: 18

code_snippet: #include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
mt19937 mrand(1); 
const ll mod=998244353;
int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// head

const int N=1010;
int n,p[N];
int f[50][1010];
char s[3010];
string info;

int a[110],b[110];

void gao(int *a) {
	rep(j,0,100) {
		int x=0;
		rep(c,0,30) x|=(s[j*30+c]-'0')<<c;
		a[j]=x;
	}
}

int main() {
	scanf("%s",s);
	rep(c,0,30) rep(j,0,1000) f[c][j]=rnd(2);
	if (s[0]=='A'||s[0]=='B') {
		rep(i,0,100) {
			scanf("%s",s);
			rep(j,0,1000) p[j]=s[j]-'0';
			rep(c,0,30) {
				int x=0;
				rep(j,0,1000) if (f[c][j]) x^=p[j];
				info.pb('0'+x);
			}
		}
		printf("%s\n",info.c_str());
		fflush(stdout);
	} else {
		scanf("%s",s);
		gao(a);
		scanf("%s",s);
		gao(b);
		rep(i,0,100) {
			scanf("%s",s);
			int msk=0;
			rep(j,0,1000) p[j]=s[j]-'0';
			rep(c,0,30) {
				int x=0;
				rep(j,0,1000) if (f[c][j]) x^=p[j];
				msk|=x<<c;
			}
			rep(x,0,100) rep(y,0,100) if ((a[x]^b[y])==msk) {
				printf("%d %d\n",x+1,y+1);
				goto end;
			}
			end:;
		}
	}
}
accuracy: 1
time_ms: 40
memory_kb: 3728
final_rank: 6

code_snippet: #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll (i) = 0; (i) < (n); (i)++)
#define rep1(i, n) for(ll (i) = 1; (i) <= (n); (i)++)
#define rrep(i, n) for(ll (i) = (n) - 1; (i) >= 0; (i)--)
#define rrep1(i, n) for(ll (i) = (n); (i) >= 1; (i)--)

struct XorShift128 {
    using u32 = uint32_t;
    u32 x = 123456789, y = 362436069, z = 521288629, w = 88675123;
    XorShift128 (u32 seed = 0) { z ^= seed; }
    u32 operator()() {
        u32 t = x ^ (x << 11);
        x = y; y = z; z = w;
        return w = (w ^ ( w >> 19)) ^ (t ^ (t >> 8));
    }
};

string ll_to_string(ll num, ll digit = 30){
    string s(digit, '0');
    rrep(i, digit){
        if(num % 2)s[i] = '1';
        num /= 2;
    }
    return s;
}
ll string_to_ll(string s, ll digit = 30){
    ll num = 0;
    rep(i, digit){
        num *= 2;
        if(s[i] == '1')num += 1;
    }
    return num;
}

ll rnd[100];

void Alice(){
    rep(i, 100){
        string s(1000, '0');
        cin >> s;
        cout << ll_to_string(string_to_ll(s.substr(0, 30)) ^ rnd[i]);
    }
    cout << flush;
}

void Charlie(){
    ll A[100] = {}, B[100] = {};
    string s;
    cin >> s;
    for(ll i = 0; i < 3000; i += 30){
        A[i / 30] = (string_to_ll(s.substr(i, i + 30)) ^ rnd[i / 30]);
    }
    cin >> s;
    for(ll i = 0; i < 3000; i += 30){
        B[i / 30] = (string_to_ll(s.substr(i, i + 30)) ^ rnd[i / 30]);
    }
    rep(i, 100){
        string s;
        cin >> s;
        ll c = string_to_ll(s.substr(0, 30));
        ll X = 0, Y = 0;
        rep(x, 100)rep(y, 100)if((A[x] ^ B[y]) == c){
            X = x;
            Y = y;
        }
        cout << X + 1 << " " << Y + 1 << endl;
    }
    cout << flush;
}

int main(){
    
    XorShift128 xs;
    rep(i, 100)rnd[i] = (xs() & ((1 << 30) - 1));

    string s;
    cin >> s;
    if(s == "Charlie")Charlie();
    else Alice();

    return 0;
}
accuracy: 0.3939393939393939
time_ms: 20
memory_kb: 3752
final_rank: 10

code_snippet: #include <bits/stdc++.h>
#include <sys/types.h>
#include <unistd.h>

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
#define popcount(n) (__builtin_popcountll(n))

using namespace std;

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

using ll=long long;
using R=long double;
const R EPS=1e-9L; // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7
inline int sgn(const R& r){return(r > EPS)-(r < -EPS);}
inline R sq(R x){return sqrt(max(x,0.0L));}

template<typename T> vector<T> make_vector(size_t sz){
	return vector<T>(sz);
}

template<typename T,typename... Ts> 
auto make_vector(size_t sz, Ts... ts){
	return vector<decltype(make_vector<T>(ts...))>(sz, make_vector<T>(ts...));
}

template<typename T,typename U,typename... V> 
typename enable_if<is_same<T, U>::value!=0>::type 
fill_value(U &u, const V... v){
	u=U(v...);
}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value==0>::type
fill_value(U &u, const V... v){
	for(auto &e:u){
		fill_value<T>(e,v...);
	}
}


mt19937 engine(0);
uniform_int_distribution<> dist(0, 1);      


const int len = 1000;
const int hash_len = 30;
using BO = bitset<len>;
using BH = bitset<hash_len>;

vector<BO> base_vec;

void init(int m){
	rep(i, m) {
		BO tmp;
		rep(j, len) tmp[j] = dist(engine);
		base_vec.push_back(tmp);
	}
}


BH get_hash(BO bst) {
	BH ret;
	rep(i, hash_len) {
		BO tmp = bst & base_vec[i]; 
		ret[i] = tmp.count() & 1;
	}
	return ret;
}



void alice_bob_process(int n) {
	init(hash_len);

	string ret = "";

	rep(i, n){
		string tmp;
		cin >> tmp;
		BO bit_orignal  = BO(tmp);
		BH bit_hash = get_hash(bit_orignal);
		ret += bit_hash.to_string();
	}

	cout << ret << endl << flush;
}

void charlie_process(int n) {
	init(hash_len);
	string x, y;
	cin >> x >> y;

	vector<BH> xary, yary;
	rep(i, n) {
		xary.push_back(BH(x.substr(hash_len * i, hash_len)));
		yary.push_back(BH(y.substr(hash_len * i, hash_len)));		
	}

	rep(i, n) {
		string c;
		cin >> c;
		BO bit_orignal  = BO(c);
		BH bit_hash = get_hash(bit_orignal);

		rep(j, n) rep(k, n) {
			BH tmp = xary[j] ^ yary[k];
			if(tmp == bit_hash) {
				cout << j + 1 << " " << k + 1 << endl;
				j = n, k = n;
			}
		}
	}

	cout << flush;
}

int main(void){
	string who;
	cin >> who;
	if(who == "Alice" or who == "Bob") {
		alice_bob_process(100);
	} else {
		charlie_process(100);
	}
	return 0;
}
accuracy: 1
time_ms: 20
memory_kb: 3752
final_rank: 5

code_snippet: #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll (i) = 0; (i) < (n); (i)++)
#define rep1(i, n) for(ll (i) = 1; (i) <= (n); (i)++)
#define rrep(i, n) for(ll (i) = (n) - 1; (i) >= 0; (i)--)
#define rrep1(i, n) for(ll (i) = (n); (i) >= 1; (i)--)

struct XorShift128 {
    using u32 = uint32_t;
    u32 x = 123456789, y = 362436069, z = 521288629, w = 88675123;
    XorShift128 (u32 seed = 0) { z ^= seed; }
    u32 operator()() {
        u32 t = x ^ (x << 11);
        x = y; y = z; z = w;
        return w = (w ^ ( w >> 19)) ^ (t ^ (t >> 8));
    }
};

string ll_to_string(ll num, ll digit = 30){
    string s(digit, '0');
    rrep(i, digit){
        if(num % 2)s[i] = '1';
        num /= 2;
    }
    return s;
}
ll string_to_ll(string s, ll digit = 30){
    ll num = 0;
    rep(i, digit){
        num *= 2;
        if(s[i] == '1')num += 1;
    }
    return num;
}

ll rnd[100];

void Alice(){
    rep(i, 100){
        string s(1000, '0');
        cin >> s;
        cout << ll_to_string(string_to_ll(s.substr(0, 30)) ^ rnd[i]);
    }
    cout << flush;
}

void Charlie(){
    ll A[100] = {}, B[100] = {};
    string s;
    cin >> s;
    for(ll i = 0; i < 3000; i += 30){
        A[i / 30] = string_to_ll(s.substr(i, i + 30));
    }
    cin >> s;
    for(ll i = 0; i < 3000; i += 30){
        B[i / 30] = string_to_ll(s.substr(i, i + 30));
    }
    rep(i, 100){
        string s;
        cin >> s;
        ll c = string_to_ll(s.substr(0, 30));
        ll X = 0, Y = 0;
        rep(x, 100)rep(y, 100)if((A[x] ^ B[y]) == c){
            X = x;
            Y = y;
        }
        cout << X + 1 << " " << Y + 1 << endl;
    }
    cout << flush;
}

int main(){
    
    XorShift128 xs;
    // rep(i, 100)rnd[i] = (xs() & ((1 << 30) - 1));

    string s;
    cin >> s;
    if(s == "Charlie")Charlie();
    else Alice();

    return 0;
}
accuracy: 0.3939393939393939
time_ms: 20
memory_kb: 3752
final_rank: 10

code_snippet: #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef vector<ll> V;
#define rep(i, n) for(ll (i) = 0; (i) < (n); (i)++)
struct XorShift128 {
    using u32 = uint32_t;
    u32 x = 123456789, y = 362436069, z = 521288629, w = 88675123;
    XorShift128 (u32 seed = 0) { z ^= seed; }
    u32 operator()() {
        u32 t = x ^ (x << 11);
        x = y; y = z; z = w;
        return w = (w ^ ( w >> 19)) ^ (t ^ (t >> 8));
    }
};

ll mp[100][30];

void Alice(){
    rep(i, 100){
        string s(1000, '0');
        cin >> s;
        rep(j, 30)cout << (ll)(mp[i][j] ^ (s[j] - '0'));
    }
    cout << flush;
}
void Charlie(){
    ll A[100] = {}, B[100] = {};
    rep(i, 100){
        rep(j, 30){
            char c = '0';
            cin >> c;
            if(c == '1')A[i] |= (1 << j);
        }
    }
    rep(i, 100){
        rep(j, 30){
            char c;
            cin >> c;
            if(c == '1')B[i] |= (1 << j);
        }
    }
    rep(i, 100){
        string s;
        cin >> s;
        ll c = 0;
        rep(j, 30)if(s[j] == '1')c |= (1 << j);
        ll X = 0, Y = 0;
        rep(x, 100)rep(y, 100)if((A[x] ^ B[y]) == c){
            X = x;
            Y = y;
        }
        cout << X + 1 << " " << Y + 1 << endl;
    }
    cout << flush;
}

int main(){
    XorShift128 xs;
    // rep(i, 100)rep(j, 30)mp[i][j] = xs() % 2;
    string s;
    cin >> s;
    if(s == "Charlie")Charlie();
    else Alice();

    return 0;
}
accuracy: 0.3939393939393939
time_ms: 20
memory_kb: 3752
final_rank: 10

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

#define lfs cout<<fixed<<setprecision(10)
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define spa << " " <<
#define fi first
#define se second
#define MP make_pair
#define MT make_tuple
#define PB push_back
#define EB emplace_back
#define rep(i,n,m) for(ll i = (n); i < (ll)(m); i++)
#define rrep(i,n,m) for(ll i = (m) - 1; i >= (ll)(n); i--)
using ll = long long;
using ld = long double;
const ll MOD1 = 1e9+7;
const ll MOD9 = 998244353;
const ll INF = 1e18;
using P = pair<ll, ll>;
template<typename T>
bool chmin(T &a,T b){if(a>b){a=b;return true;}else return false;}
template<typename T>
bool chmax(T &a,T b){if(a<b){a=b;return true;}else return false;}
ll median(ll a,ll b, ll c){return a+b+c-max({a,b,c})-min({a,b,c});}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
template<typename T1,typename T2>
void ans(bool x,T1 y,T2 z){if(x)cout<<y<<endl;else cout<<z<<endl;}  
template<typename T>
void debug(vector<vector<T>>&v,ll h,ll w){for(ll i=0;i<h;i++)
{cout<<v[i][0];for(ll j=1;j<w;j++)cout spa v[i][j];cout<<endl;}};
void debug(vector<string>&v,ll h,ll w){for(ll i=0;i<h;i++)
{for(ll j=0;j<w;j++)cout<<v[i][j];cout<<endl;}};
template<typename T>
void debug(vector<T>&v,ll n){if(n!=0)cout<<v[0];
for(ll i=1;i<n;i++)cout spa v[i];cout<<endl;};
template<typename T>
vector<vector<T>>vec(ll x, ll y, T w){
  vector<vector<T>>v(x,vector<T>(y,w));return v;}
ll gcd(ll x,ll y){ll r;while(y!=0&&(r=x%y)!=0){x=y;y=r;}return y==0?x:y;}
vector<ll>dx={1,0,-1,0,1,1,-1,-1};
vector<ll>dy={0,1,0,-1,1,-1,1,-1};
template<typename T>
vector<T> make_v(size_t a,T b){return vector<T>(a,b);}
template<typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v(ts...))>(a,make_v(ts...));
}
template<typename T1, typename T2>
ostream &operator<<(ostream &os, pair<T1, T2>&p){
  return os << p.first << " " << p.second;
}  

string convert(ll n,ll bit){
  string ret(bit,'0');
  for(ll i=0;i<bit;i++)if(n&1LL<<bit-1-i)ret[i]='1';
  return ret;
}
ll convert(string s){
  ll ret=0;
  ll n=s.size();
  for(ll i=0;i<n;i++)if(s[i]=='1')ret|=1<<n-i-1;
  return ret;
}

int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  ll res=0,buf=0;
  bool judge = true;
  vector<ll>hash;
  const ll mod=998244353;
  ll k=100000;
  //const ll num=2,len=3;
  const ll num=100,len=1000;
  vector<ll>v(len,k);
  rep(i,0,len-1)v[i+1]=v[i]*k%mod;
  string s;cin>>s;
  if(s=="Alice"||s=="Bob"){
    vector<string>a(num);
    rep(i,0,num)cin>>a[i];
    vector<ll>h(num);
    string ret;
    rep(i,0,num){
      rep(j,0,len)if(a[i][j]=='1')h[i]^=v[j];
      ret+=convert(h[i],30);
    }
    cout<<ret<<endl;
  }
  else{
    string s,t;cin>>s>>t;
    vector<ll>a(num),b(num);
    rep(i,0,num)a[i]=convert(s.substr(i*30,30));
    rep(i,0,num)b[i]=convert(t.substr(i*30,30));
    rep(i,0,num){
      string input;cin>>input;
      ll c=0;
      rep(j,0,len)if(input[j]=='1')c^=v[j];
      rep(j,0,num){
        bool sw=false;
        rep(o,0,num){
          if((a[j]^b[o]^c)==0){
          cout<<j+1 spa o+1<<endl;
          sw=true;
          break;
          }
        }
        if(sw)break;
      }
    }
  }
  return 0;
}
accuracy: 1
time_ms: 10
memory_kb: 3752
final_rank: 3

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

#define endl '\n'
#define lfs cout<<fixed<<setprecision(10)
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define spa << " " <<
#define fi first
#define se second
#define MP make_pair
#define MT make_tuple
#define PB push_back
#define EB emplace_back
#define rep(i,n,m) for(ll i = (n); i < (ll)(m); i++)
#define rrep(i,n,m) for(ll i = (m) - 1; i >= (ll)(n); i--)
using ll = long long;
using ld = long double;
const ll MOD1 = 1e9+7;
const ll MOD9 = 998244353;
const ll INF = 1e18;
using P = pair<ll, ll>;
template<typename T>
bool chmin(T &a,T b){if(a>b){a=b;return true;}else return false;}
template<typename T>
bool chmax(T &a,T b){if(a<b){a=b;return true;}else return false;}
ll median(ll a,ll b, ll c){return a+b+c-max({a,b,c})-min({a,b,c});}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
template<typename T1,typename T2>
void ans(bool x,T1 y,T2 z){if(x)cout<<y<<endl;else cout<<z<<endl;}  
template<typename T>
void debug(vector<vector<T>>&v,ll h,ll w){for(ll i=0;i<h;i++)
{cout<<v[i][0];for(ll j=1;j<w;j++)cout spa v[i][j];cout<<endl;}};
void debug(vector<string>&v,ll h,ll w){for(ll i=0;i<h;i++)
{for(ll j=0;j<w;j++)cout<<v[i][j];cout<<endl;}};
template<typename T>
void debug(vector<T>&v,ll n){if(n!=0)cout<<v[0];
for(ll i=1;i<n;i++)cout spa v[i];cout<<endl;};
template<typename T>
vector<vector<T>>vec(ll x, ll y, T w){
  vector<vector<T>>v(x,vector<T>(y,w));return v;}
ll gcd(ll x,ll y){ll r;while(y!=0&&(r=x%y)!=0){x=y;y=r;}return y==0?x:y;}
vector<ll>dx={1,0,-1,0,1,1,-1,-1};
vector<ll>dy={0,1,0,-1,1,-1,1,-1};
template<typename T>
vector<T> make_v(size_t a,T b){return vector<T>(a,b);}
template<typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v(ts...))>(a,make_v(ts...));
}
template<typename T1, typename T2>
ostream &operator<<(ostream &os, pair<T1, T2>&p){
  return os << p.first << " " << p.second;
}  
int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  ll res=0,buf=0;
  bool judge = true;
  vector<ll>hash;
  const ll mod=998244353;
  ll k=100000;
  const ll num=100,len=1000;
  //const ll num=100,len=1000;
  vector<ll>v(len,k);
  rep(i,0,len-1)v[i+1]=v[i]*k%mod;
  string s;cin>>s;
  if(s=="Alice"||s=="Bob"){
    vector<string>a(num);
    rep(i,0,num)cin>>a[i];
    vector<ll>h(num);
    string ret;
    rep(i,0,num){
      rep(j,0,len)if(a[i][j]=='1')h[i]^=v[j];
      string s(30,'0');
      rep(j,0,30){
        s[j]=(h[i]&1)+'0';
        h[i]>>=1;
      }
      ret+=s;
    }
    cout<<ret<<endl;
  }
  else{
    string s,t;cin>>s>>t;
    vector<ll>a(num),b(num);
    rep(i,0,num){
      bitset<30>k;
      rep(j,0,30)if(s[i*30+j]=='1')k[j]=1;
      a[i]=k.to_ullong();
    }
    rep(i,0,num){
      bitset<30>k;
      rep(j,0,30)if(t[i*30+j]=='1')k[j]=1;
      b[i]=k.to_ullong();
    }
    //cout<<s spa t<<endl;
    //debug(a,num);debug(b,num);
    rep(i,0,num){
      string input;cin>>input;
      ll c=0;
      rep(j,0,len)if(input[j]=='1')c^=v[j];
      //cout<<c<<endl;
      rep(j,0,num){
        bool sw=false;
        rep(o,0,num){
          if((a[j]^b[o]^c)==0){
          cout<<j+1 spa o+1<<endl;
          sw=true;
          break;
          }
        }
        if(sw)break;
      }
    }
  }
  return 0;
}
accuracy: 1
time_ms: 10
memory_kb: 3740
final_rank: 2

code_snippet: //
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef vector<ll> V;
#define rep(i, n) for(ll (i) = 0; (i) < (n); (i)++)
#define rep1(i, n) for(ll (i) = 1; (i) <= (n); (i)++)

V prime;
void init(){
    V v;
    for(ll i = 2; i <= 1000; i++){
        ll f = 1;
        for(ll j = 2; j * j <= i; j++)if(i % j == 0)f = 0;
        if(f)v.push_back(i);
    }
    rep(i, 30)prime.push_back(34 * i + 5);
}

ll A[110];
ll B[110];
void Alice(){
    rep1(i, 100){
        string s;
        cin >> s;
        rep(j, 30){
            if(s[prime[j]] == '1')cout << 1;
            else cout << 0;
        }    
    }
    cout << flush;
}
void Bob(){
    rep1(i, 100){
        string s;
        cin >> s;
        rep(j, 30){
            if(s[prime[j]] == '1')cout << 1;
            else cout << 0;
        }    
    }
    cout << flush;
}

void solve(ll c, ll &x, ll &y){
    x = 1;
    y = 1;
    rep1(i, 100)rep1(j, 100)if((A[i] ^ B[j]) == c){
        x = i;
        y = j;
    }
}

void Charlie(){
    rep1(i, 100){
        for(ll j = 0, k = 1; j < 30; j++, k += k){
            char c;
            cin >> c;
            if(c == '1')A[i] |= k;
        }
    }
    rep1(i, 100){
        for(ll j = 0, k = 1; j < 30; j++, k += k){
            char c;
            cin >> c;
            if(c == '1')B[i] |= k;
        }
    }
    rep1(i, 100){
        string s;
        cin >> s;
        ll c = 0;
        for(ll j = 0, k = 1; j < 30; j++, k += k){
            if(s[prime[j]] == '1')c |= k;
        }
        ll x, y;
        solve(c, x, y);
        cout << x << " " << y << endl;
    }
    cout << flush;
}

int main(){
    init();
    string s;
    cin >> s;
    if(s == "Alice")Alice();
    if(s == "Bob")Bob();
    if(s == "Charlie")Charlie();

    return 0;
}
accuracy: 0.3939393939393939
time_ms: 20
memory_kb: 3752
final_rank: 10

code_snippet: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using uint = unsigned int;
using pcc = pair<char, char>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;
using tuplis = array<ll, 3>;
template<class T> using pq = priority_queue<T, vector<T>, greater<T>>;
const ll LINF=0x1fffffffffffffff;
const ll MINF=0x7fffffffffff;
const int INF=0x3fffffff;
const int MOD=1000000007;
const int MODD=998244353;
const ld DINF=numeric_limits<ld>::infinity();
const ld EPS=1e-9;
const ld PI=3.1415926535897932;
const ll dx[] = {0, 1, 0, -1, 1, 1, -1, -1};
const ll dy[] = {1, 0, -1, 0, 1, -1, 1, -1};
#define overload4(_1,_2,_3,_4,name,...) name
#define overload3(_1,_2,_3,name,...) name
#define rep1(n) for(ll i=0;i<n;++i)
#define rep2(i,n) for(ll i=0;i<n;++i)
#define rep3(i,a,b) for(ll i=a;i<b;++i)
#define rep4(i,a,b,c) for(ll i=a;i<b;i+=c)
#define rep(...) overload4(__VA_ARGS__,rep4,rep3,rep2,rep1)(__VA_ARGS__)
#define rrep1(n) for(ll i=(n)-1;i>=0;i--)
#define rrep2(i,n) for(ll i=(n)-1;i>=0;i--)
#define rrep3(i,a,b) for(ll i=(b)-1;i>=(a);i--)
#define rrep4(i,a,b,c) for(ll i=a+(b-a-1)/c*c;i>=a;i-=c)
#define rrep(...) overload4(__VA_ARGS__,rrep4,rrep3,rrep2,rrep1)(__VA_ARGS__)
#define each(i,...) for(auto&& i:__VA_ARGS__)
#define all1(i) begin(i),end(i)
#define all2(i,a) begin(i),begin(i)+a
#define all3(i,a,b) begin(i)+a,begin(i)+b
#define all(...) overload3(__VA_ARGS__,all3,all2,all1)(__VA_ARGS__)
#define rall1(i) (i).rbegin(),(i).rend()
#define rall2(i,k) (i).rbegin(),(i).rbegin()+k
#define rall3(i,a,b) (i).rbegin()+a,(i).rbegin()+b
#define rall(...) overload3(__VA_ARGS__,rall3,rall2,rall1)(__VA_ARGS__)
#define sum(...) accumulate(all(__VA_ARGS__),0LL)
#define dsum(...) accumulate(all(__VA_ARGS__),0.0L)
#define elif else if
#define unless(a) if(!(a))
#define mp make_pair
#define mt make_tuple
#define INT(...) int __VA_ARGS__;in(__VA_ARGS__)
#define LL(...) ll __VA_ARGS__;in(__VA_ARGS__)
#define ULL(...) ull __VA_ARGS__;in(__VA_ARGS__)
#define STR(...) string __VA_ARGS__;in(__VA_ARGS__)
#define CHR(...) char __VA_ARGS__;in(__VA_ARGS__)
#define DBL(...) double __VA_ARGS__;in(__VA_ARGS__)
#define LD(...) ld __VA_ARGS__;in(__VA_ARGS__)
#define Sort(a) sort(all(a))
#define Rev(a) reverse(all(a))
#define Uniq(a) sort(all(a));a.erase(unique(all(a)),end(a))
#define vec(type,name,...) vector<type> name(__VA_ARGS__)
#define VEC(type,name,size) vector<type> name(size);in(name)
#define vv(type,name,h,...) vector<vector<type>>name(h,vector<type>(__VA_ARGS__))
#define VV(type,name,h,w) vector<vector<type>>name(h,vector<type>(w));in(name)
#define vvv(type,name,h,w,...) vector<vector<vector<type>>>name(h,vector<vector<type>>(w,vector<type>(__VA_ARGS__)))
template<class T> auto max(const T& a){ return *max_element(all(a)); }
template<class T> auto min(const T& a){ return *min_element(all(a)); }
ll gcd(ll a, ll b){ while(b){ ll c = b; b = a % b; a = c; } return a; }
ll lcm(ll a, ll b){ if(!a || !b) return 0; return a * b / gcd(a, b); }
ll intpow(ll a, ll b){ ll ans = 1; while(b){ if(b & 1) ans *= a; a *= a; b /= 2; } return ans; }
ll modpow(ll a, ll b, ll p){ ll ans = 1; while(b){ if(b & 1) (ans *= a) %= p; (a *= a) %= p; b /= 2; } return ans; }
template<class T, class U> bool chmin(T& a, const U& b){ if(a > b){ a = b; return 1; } return 0; }
template<class T, class U> bool chmax(T& a, const U& b){ if(a < b){ a = b; return 1; } return 0; }
vector<pll> factor(ull x){ vector<pll> ans; for(ll i = 2; i * i <= x; i++) if(x % i == 0){ ans.push_back({i, 1}); while((x /= i) % i == 0) ans.back().second++; } if(x != 1) ans.push_back({x, 1}); return ans; }
vector<ll> divisor(ull x){ vector<ll> ans; for(ll i = 1; i * i <= x; i++) if(x % i == 0) ans.push_back(i); rrep(ans.size() - (ans.back() * ans.back() == x)) ans.push_back(x / ans[i]); return ans; }
template<class T> unordered_map<T, ll> press(vector<T>& a){ auto b = a; sort(all(b)); b.erase(unique(all(b)), b.end()); unordered_map<T,ll> ans; rep(b.size()) ans[b[i]] = i; each(i, a) i = ans[i]; return ans; }
template<class T> map<T, ll> press_map(vector<T>& a){ auto b = a; sort(all(b)); b.erase(unique(all(b)), b.end()); map<T,ll> ans; rep(b.size()) ans[b[i]] = i; each(i, a) i = ans[i]; return ans; }
int scan(){ return getchar(); }
void scan(int& a){ scanf("%d", &a); }
void scan(unsigned& a){ scanf("%u", &a); }
void scan(long& a){ scanf("%ld", &a); }
void scan(long long& a){ scanf("%lld", &a); }
void scan(unsigned long long& a){ scanf("%llu", &a); }
void scan(char& a){ do{ a = getchar(); }while(a == ' ' || a == '\n'); }
void scan(float& a){ scanf("%f", &a); }
void scan(double& a){ scanf("%lf", &a); }
void scan(long double& a){ scanf("%Lf", &a); }
void scan(vector<bool>& a){ for(unsigned i = 0; i < a.size(); i++){ int b; scan(b); a[i] = b; } }
void scan(char a[]){ scanf("%s", a); }
void scan(string& a){ cin >> a; }
template<class T> void scan(vector<T>&);
template<class T, size_t size> void scan(array<T, size>&);
template<class T, class L> void scan(pair<T, L>&);
template<class T, size_t size> void scan(T(&)[size]);
template<class T> void scan(vector<T>& a){ for(auto&& i : a) scan(i); }
template<class T> void scan(deque<T>& a){ for(auto&& i : a) scan(i); }
template<class T, size_t size> void scan(array<T, size>& a){ for(auto&& i : a) scan(i); }
template<class T, class L> void scan(pair<T, L>& p){ scan(p.first); scan(p.second); }
template<class T, size_t size> void scan(T (&a)[size]){ for(auto&& i : a) scan(i); }
template<class T> void scan(T& a){ cin >> a; }
void in(){}
template <class Head, class... Tail> void in(Head& head, Tail&... tail){ scan(head); in(tail...); }
void print(){ putchar(' '); }
void print(bool a){ printf("%d", a); }
void print(int a){ printf("%d", a); }
void print(unsigned a){ printf("%u", a); }
void print(long a){ printf("%ld", a); }
void print(long long a){ printf("%lld", a); }
void print(unsigned long long a){ printf("%llu", a); }
void print(char a){ printf("%c", a); }
void print(char a[]){ printf("%s", a); }
void print(const char a[]){ printf("%s", a); }
void print(float a){ printf("%.15f", a); }
void print(double a){ printf("%.15f", a); }
void print(long double a){ printf("%.15Lf", a); }
void print(const string& a){ for(auto&& i : a) print(i); }
template<class T> void print(const vector<T>&);
template<class T, size_t size> void print(const array<T, size>&);
template<class T, class L> void print(const pair<T, L>& p);
template<class T, size_t size> void print(const T (&)[size]);
template<class T> void print(const vector<T>& a){ if(a.empty()) return; print(a[0]); for(auto i = a.begin(); ++i != a.end(); ){ putchar(' '); print(*i); } }
template<class T> void print(const deque<T>& a){ if(a.empty()) return; print(a[0]); for(auto i = a.begin(); ++i != a.end(); ){ putchar(' '); print(*i); } }
template<class T, size_t size> void print(const array<T, size>& a){ print(a[0]); for(auto i = a.begin(); ++i != a.end(); ){ putchar(' '); print(*i); } }
template<class T, class L> void print(const pair<T, L>& p){ print(p.first); putchar(' '); print(p.second); }
template<class T, size_t size> void print(const T (&a)[size]){ print(a[0]); for(auto i = a; ++i != end(a); ){ putchar(' '); print(*i); } }
template<class T> void print(const T& a){ cout << a; }
int out(){ putchar('\n'); return 0; }
template<class T> int out(const T& t){ print(t); putchar('\n'); return 0; }
template<class Head, class... Tail> int out(const Head& head, const Tail&... tail){ print(head); putchar(' '); out(tail...); return 0; }
#ifdef DEBUG
void err(){ putchar('\n'); }
template<class T> void err(const T& t){ print(t); putchar('\n'); }
template<class Head, class... Tail> void err(const Head& head, const Tail&... tail){ print(head); putchar(' '); out(tail...); }
#else
template<class... T> void err(const T&...){}
#endif
int first(bool i = true){ return out(i?"first":"second"); }
int yes(bool i = true){ return out(i?"yes":"no"); }
int Yes(bool i = true){ return out(i?"Yes":"No"); }
int No(){ return out("No"); }
int YES(bool i = true){ return out(i?"YES":"NO"); }
int NO(){ return out("NO"); }
int Yay(bool i = true){ return out(i?"Yay!":":("); }
int possible(bool i = true){ return out(i?"possible":"impossible"); }
int Possible(bool i = true){ return out(i?"Possible":"Impossible"); }
int POSSIBLE(bool i = true){ return out(i?"POSSIBLE":"IMPOSSIBLE"); }
void Case(ll i){ printf("Case #%lld: ", i); }


mt19937 RD(58);
uint32_t xor128() {
  static uint32_t x = RD();
  static uint32_t y = RD();
  static uint32_t z = RD();
  static uint32_t w = RD();
  uint32_t t;
  t = x ^ (x << 11);
  x = y; y = z; z = w;
  return w = (w ^ (w >> 19)) ^ (t ^ (t >> 8));
}
struct Xorshift64{
    using result_type = uint32_t;
    static constexpr result_type min(){ return 0; }
    static constexpr result_type max(){ return -1; }
    uint64_t x = RD();
    result_type operator()(){
        x = x ^ (x << 13);
        x = x ^ (x >> 7);
        x = x ^ (x << 17);
        return static_cast<uint32_t>(x);
    }
}rnd;
signed main(){
    bitset<1000>bit[30];
    each(i,bit)rep(_,32){
        i<<=32;
        i^=xor128();
    }
    STR(s);
    if(s=="Charlie"){
        STR(x);
        STR(y);
        bitset<30>a[100],b[100];
        rep(100)a[i]=bitset<30>(x.substr(i*30,30));
        rep(100)b[i]=bitset<30>(y.substr(i*30,30));
        vector<ll>sa(100),sb(100);
        iota(all(sa),0);
        iota(all(sb),0);
        rep(100){
            shuffle(all(sa),rnd);
            shuffle(all(sb),rnd);
            STR(s);
            bitset<1000>_c(s);
            bitset<30>c;
            each(i,bit){
                c<<=1;
                c|=(i&_c).count()&1;
            }
            each(i,sa)each(j,sb)if((a[i]^b[j])==c){
                out(i+1,j+1);
                goto br;
            }
        br:;
        }
    }
    else{
        rep(100){
            STR(s);
            bitset<1000>a(s);
            each(i,bit)print((i&a).count()&1);
        }
        out();
    }
    fflush(stdout);
}
accuracy: 1
time_ms: 20
memory_kb: 3748
final_rank: 4

code_snippet: #include <iostream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <cassert>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <string>
#include <algorithm>
#define llint long long
#define inf 1e18
#define mod 998244353
#define rep(x, s, t) for(llint (x) = (s); (x) < (t); (x)++)
#define Rep(x, s, t) for(llint (x) = (s); (x) <= (t); (x)++)

using namespace std;
typedef pair<llint, llint> P;

string s, t;
string a[105];
llint beki[1005];
string ans;

string x, y;
vector<llint> vec, vec2;

llint gethash(string &s)
{
	llint hash = 0;
	for(int j = 0; j < 1000; j++){
		if(s[j] == '1') hash ^= beki[j];
	}
	return hash;
}

void get(string &s, vector<llint> &vec)
{
	for(int i = 0; i < 100; i++){
		llint h = 0;
		for(int j = 0; j < 30; j++){
			llint c = s[i*30+j]-'0';
			h |= c<<j;
		}
		vec.push_back(h);
	}
}

int main(void)
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	beki[0] = 1;
	for(int i = 1; i < 1005; i++) beki[i] = beki[i-1] * 2 % mod;
	
	cin >> s;
	if(s == "Alice" || s == "Bob"){
		for(int i = 1; i <= 100; i++) cin >> a[i];
		
		for(int i = 1; i <= 100; i++){
			llint hash = gethash(a[i]);
			for(int j = 0; j < 30; j++){
				ans += (char)(((hash >> j)&1) + '0');
			}
		}
		cout << ans << endl;
		return 0;
	}
	else{
		cin >> x >> y;
		get(x, vec), get(y, vec2);
		
		for(int i = 1; i <= 100; i++){
		cin >> t;
			
			llint hash = gethash(t);
			for(int j = 0; j < vec.size(); j++){
				for(int k = 0; k < vec2.size(); k++){
					if((vec[j]^vec2[k]^hash) == 0){
						cout << j+1 << " " << k+1 << endl;
						goto end;
					}
				}
			}
			end:;
		}
	}
	
	return 0;
}
accuracy: 1
time_ms: 10
memory_kb: 3728
final_rank: 1

code_snippet: #include <iostream>
#include <queue>
#include <vector>
#include <algorithm>
#include <set>
#include <cmath>
#include <tuple>
#include <cstring>
#include <map>
#include <iomanip>
#include <ctime>
#include <complex>
#include <cassert>
#include <climits>
#include <bitset>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define _ << " " <<
#define all(X) (X).begin(), (X).end()
#define len(X) (X).size()
#define Pii pair<int, int>
#define Pll pair<ll, ll>
#define Tiii tuple<int, int, int>
#define Tlll tuple<ll, ll, ll>
#define PI 3.14159265358979324

int main() {
    
    string s;
    cin >> s;
    vector<int> pic = {20,54,57,73,84,85,105,107,111,121,132,143,148,174,188,189,234,246,389,465,506,562,593,605,624,727,758,764,923,973};
    if (s[0] == 'C') {
        string x, y;
        cin >> x >> y;
        //vector<int> pic = {28,80,95,112,118,169,185,206,252,255,264,303,307,346,347,369,390,393,473,506,524,558,603,608,616,621,623,678,748,909};

        int t = 100;
        while (t--) {
            string c;  cin >> c;
            for (int i = 0; i < 100; i++) {
                bool ok = 0;
                string a = x.substr(30*i, 30);
                string b;
                for (int j = 0; j < 30; j++) {
                    b += char((c[pic[j]] ^ a[j]) + '0');
                }
                for (int j = 0; j < 100; j++) {
                    if (b == y.substr(30*j, 30)) {
                        cout << i + 1 _ j + 1 << endl;
                        ok = 1;
                        break;
                    }
                }
                if (ok) break;
            }
        }

    }
    else {
        string a[100];
        for (int i = 0; i < 100; i++) cin >> a[i];
        //vector<int> pic = {28,80,95,112,118,169,185,206,252,255,264,303,307,346,347,369,390,393,473,506,524,558,603,608,616,621,623,678,748,909};
        string x;
        for (int j = 0; j < 100; j++) {
            for (int i = 0; i < 30; i++) {
                x += a[j][pic[i]];
            }
        }
        cout << x << endl;
    }
    
    //cerr << char(('0' ^ '1') + '0');
}
accuracy: 0.3939393939393939
time_ms: 40
memory_kb: 3752
final_rank: 15

code_snippet: #include <iostream>
#include <queue>
#include <vector>
#include <algorithm>
#include <set>
#include <cmath>
#include <tuple>
#include <cstring>
#include <map>
#include <iomanip>
#include <ctime>
#include <complex>
#include <cassert>
#include <climits>
#include <bitset>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define _ << " " <<
#define all(X) (X).begin(), (X).end()
#define len(X) (X).size()
#define Pii pair<int, int>
#define Pll pair<ll, ll>
#define Tiii tuple<int, int, int>
#define Tlll tuple<ll, ll, ll>
#define PI 3.14159265358979324

int main() {
    
    string s;
    cin >> s;
    vector<int> pic = {1,72,137,141,143,151,167,168,209,231,233,317,326,398,418,434,524,530,569,570,578,582,608,776,807,844,859,865,916,937};
    if (s[0] == 'C') {
        string x, y;
        cin >> x >> y;
        //vector<int> pic = {28,80,95,112,118,169,185,206,252,255,264,303,307,346,347,369,390,393,473,506,524,558,603,608,616,621,623,678,748,909};

        int t = 100;
        while (t--) {
            string c;  cin >> c;
            for (int i = 0; i < 100; i++) {
                bool ok = 0;
                string a = x.substr(30*i, 30);
                string b;
                for (int j = 0; j < 30; j++) {
                    b += char((c[pic[j]] ^ a[j]) + '0');
                }
                for (int j = 0; j < 100; j++) {
                    if (b == y.substr(30*j, 30)) {
                        cout << i + 1 _ j + 1 << endl;
                        ok = 1;
                        break;
                    }
                }
                if (ok) break;
            }
        }

    }
    else {
        string a[100];
        for (int i = 0; i < 100; i++) cin >> a[i];
        //vector<int> pic = {28,80,95,112,118,169,185,206,252,255,264,303,307,346,347,369,390,393,473,506,524,558,603,608,616,621,623,678,748,909};
        string x;
        for (int j = 0; j < 100; j++) {
            for (int i = 0; i < 30; i++) {
                x += a[j][pic[i]];
            }
        }
        cout << x << endl;
    }
    
    //cerr << char(('0' ^ '1') + '0');
}
accuracy: 0.2727272727272727
time_ms: 40
memory_kb: 3740
final_rank: 20

code_snippet: #include <iostream>
#include <queue>
#include <vector>
#include <algorithm>
#include <set>
#include <cmath>
#include <tuple>
#include <cstring>
#include <map>
#include <iomanip>
#include <ctime>
#include <complex>
#include <cassert>
#include <climits>
#include <bitset>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define _ << " " <<
#define all(X) (X).begin(), (X).end()
#define len(X) (X).size()
#define Pii pair<int, int>
#define Pll pair<ll, ll>
#define Tiii tuple<int, int, int>
#define Tlll tuple<ll, ll, ll>
#define PI 3.14159265358979324

int main() {
    
    string s;
    cin >> s;
    vector<int> pic = {88,124,180,188,219,251,252,268,320,480,544,548,566,568,571,605,614,621,703,709,711,738,805,884,903,939,959,996,997,999};
    if (s[0] == 'C') {
        string x, y;
        cin >> x >> y;
        //vector<int> pic = {28,80,95,112,118,169,185,206,252,255,264,303,307,346,347,369,390,393,473,506,524,558,603,608,616,621,623,678,748,909};

        int t = 100;
        while (t--) {
            string c;  cin >> c;
            for (int i = 0; i < 100; i++) {
                bool ok = 0;
                string a = x.substr(30*i, 30);
                string b;
                for (int j = 0; j < 30; j++) {
                    b += char((c[pic[j]] ^ a[j]) + '0');
                }
                for (int j = 0; j < 100; j++) {
                    if (b == y.substr(30*j, 30)) {
                        cout << i + 1 _ j + 1 << endl;
                        ok = 1;
                        break;
                    }
                }
                if (ok) break;
            }
        }

    }
    else {
        string a[100];
        for (int i = 0; i < 100; i++) cin >> a[i];
        //vector<int> pic = {28,80,95,112,118,169,185,206,252,255,264,303,307,346,347,369,390,393,473,506,524,558,603,608,616,621,623,678,748,909};
        string x;
        for (int j = 0; j < 100; j++) {
            for (int i = 0; i < 30; i++) {
                x += a[j][pic[i]];
            }
        }
        cout << x << endl;
    }
    
    //cerr << char(('0' ^ '1') + '0');
}
accuracy: 0.3939393939393939
time_ms: 40
memory_kb: 3748
final_rank: 14

code_snippet: #include <bits/stdc++.h>
using namespace std;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
using Int = long long;
const char newl = '\n';

const Int seed = 114514;
const Int B = 1000;
const Int N = 100;
auto make_vec(){
  vector<Int> vs(B,0);
  for(Int i=0;i<30;i++) vs[i]=1;
  mt19937 mt(seed);
  shuffle(vs.begin(),vs.end(),mt);
  return vs;
}

void Alice(){
  auto vs=make_vec();
  string X;
  for(Int i=0;i<N;i++){
    string a;
    cin>>a;
    for(Int j=0;j<B;j++)
      if(vs[j]) X+=a[j];
  }
  cout<<X<<endl;
}

void Bob(){
  auto vs=make_vec();
  string Y;
  for(Int i=0;i<N;i++){
    string b;
    cin>>b;
    for(Int j=0;j<B;j++)
      if(vs[j]) Y+=b[j];
  }
  cout<<Y<<endl;
}

vector<Int> decode(string s){
  vector<Int> vs;
  for(Int i=0;i<(Int)s.size();i+=30){
    Int res=0;
    for(Int j=0;j<30;j++)
      res=res*2+(s[i+j]-'0');
    vs.emplace_back(res);
  }
  return vs;
}

void Charlie(){
  string X,Y;
  cin>>X>>Y;

  auto vs=make_vec();
  string Z;
  for(Int i=0;i<N;i++){
    string c;
    cin>>c;
    for(Int j=0;j<B;j++)
      if(vs[j]) Z+=c[j];
  }
  auto as=decode(X);
  auto bs=decode(Y);
  auto cs=decode(Z);
  for(Int i=0;i<N;i++){
    for(Int a=0;a<N;a++){
      for(Int b=0;b<N;b++){
        if((as[a]^bs[b])==cs[i]){
          cout<<a+1<<" "<<b+1<<endl;
          goto END;
        }
      }
    }
    cout<<1<<" "<<1<<endl;
  END:
    ;
  }
}
//INSERT ABOVE HERE
signed main(){
  string s;
  cin>>s;
  if(s=="Alice") Alice();
  if(s=="Bob") Bob();
  if(s=="Charlie") Charlie();
  return 0;
}
accuracy: 0.3939393939393939
time_ms: 10
memory_kb: 3752
final_rank: 9

code_snippet: #include <iostream>
#include <queue>
#include <vector>
#include <algorithm>
#include <set>
#include <cmath>
#include <tuple>
#include <cstring>
#include <map>
#include <iomanip>
#include <ctime>
#include <complex>
#include <cassert>
#include <climits>
#include <bitset>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define _ << " " <<
#define all(X) (X).begin(), (X).end()
#define len(X) (X).size()
#define Pii pair<int, int>
#define Pll pair<ll, ll>
#define Tiii tuple<int, int, int>
#define Tlll tuple<ll, ll, ll>
#define PI 3.14159265358979324

int main() {
    
    string s;
    cin >> s;
    vector<int> pic = {26,58,59,122,123,155,158,179,217,234,286,306,322,329,357,364,380,523,589,602,604,624,632,665,672,758,840,862,934,965};
    if (s[0] == 'C') {
        string x, y;
        cin >> x >> y;
        //vector<int> pic = {28,80,95,112,118,169,185,206,252,255,264,303,307,346,347,369,390,393,473,506,524,558,603,608,616,621,623,678,748,909};

        int t = 100;
        while (t--) {
            string c;  cin >> c;
            for (int i = 0; i < 100; i++) {
                bool ok = 0;
                string a = x.substr(30*i, 30);
                string b;
                for (int j = 0; j < 30; j++) {
                    b += char((c[pic[j]] ^ a[j]) + '0');
                }
                for (int j = 0; j < 100; j++) {
                    if (b == y.substr(30*j, 30)) {
                        cout << i + 1 _ j + 1 << endl;
                        ok = 1;
                        break;
                    }
                }
                if (ok) break;
            }
        }

    }
    else {
        string a[100];
        for (int i = 0; i < 100; i++) cin >> a[i];
        //vector<int> pic = {28,80,95,112,118,169,185,206,252,255,264,303,307,346,347,369,390,393,473,506,524,558,603,608,616,621,623,678,748,909};
        string x;
        for (int j = 0; j < 100; j++) {
            for (int i = 0; i < 30; i++) {
                x += a[j][pic[i]];
            }
        }
        cout << x << endl;
    }
    
    //cerr << char(('0' ^ '1') + '0');
}
accuracy: 0.3939393939393939
time_ms: 40
memory_kb: 3764
final_rank: 17

code_snippet: #include <iostream>
#include <queue>
#include <vector>
#include <algorithm>
#include <set>
#include <cmath>
#include <tuple>
#include <cstring>
#include <map>
#include <iomanip>
#include <ctime>
#include <complex>
#include <cassert>
#include <climits>
#include <bitset>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define _ << " " <<
#define all(X) (X).begin(), (X).end()
#define len(X) (X).size()
#define Pii pair<int, int>
#define Pll pair<ll, ll>
#define Tiii tuple<int, int, int>
#define Tlll tuple<ll, ll, ll>
#define PI 3.14159265358979324

int main() {
    
    string s;
    cin >> s;
    vector<int> pic = {65,116,165,216,218,239,259,294,319,328,330,379,407,442,449,453,539,585,663,677,709,718,812,823,840,907,909,937,941,945};
    if (s[0] == 'C') {
        string x, y;
        cin >> x >> y;
        //vector<int> pic = {28,80,95,112,118,169,185,206,252,255,264,303,307,346,347,369,390,393,473,506,524,558,603,608,616,621,623,678,748,909};

        int t = 100;
        while (t--) {
            string c;  cin >> c;
            for (int i = 0; i < 100; i++) {
                bool ok = 0;
                string a = x.substr(30*i, 30);
                string b;
                for (int j = 0; j < 30; j++) {
                    b += char((c[pic[j]] ^ a[j]) + '0');
                }
                for (int j = 0; j < 100; j++) {
                    if (b == y.substr(30*j, 30)) {
                        cout << i + 1 _ j + 1 << endl;
                        ok = 1;
                        break;
                    }
                }
                if (ok) break;
            }
        }

    }
    else {
        string a[100];
        for (int i = 0; i < 100; i++) cin >> a[i];
        //vector<int> pic = {28,80,95,112,118,169,185,206,252,255,264,303,307,346,347,369,390,393,473,506,524,558,603,608,616,621,623,678,748,909};
        string x;
        for (int j = 0; j < 100; j++) {
            for (int i = 0; i < 30; i++) {
                x += a[j][pic[i]];
            }
        }
        cout << x << endl;
    }
    
    //cerr << char(('0' ^ '1') + '0');
}
accuracy: 0.3939393939393939
time_ms: 40
memory_kb: 3752
final_rank: 15