#include <bits/stdc++.h>
using namespace std;
struct Data {
  string s;
  double d;
  Data(string a, double b) : s(a), d(b) {}
};
int main() {
  int n, m, d;
  double k;
  map<string, int> arr;
  vector<Data> mas;
  string s;
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++) {
    cin >> s >> d;
    mas.push_back(Data(s, d));
  }
  for (int i = 1; i <= m; i++) {
    cin >> s;
    arr[s] = 0;
  }
  for (int i = 0; i < n; i++) {
    int ch = (int)(mas[i].d * k);
    if (mas[i].d * k - ch > 0.999) ch++;
    if (ch >= 100) arr[mas[i].s] = ch;
  }
  cout << arr.size() << endl;
  for (map<string, int>::const_iterator MI = arr.begin(); MI != arr.end(); ++MI)
    cout << MI->first << " " << MI->second << endl;
}
