#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  double k, eps = 1e-8;
  int level, ans, K;
  int newlevel;
  map<string, int> skill;
  string name;
  scanf("%d%d%lf", &n, &m, &k);
  for (typeof(0) i = (0); i < (n); ++i) {
    cin >> name >> level;
    newlevel = (int)(level * k + eps);
    if (newlevel >= 100) skill[name] = newlevel;
  }
  for (typeof(0) i = (0); i < (m); ++i) {
    cin >> name;
    if (skill.find(name) == skill.end()) skill[name] = 0;
  }
  ans = ((int)(skill).size());
  cout << ans << endl;
  for (typeof((skill).begin()) it = (skill).begin(); it != (skill).end(); ++it)
    cout << it->first << " " << it->second << endl;
  return 0;
}
