l1 = gets.chomp! abort 'L1' unless l1=~/^[0-9]+$/ n = l1.to_i abort 'N' unless 3 <= n E9 = 1e9.to_i n.times do l = gets.chomp! abort 'L' unless l=~/^[-0-9]+ [-0-9]+$/ x,y = l.split.map(&:to_i) abort 'x' unless -E9 <= x && x <= E9 abort 'y' unless -E9 <= y && y <= E9 end puts 'AC'