#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  string p;
  map<string, int> mp;
  cin >> N >> M >> p;
  int K = 10 * ((int)p[2] - '0') + (int)p[3] - '0';
  string s;
  int val;
  for (int i = 0; i < N; i++) {
    cin >> s >> val;
    val *= K;
    val /= 100;
    if (val < 100) continue;
    mp[s] = val;
  }
  for (int i = 0; i < M; i++) {
    cin >> s;
    if (mp.find(s) == mp.end()) mp[s] = 0;
  }
  cout << mp.size() << endl;
  for (map<string, int>::iterator it = mp.begin(); it != mp.end(); it++)
    cout << it->first << " " << it->second << endl;
  return 0;
}
