// ~~ icebear ~~
#include <bits/stdc++.h>
using namespace std;
#define int ll
typedef long long ll;
typedef pair<int, int> ii;
typedef pair<int, ii> iii;
#define FOR(i,a,b) for(int i=(a); i<=(b); ++i)
#define FORR(i,a,b) for(int i=(a); i>=(b); --i)
#define REP(i, n) for(int i=0; i<(n); ++i)
#define RED(i, n) for(int i=(n)-1; i>=0; --i)
#define MASK(i) (1LL << (i))
#define BIT(S, i) (((S) >> (i)) & 1)
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define all(x) x.begin(), x.end()
#define task "icebearat"
const int MOD = 1e9 + 7;
const int inf = 1e9 + 27092008;
const ll INF = 1e18 + 27092008;
const int N = 2e5 + 5;
mt19937_64 rd(time(0));
int random(int l, int r) {
return l + rd() % (r - l + 1);
}
void gen() {
ofstream cout("gen.inp");
cout.close();
}
void process(void) {
FOR(i, 1, 30) {
gen();
system("main.exe");
system("trau.exe");
cout << "#Test " << i << " : ";
if (system("fc gen.out gen.ans")) {
cout << "WRONG\n";
return;
} else cout << "PASS\n";
}
}
signed main() {
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
if (fopen(task".inp", "r")) {
freopen(task".inp", "r", stdin);
freopen(task".out", "w", stdout);
}
int tc = 1;
// cin >> tc;
while(tc--) {
process();
}
return 0;
}
Ly8gfn4gaWNlYmVhciB+fgojaW5jbHVkZSA8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKI2RlZmluZSBpbnQgbGwKdHlwZWRlZiBsb25nIGxvbmcgbGw7CnR5cGVkZWYgcGFpcjxpbnQsIGludD4gaWk7CnR5cGVkZWYgcGFpcjxpbnQsIGlpPiBpaWk7CgojZGVmaW5lIEZPUihpLGEsYikgZm9yKGludCBpPShhKTsgaTw9KGIpOyArK2kpCiNkZWZpbmUgRk9SUihpLGEsYikgZm9yKGludCBpPShhKTsgaT49KGIpOyAtLWkpCiNkZWZpbmUgUkVQKGksIG4pIGZvcihpbnQgaT0wOyBpPChu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