#include <bits/stdc++.h>
using namespace std;
int main() {
  map<string, int> mp;
  map<string, int>::iterator it;
  string a;
  int n, m;
  int val;
  double k;
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++) {
    cin >> a >> val;
    if (val * 1.0 * k + 0.001 >= 100.0)
      mp[a] += val * 1.0 * k + 0.001;
    else
      a.erase();
  }
  for (int i = 0; i < m; i++) {
    cin >> a;
    if (mp[a] == 0) mp[a] = 0;
  }
  cout << mp.size() << endl;
  for (it = mp.begin(); it != mp.end(); it++) {
    cout << it->first << ' ' << it->second << endl;
  }
  return 0;
}
