class Fixnum
	%w( + - * / % ).each do |op|
		orig = "orig_" + op
		alias_method orig, op
		define_method op do |other|
			return send(orig, other).send("orig_%", 256) if other.class == Fixnum	
			other.map{|x| send(orig, x).send("orig_%", 256)}.uniq
		end
	end
end

class Array
	%w( + - * / % ).each do |op|
		define_method op do |other|
			if other.class == Fixnum
				return map{|x| x.send(op, other)}.uniq
			end

			map{|x| x.send(op, other)}.flatten.uniq 
		end
	end
end

n = gets.to_i
var = {}
n.times do
	name, l, u = gets.chomp.split
	var[name] = (l.to_i..u.to_i).to_a
end

gets
stack = []

begin 
	gets.chomp.split.each do |x|
		case x
		when /[+-\/*%]/
			rhs, lhs = stack.pop, stack.pop
			stack << lhs.send(x, rhs)
		when /^\d+$/
			stack << x.to_i
		else
			stack << var[x]
		end
	end	
	puts 'correct'
rescue
	puts 'error'
end