#include<bits/stdc++.h>
using namespace std;
typedef struct calendar {
    int wy, eby;
    string name;
    bool operator<(const calendar &another) const {
	return wy < another.wy;
    };
}CAL;
int main() {
    int n, q;
    while (cin >> n >> q && n&&q) {
	CAL data[1000];
	for (int i = 0; i<n; ++i) 
            cin >> data[i].name >> data[i].eby >> data[i].wy;
	sort(data, data+n);
	for (int i = 0; i<q; ++i) {
	    int j, y; cin >> y;
	    for (j = 0; j<n; ++j)
		if (data[j].wy >= y) break;
	    if (j == n) cout << "Unknown" << endl;
	    else if (data[j].wy - data[j].eby + 1 <= y) cout << data[j].name << " " << y-(data[j].wy-data[j].eby) << endl;
	    else cout << "Unknown" << endl;
	}
    }
    return 0;
}
