#include <bits/stdc++.h>
using namespace std;
int main() {
  double k;
  int n, m;
  map<string, int> myMap;
  cin >> n >> m >> k;
  string tmp;
  for (int i = 0; i < n; ++i) {
    cin >> tmp;
    cin >> myMap[tmp];
    int x = (int)(myMap[tmp] * k + 0.0001);
    if (x < 100)
      myMap.erase(tmp);
    else
      myMap[tmp] = x;
  }
  for (int i = 0; i < m; ++i) {
    cin >> tmp;
    myMap[tmp];
  }
  cout << myMap.size() << endl;
  for (map<string, int>::iterator it = myMap.begin(); it != myMap.end(); ++it) {
    cout << (*it).first << " " << (*it).second << endl;
  }
  return 0;
}
