loop do
    n, q = gets.split.map &:to_i
    break if n == 0
    era = {}
    n.times do
        name, y, e = gets.split
        y, e = y.to_i, e.to_i
        era[name] =(e - y + 1 .. e)
    end 

    q.times do
        y = gets.to_i
        puts 'Unknown' if era.all? do |name, range|
            if range === y
                puts [name, y - range.first + 1] * ' ' 
                next false
            end
            next true
        end
    end 
end