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