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

void check() {
    int n, m , k , juryK;

    n = inf.readInt();
    m = inf.readInt();

    vector<int> from, to, color;
    for (int i = 0; i < m; i++) {
        int a = inf.readInt(), b = inf.readInt(), c = inf.readInt();
        from.push_back(a - 1);
        to.push_back(b - 1);
        color.push_back(c - 1);
    }
    k = ouf.readInt();
    juryK = ans.readInt();

    if (k == -1) {
        if (juryK != -1)
            quitf(_wa, "Contestant did not find solution , but Jury does");
    } else {
        if (k < 2 || k > m)
            quitf(_wa, "Invalid cycle length");

        vector<int> cycle;
        vector<int> used(m, -1);
        for (int i = 0; i < k; i++) {
            int edge_id;
            edge_id = ouf.readInt();
            if(edge_id > m || edge_id < 1)
                quitf(_wa, "Invalid edges");
            edge_id--;
            cycle.push_back(edge_id);
            if (used[edge_id] != -1)
                quitf(_wa, "Repetition of edges");
            used[edge_id] = i;
        }
        cycle.push_back(cycle[0]);
        for (int i = 0; i < k; i++) {
            int prev = cycle[i], next = cycle[i + 1];
            if (to[prev] != from[next])
                quitf(_wa, "Adjacent edges do not share a vertex");
            if (color[prev] == color[next])
                quitf(_wa, "Adjacent edges have the same color");
        }
        if (juryK == -1)
            quitf(_ok, "Oh shit! Contestant found valid cycle but Jury does not");
    }
    quitf(_ok, "Ơ mơ zing, gút chóp em!\n");
}

int main(int c, char **ars) {
    registerTestlibCmd(c, ars);
    check();
    return 0;
}
