#include <bits/stdc++.h>
using namespace std;
map<string, int> level;
int main() {
  int old, next;
  int z;
  char dot;
  int k;
  cin >> old >> next >> z >> dot >> k;
  for (int i = 0; i < old; ++i) {
    string name;
    int lev;
    cin >> name >> lev;
    if ((lev * k) / 100 >= 100) level[name] = (lev * k) / 100;
  }
  for (int i = 0; i < next; ++i) {
    string name;
    cin >> name;
    if (level.find(name) == level.end()) level[name] = 0;
  }
  cout << level.size() << endl;
  for (__typeof(level.begin()) it = (level.begin()); it != (level).end();
       ++it) {
    cout << it->first << " " << it->second << endl;
  }
}
