#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/stack:16777216")
#include <string>
#include <vector>
#include <map>
#include <list>
#include <iterator>
#include <cassert>
#include <set>
#include <queue>
#include <iostream>
#include <sstream>
#include <stack>
#include <deque>
#include <cmath>
#include <memory.h>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <algorithm>
#include <utility>
#include <fstream>
#include <time.h>
using namespace std;
#define FOR(i, a, b) for(int i=(a);i<(b);i++)
#define RFOR(i, b, a) for(int i=(b)-1;i>=(a);--i)
#define FILL(A,value) memset(A,value,sizeof(A))
#define ALL(V) V.begin(), V.end()
#define SZ(V) (int)V.size()
#define PB push_back
#define MP make_pair
#define Pi 3.14159265358979
#define x0 ikjnrmthklmnt
#define y0 lkrjhkltr
#define y1 ewrgrg
typedef long long Int;
typedef unsigned long long UInt;
typedef vector<int> VI;
typedef pair<int, int> PII;
typedef pair<Int, Int> PLL;
typedef pair<double, double> PDD;
const int INF = 1000000000;
const int BASE = 1000000007;
const int MAX = 2000 * 100 + 7;
const int MAX2 = 10007;
const int MAXE = 100000;
const int ADD = 1000000;
const int MOD = 1000000007;
const int CNT = 0;
void fail()
{
cout << "fail" << endl;
exit(0);
}
string imp = "Oh sh*t";
int main(int argc, char* argv[])
{
try
{
ifstream in(argv[1]);
ifstream user(argv[2]);
ifstream ans(argv[3]);
int n, k;
in >> n >> k;
VI A;
FOR (i,0,n)
{
int x;
in >> x;
A.PB(x);
}
string su, sa;
getline(user, su);
getline(ans, sa);
if ((su == imp) != (sa == imp))
fail();
if (su != imp)
{
VI U;
int x;
stringstream ss;
ss << su;
while (ss >> x)
U.PB(x);
if (SZ(U) != SZ(A) || A.empty())
fail();
int cnt = 0, mx = 0;
FOR (i,0,SZ(U))
{
if (i == 0 || U[i-1] == U[i])
++ cnt;
else
cnt = 1;
mx = max(mx, cnt);
}
if (mx < k)
fail();
sort(ALL(A));
sort(ALL(U));
if (A != U)
fail();
}
string trash;
if (user >> trash)
fail();
}
catch (...){
cout << "Checker error" << endl;
}
}