import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
Student[] a = new Student[n];
for (int i = 0; i < n; i++) a[i] = new Student();
for (int i = 0; i < n; i++) {
a[i].id = sc.next();
a[i].name = sc.next();
a[i].a = sc.nextInt();
a[i].b = sc.nextInt();
a[i].c = sc.nextInt();
}
String s = sc.next();
boolean ok = false;
for (int i = 0; i < n; i++) {
if (s.equals(a[i].id)) {
ok = true;
System.out.println(a[i].id + " " + a[i].name + " " + a[i].a + " " + a[i].b + " " + a[i].c);
}
}
if (!ok) System.out.println("Not Found");
}
}
class Student {
String id, name;
int a, b, c;
}