#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include "testlib.h"

using namespace std;

int main(int argc, char ** argv)
{
    int an[2][4], mdif[2], i, j, p, k, c;
    bool ex[4];
    registerTestlibCmd(argc, argv);
    for (i = 0; i < 4; i++)
        an[0][i] = ans.readInt();
    for (i = 0; i < 4; i++)
        an[1][i] = ouf.readInt();
    for (i = 0; i < 4; i++)
    {
        int len = inf.readInt();
        ex[i] = false;
        for (j = 0; j < len; j++)
        {
          c = inf.readInt();
          if (c == an[1][i])
            ex[i] = true;
        }
    }
    //quitf(_wa, "%d %d %d %d", ex[0], ex[1], ex[2], ex[3]);
    if (!(ex[0] && ex[1] && ex[2] && ex[3]))
        quitf(_wa, "Some of items colors doesn't exists!");
    for (i = 0; i < 2; i++)
    {
        mdif[i] = 0;
        for (k = 0; k < 3; k++)
            for (p = k + 1; p < 4; p++)
                mdif[i] = max(mdif[i], abs(an[i][k] - an[i][p]));
    }
    if (mdif[0] < mdif[1])
        quitf(_wa, "Contestant style is %d, but jury can make it %d", mdif[1], mdif[0]);
    else
        if (mdif[0] > mdif[1])
            quitf(_wa, "Impossible!!! Contestant solution is better!");
        else
            quitf(_ok, "Style level match");
    return 0;
}
