// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2242

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <tuple>
using namespace std;

vector<tuple<int, int, string>> V;
int N, Q;

int main() {
  while (cin >> N >> Q && N) {
    V.clear();
    for (int i=1; i<=N; i++) {
      string en;
      int eby, wy;
      cin >> en >> eby >> wy;
      int fy = wy - eby + 1;
      V.push_back(make_tuple(fy, -1*wy, en));
    }
    V.push_back(make_tuple(-1, 1, "dummy"));
    sort(V.begin(), V.end());
    for (int i=0; i<Q; i++) {
      int q;
      cin >> q;
      int ind = V.size()-1;
      for (unsigned int i=0; i<V.size(); i++) {
	int temp = get<0>(V[i]);
	if (temp > q) {
	  ind = i-1;
	  break;
	}
      }
      if (-1 * get<1>(V[ind]) >= q) {
	cout << get<2>(V[ind]) << " " << q - get<0>(V[ind]) + 1 << endl;
      } else {
	cout << "Unknown" << endl;
      }
    }
  }
}