package file.iostream;
import java.util.*;
import java.util.Map.Entry;
public class Demo1 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
HashMap<String,String> hm = new HashMap<String,String>();
while(sc.hasNext()){
String str = sc.nextLine();
if(str.equals("ClearContactBook")){
hm.clear();
}
else if(str.startsWith("AddCard")){
String[] s = str.split(" ");
if(s.length==3 && s[0].equals("AddCard") && s[2].matches("[0-9]+")){
String name = s[1];
String phoneNum = s[2];
hm.put(name, phoneNum);
}
}else if(str.startsWith("SearchCard")){
String[] s = str.split(" ");
if(s.length==2){
if(hm.containsKey(s[1])){
String phoneNum = hm.get(s[1]);
sop(phoneNum);
}
else
sop(-1);
}
}else{
sop("error:The system does not support this command");
}
}
}
public static void sop(Object o){
System.out.println(o);
}
}
class ContactBook{
String name;
String phoneNum;
public ContactBook(String name,String phoneNum){
this.name = name;
this.phoneNum = phoneNum;
}
}
import java.util.*;
import java.util.Map.Entry;
public class Demo1 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
HashMap<String,String> hm = new HashMap<String,String>();
while(sc.hasNext()){
String str = sc.nextLine();
if(str.equals("ClearContactBook")){
hm.clear();
}
else if(str.startsWith("AddCard")){
String[] s = str.split(" ");
if(s.length==3 && s[0].equals("AddCard") && s[2].matches("[0-9]+")){
String name = s[1];
String phoneNum = s[2];
hm.put(name, phoneNum);
}
}else if(str.startsWith("SearchCard")){
String[] s = str.split(" ");
if(s.length==2){
if(hm.containsKey(s[1])){
String phoneNum = hm.get(s[1]);
sop(phoneNum);
}
else
sop(-1);
}
}else{
sop("error:The system does not support this command");
}
}
}
public static void sop(Object o){
System.out.println(o);
}
}
class ContactBook{
String name;
String phoneNum;
public ContactBook(String name,String phoneNum){
this.name = name;
this.phoneNum = phoneNum;
}
}