#include<iostream>

using namespace std;

void hoge(int N, int Q){

   string a[N];
   int b[N], c[N], d[2*N];
   for(int i=0; i<N; i++){
      cin>> a[i]>> b[i]>> c[i];
      d[2*i]=c[i]-b[i]+1;
      d[2*i+1]=c[i];
   }

   for(int q=0; q<Q; q++){
      int e;
      cin>> e;
      for(int i=0; i+1<2*N; i+=2){
         if(d[i]<=e&&e<=d[i+1]){
            cout<< a[i/2]<< " "<< e-d[i]+1<< endl;
            goto ikd;
         }
      }
      cout<< "Unknown"<< endl;
      ikd:;
   }
}

int main(){

   while(1){
      int N, Q;
      cin>> N>> Q;
      if(!(N||Q)) break;

      hoge(N, Q);
   }

   return 0;
}