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