#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  char discard;
  cin >> n >> m >> discard >> discard >> k;
  map<string, int> c;
  for (int i = 0; i < n; i++) {
    string name;
    int exp;
    cin >> name >> exp;
    exp = k * exp / 100;
    if (exp < 100) continue;
    c[name] = exp;
  }
  for (int i = 0; i < m; i++) {
    string name;
    cin >> name;
    if (!c.count(name)) {
      c[name] = 0;
    }
  }
  cout << c.size() << "\n";
  for (map<string, int>::iterator it = c.begin(); it != c.end(); it++) {
    cout << it->first << " " << it->second << "\n";
  }
}
