#include <iostream>
#include <fstream>
#include <regex>
#include <string>
#include <unordered_map>

typedef std::unordered_map<std::string, std::string> phonebook_t;

static phonebook_t load(const char *filename) {
  phonebook_t phonebook;
  std::string s;
  std::ifstream in(filename);
  std::regex re("(.+[^ ])\\s+(\\d{3}\\.\\d{3}\\.\\d{4})");
  std::smatch sm;
  while (std::getline(in, s)) {
    if (std::regex_match(s, sm, re)) {
      phonebook[sm[1]] = sm[2];
      std::cerr << sm[1] << " " << sm[2] << std::endl;
    } else {
      std::cerr << "invalid line: " << s << std::endl;
    }
  }
  std::cerr << "ready!" << std::endl;
  return phonebook;
}

int main(int argc, char **argv) {
  if (argc != 2) {
    std::cerr << "input filename required!" << std::endl;
    return -1;
  }
  phonebook_t phonebook = load(argv[1]);
  std::string s;
  while (std::getline(std::cin, s)) {
    auto iter = phonebook.find(s);
    if (iter == phonebook.end())
      std::cout << "not found!" << std::endl;
    else
      std::cout << "=> " << iter->second << std::endl;
  }
}