#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  double k;
  cin >> n >> m >> k;
  map<string, int> mm;
  for (int i = (0); i < (n); i += 1) {
    string s;
    int r;
    cin >> s >> r;
    if (!int(r * k + 0.0000000001 < 100)) mm[s] = int(r * k + 0.0000000001);
  }
  for (int i = (0); i < (m); i += 1) {
    string s;
    cin >> s;
    mm[s] += 0;
  }
  cout << mm.size() << endl;
  for (__typeof((mm).begin()) i = (mm).begin(); i != (mm).end(); i++)
    cout << i->first << ' ' << i->second << endl;
  return 0;
}
