#include<cstdio>
#include<climits>
#include<vector>
#include<algorithm>
#include<string>
using namespace std;
struct S{int b,e;string s;}s;
int C(S l,S r){return l.b<r.b;}
int main()
{
	int N,Q;
	char _[32];
	typedef vector<S>V;
	V v;
	V::iterator i;
	v.reserve(1002);
	while(scanf("%d%d",&N,&Q),N)
	{
		v.clear();
		s.b=s.e=-1;
		v.push_back(s);
		while(N--)
		{
			scanf("%s%d%d",&_,&s.b,&s.e);
			s.b=s.e-s.b+1;
			s.s=_;
			v.push_back(s);
		}
		s.b=s.e=INT_MAX;
		v.push_back(s);
		sort(v.begin(),v.end(),C);
		while(Q--)
		{
			scanf("%d",&N);
			s.b=N;
			i=lower_bound(v.begin(),v.end(),s,C);
			if(i->b==N)printf("%s 1\n",i->s.c_str());
			else if(i[-1].b<=N&&N<=i[-1].e)
				printf("%s %d\n",i[-1].s.c_str(),N-i[-1].b+1);
			else puts("Unknown");
		}
	}
	return 0;
}