#include <bits/stdc++.h>
#include <ext/random>
#include <ext/pb_ds/assoc_container.hpp>
#include "grader.h"
// #pragma GCC optimize("O3,unroll-loops")
// #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#define pb push_back
#define ppb pop_back
#define fr first
#define sc second
#define all(v) v.begin(), v.end()
#define vektor vector
using namespace std;
using namespace __gnu_pbds;
using ll = long long;
using ull = unsigned ll;
using ld = long double;
constexpr ull Mod = 100;
constexpr ull Mod2 = 1 + 7 * 17 * (1 << 23);
constexpr ull sqr = 320;
constexpr ld eps = 1e-12;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll random(ll l, ll r) {if(l <= r) return uniform_int_distribution <ll> (l, r)(rng); return -1;}
unordered_map <int, int> a[56], cnt, tot;
ld p[100];
int cntt = 0;
int cur = 0, ans = 0;
// int language(int l){
// if(l == cur) ans ++;
// return cur;
// }
void excerpt(int e[100]){
cntt ++;
if(cntt == 1){
p[0] = 1;
for(int i = 1; i <= 99; i ++) p[i] = p[i - 1] * 1.01;
}
int ans;
pair <ld, int> mx = {0, -1};
// compare and guess
for(int i = 0; i <= 55; i ++){
ld c = 0;
for(int j = 0; j < 99; j ++){
if(a[i][e[j]] == 0) continue;
c += (ld)(a[i][e[j]]*a[i][e[j]]) / (ld)tot[e[j]];
}
mx = max(mx, {c, i});
}
ans = mx.sc;
ans = language(ans);
//learning
for(int i = 0; i < 99; i ++){
a[ans][e[i]] ++;
tot[e[i]] ++;
if(a[ans][e[i]] == 1) cnt[e[i]] ++;
}
}