#include <bits/stdc++.h>
int main() {
  int n, m;
  double k;
  std::cin >> n >> m >> k;
  int kt = round(k * 100);
  std::map<std::string, int> skills;
  for (int i = 0; i < n; i++) {
    std::string skill;
    int lvl;
    std::cin >> skill >> lvl;
    int nlvl = (kt * lvl) / 100;
    if (nlvl >= 100) {
      skills[skill] = nlvl;
    }
  }
  for (int i = 0; i < m; i++) {
    std::string skill;
    std::cin >> skill;
    if (!skills.count(skill)) {
      skills[skill] = 0;
    }
  }
  std::cout << skills.size() << '\n';
  for (std::map<std::string, int>::iterator ite = skills.begin();
       ite != skills.end(); ite++) {
    std::cout << (ite->first) << " " << (ite->second) << '\n';
  }
  return 0;
}
