#include <bits/stdc++.h>
using namespace std;
map<string, int> mp;
int main() {
  int n, m, k;
  scanf("%d %d 0.%d", &n, &m, &k);
  for (int i = 0; i < n; i++) {
    string key;
    int value;
    cin >> key >> value;
    value = (value * k) / 100;
    if (value >= 100) {
      mp[key] = value;
    }
  }
  for (int i = 0; i < m; i++) {
    string key;
    cin >> key;
    if (mp[key] == 0) {
      mp[key] = 0;
    }
  }
  printf("%d\n", mp.size());
  for (map<string, int>::iterator i = mp.begin(); i != mp.end(); i++) {
    cout << (*i).first << " " << (*i).second << "\n";
  }
  return 0;
}
