#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  double k;
  string name;
  int exp;
  while (scanf("%d %d %lf", &n, &m, &k) != EOF) {
    getchar();
    map<string, int> mp;
    for (int i = 0; i < n; i++) {
      cin >> name;
      scanf("%d", &exp);
      if (exp * k + 1e-3 >= 100) {
        mp[name] = (int)(exp * k + 1e-3);
      }
    }
    for (int i = 0; i < m; i++) {
      cin >> name;
      if (mp[name] == 0) mp[name] = 0;
    }
    printf("%d\n", mp.size());
    map<string, int>::iterator ite;
    for (ite = mp.begin(); ite != mp.end(); ite++) {
      cout << ite->first;
      printf(" %d\n", ite->second);
    }
  }
  return 0;
}
