#include "testlib.h"
#include <bits/stdc++.h>
using namespace std;

int x,y,z,k;

vector<int> test;

int checkAns(int a, int b, int c){
    vector<int> cur_ans = {a,b,c};

    sort(cur_ans.begin(), cur_ans.end());

    if(cur_ans[0] == -1 && cur_ans.back() == -1)
        return 0;

    for(int i = 0; i < 3; i++){
        if(cur_ans[i]!=test[i]){
            return -1;
        }
    }

    if(a*a*a + b*b + c == k){
        return 0;
    }
    else{
        return -2;
    }
}

int main(int argc, char* argv[]) {
    // This command initializes checker environment.
    registerTestlibCmd(argc, argv);

    x = inf.readInt();
    inf.readSpace();
    y = inf.readInt();
    inf.readSpace();
    z = inf.readInt();
    inf.readSpace();
    k = inf.readInt();

    test = {x,y,z};

    sort(test.begin(), test.end());

    int ja, jb, jc;

    ja = ans.readInt();
    ans.readSpace();
    jb = ans.readInt();
    ans.readSpace();
    jc = ans.readInt();

    int jres = checkAns(ja,jb,jc);

    if(jres == -1){
        quitf(_fail, "Jury answer does not consist of the original x,y,z");
    }
    if(jres == -2){
        quitf(_fail, "Jury answer does not make sum of k");
    }

    int ca, cb, cc;

    ca = ouf.readInt(-1, 1000);
    cb = ouf.readInt(-1, 1000);
    cc = ouf.readInt(-1, 1000);

    int cres = checkAns(ca,cb,cc);

    if(cres == -1){
        quitf(_wa, "Contestant's answer does not consist of the original x,y,z");
    }
    if(cres == -2){
        quitf(_wa, "Contestant's answer does not make sum of k");
    }

    if(ja == -1 && ca != -1){
        quitf(_fail, "Contestant had found an answer, but jury didn't");
    }
    if(ja != -1 && ca == -1){
        quitf(_wa, "Contestant didn't find the answer, but the jury did");
    }

    quitf(_ok, "Ok. Contestant's answer is correct");
}
