import java.util.*;
import java.util.regex.*;
public class cups_validator{

  public static void main(String[] args){
    Pattern p = Pattern.compile("[a-z]{1,20}");
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.nextLine());
    if(n < 1 || n > 20) error("N out of bounds", n);
    Set<String> ss = new HashSet<String>();
    Set<Integer> is = new HashSet<Integer>();
    for(int i=0; i<n; i++){
      String[] line = sc.nextLine().split("\\s+");
      if(line.length != 2) error("expected two tokens", i);
      int r;
      String c;
      try{
        r=Integer.parseInt(line[0]);
        if((r&1)!=0) error("diamater not even", i);
        r>>=1;
        c=line[1];
      }
      catch(Exception e){
        c=line[0];
        r=Integer.parseInt(line[1]);
      }
      
      if(r < 1 || r > 1000) error("not a valid r", i);
      if(!p.matcher(c).matches()) error("not a valid string", i);
      ss.add(c);
      is.add(r);
    }

    if(ss.size() != n) error("colors not unique", -1);
    if(is.size() != n) error("radius..es..radii.. not unique", -1);
  
    System.exit(42);
  }

  private static void error(String msg, int x){
    System.err.println(msg + " " + x);
    System.exit(-1);
  }
}

        
