#include "testlib.h"

#include <algorithm>
#include <vector>
#include <iostream>

using namespace std;

int main(int argc, char *argv[]) {
    registerTestlibCmd(argc, argv);

    int n = inf.readInt();

    vector<int> sides(3);
    long long sum = 0;
    for (int i = 0; i < 3; i++) {
        sides[i] = ouf.readInt(1, n);
        sum += 1LL * sides[i] * sides[i];
    }
    if (sides[0] > sides[1] || sides[1] > sides[2]) {
        quitf(_wa, "Sides are not in ascending order");
    }
    if (sides[0] == sides[1] || sides[1] == sides[2]) {
        quitf(_wa, "Output have equal numbers");
    }
    if (n != sides[0] + sides[1] + sides[2]) {
        quitf(_wa, "Sum of sides is not equal to n");
    }
    vector<int> ans_sides(3);
    long long ans_sum = 0;
    for (int i = 0; i < 3; i++) {
        ans_sides[i] = ans.readInt(1, n);
        ans_sum += 1LL * ans_sides[i] * ans_sides[i];
    }
    if (ans_sum > sum) {
        quitf(_fail, "Participant's sum of squares is less than jury's: expected %lld, but found %lld", ans_sum, sum);
    }
    if (ans_sum < sum) {
        quitf(_wa, "Jury has better answer: expected %lld, but found %lld", ans_sum, sum);
    }
    quitf(_ok, "OK, sides = [%d %d %d], square = %lld", sides[0], sides[1], sides[2], sum);
    return 0;
}
