import java.util.Scanner;
public class Solution {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(
System.in);
int n = sc.nextInt();
sc.nextLine();
// search on telegram
@codewithvirus
User codewithvirus[] = new User[n];
for (int i = 0; i < codewithvirus.length; i++) {
int id = sc.nextInt();
sc.nextLine();
String name = sc.nextLine();
String emil = sc.nextLine();
int age = sc.nextInt();
sc.nextLine();
codewithvirus[i] = new User(id, name, emil, age);
}
// search on telegram
@codewithvirus
int fs1 = sc.nextInt();
int ans1 = codewithvirus2(codewithvirus);
if (ans1 != 0) {
System.out.println(ans1);
} else {
System.out.println("No Users found.");
}
// search on telegram
@codewithvirus
User ans2 = codewithvirus1(codewithvirus, fs1);
if (ans2 != null) {
System.out.println(ans2.getName());
System.out.println(ans2.getEmil());
} else {
System.out.println("No User found with the given id.");
}
}
// search on telegram
@codewithvirus
public static int codewithvirus2(User[] d) {
int p = 0;
for (int i = 0; i < d.length; i++) {
{
p += d[i].getAge();
}
}
return p;
}
// search on telegram
@codewithvirus
public static User codewithvirus1(User[] d, int s) {
User p = null;
int a = 0;
for (int i = 0; i < d.length; i++) {
if (d[i].getId() == s) {
p = d[i];
}
}
return p;
}
}
// search on telegram
@codewithvirus
class User {
private int id;
private String name;
private String emil;
private int age;
public User(int id, String name, String emil, int age) {
super();
this.id = id;
this.name = name;
this.emil = emil;
this.age = age;
}
// search on telegram
@codewithvirus
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
// search on telegram
@codewithvirus
public void setName(String name) {
this.name = name;
}
public String getEmil() {
return emil;
}
public void setEmil(String emil) {
this.emil = emil;
}
public int getAge() {
return age;
}
// search on telegram
@codewithvirus
public void setAge(int age) {
this.age = age;
}
}
// search on telegram
@codewithvirus
//////////////////////// UNIX /////////////////
/*
* awk 'BEGIN{FS=";", count=0;} { if($4>10000) { count+=$3 } } END {
* if(count==0){ print "Total count: 0"; } else { print "Total count:", count; }
* }'
*
*
*/