j#include <stdio.h>

int main() {
    int N;
    scanf("%d", &N);

    // Check for invalid input
    if (N < 0) {
        printf("Invalid input\n");
        return 0;
    }

    int found = 0;
    int K;

    // Read N records
    for (int i = 0; i < N; i++) {
        int A, B, C;
        scanf("%d %d %d", &A, &B, &C);

        // Store the ID for later use
        if (i == N - 1) {
            // Last line is K, the ID to search
            K = A;
        } else {
            // Just store or check if this is the target ID
            if (A == K) {
                found = 1;
            }
        }
    }

    // But wait — actually, we should read K separately after all records!
    // Let's fix the logic: Read all N records first, then read K
    // So we need to restructure the code.

    // Correct approach:
    // Read N
    // Then read N lines of (A, B, C)
    // Then read K

    // Let's restart with correct flow

    // Reset because above logic was flawed

    // Re-read N
    scanf("%d", &N);
    if (N < 0) {
        printf("Invalid input\n");
        return 0;
    }

    // Array to store IDs (if needed), but we can just check during input
    int ids[1000]; // max 1000 records
    int count = 0;

    for (int i = 0; i < N; i++) {
        int A, B, C;
        scanf("%d %d %d", &A, &B, &C);
        ids[count++] = A;
    }

    int K;
    scanf("%d", &K);

    // Search for K in the list of IDs
    int found = 0;
    for (int i = 0; i < count; i++) {
        if (ids[i] == K) {
            found = 1;
            break;
        }
    }

    if (found) {
        printf("Found\n");
    } else {
        printf("Not Found\n");
    }

    return 0;
}