#include <bits/stdc++.h>
using namespace std;
const double EPS = 1E-6;
int main() {
  map<string, int> mymap;
  int n, m, i, x;
  double k;
  string str;
  while (cin >> n >> m >> k) {
    for (mymap.clear(), i = 0; i < n; ++i) {
      cin >> str >> x;
      x = x * k + EPS;
      if (x < 100)
        continue;
      else
        mymap[str] = x;
    }
    for (i = 0; i < m; ++i) {
      cin >> str;
      mymap[str] += 0;
    }
    cout << mymap.size() << endl;
    for (map<string, int>::iterator it = mymap.begin(); it != mymap.end(); ++it)
      cout << it->first << " " << it->second << endl;
  }
}
