import std.stdio;
import std.algorithm;
import std.string;
import std.range;
import std.array;
import std.conv;
import std.complex;
import std.math;
import std.ascii;
import std.bigint;
import std.container;
import std.typecons;

auto readInts() {
	return array(map!(to!int)(readln().strip().split()));
}
auto readInt() {
	return readInts()[0];
}
auto readLongs() {
	return array(map!(to!long)(readln().strip().split()));
}
auto readLong() {
	return readLongs()[0];
}

const real eps = 1e-10;

void main(){
	while(true) {
		auto nq = readInts();
		auto n = nq[0];
		auto q = nq[1];
		if((n|q) == 0) return;

		alias data = Tuple!(int, "w", int, "b", string, "n");
		data[] list;
		for(int i; i < n; ++i) {
			auto l = readln().chomp().split();
			list ~= data(l[2].to!int - l[1].to!int + 1, l[1].to!int, l[0]);
		}
		list.sort();
		for(int i; i < q; ++i) {
			auto w = readInt();
			auto e = list.assumeSorted.lowerBound(data(w+1, 0, ""));
			if(e.empty || e.back.w + e.back.b - 1 < w) {
				writeln("Unknown");
			} else {
				writeln(e.back.n, " ", w - e.back.w + 1);
			}
		}
	}
}