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