#include <iostream>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;

int main(){
	int N, Q;
	while(cin >> N >> Q, N){
		vector< pair<string, pair<int, int> > > vp;
		string str; int Y, W; 
		for(int i=0;i<N;i++){
			cin >> str >> Y >> W;
			vp.push_back(make_pair(str, make_pair(W-Y, Y)));
		}
		for(int i=0;i<Q;i++){
			string ans = "Unknown";
			cin >> W;
			for(int j=0;j<N;j++){
				if(0 < W-vp[j].second.first && W-vp[j].second.first <= vp[j].second.second){
					ans = vp[j].first;
					Y = W-vp[j].second.first;
				}
			}
			if(ans != "Unknown") cout << ans << " " << Y << endl; 
			else                 cout << ans << endl;
		}
	}
}