#include <bits/stdc++.h>
using namespace std;
map<string, int> m;
int main() {
  int N, M, K;
  char ch[100];
  scanf("%d %d", &N, &M);
  for (int n = 0; n < 3; n++) getchar();
  scanf("%d", &K);
  for (int n = 0; n < N; n++) {
    string str;
    cin >> str;
    int num;
    scanf("%d", &num);
    int res = (num * K) / 100;
    if (res >= 100) {
      m[str] = res;
    }
  }
  for (int n = 0; n < M; n++) {
    string str;
    cin >> str;
    if (!m[str]) m[str] = 0;
  }
  cout << m.size() << endl;
  for (map<string, int>::iterator it = m.begin(); it != m.end(); it++) {
    cout << (it->first) << " " << (it->second) << endl;
  }
}
