#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  double k;
  cin >> n >> m >> k;
  map<string, int> mp;
  for (int i = 0; i < n; i++) {
    string str;
    int x;
    cin >> str >> x;
    if ((int)(x * k + 1e-11) >= 100) mp[str] = (x * k + 1e-11);
  }
  for (int u = 0; u < m; u++) {
    string str;
    cin >> str;
    mp[str];
  }
  cout << mp.size() << endl;
  for (map<string, int>::iterator it = mp.begin(); it != mp.end(); ++it)
    cout << it->first << ' ' << it->second << endl;
  return 0;
}
