loop {
    n, q = gets.split.map(&:to_i)
    break if n + q == 0
    d = Hash.new
    n.times do
        s, a, b = gets.split
        a, b = [a, b].map(&:to_i)
        d[(b - a + 1)..b] = s
    end
    q.times do
        a = gets.to_i
        flag = false
        d.each do |r, s|
            if r.include?(a)
                puts [s, a - r.begin + 1].join(' ')
                flag = true
            end
        end
        puts "Unknown" if !flag
    end
}
