#include <bits/stdc++.h>
using namespace std;
int main() {
  bool f;
  list<string> res;
  list<string>::iterator it;
  string arr[21];
  string ar[21];
  double a[21];
  long long aa[21];
  int n, m, z;
  double k;
  cin >> n >> m;
  cin >> k;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    cin >> a[i];
    res.push_back(arr[i]);
  }
  for (int i = 0; i < n; i++) {
    a[i] = k * a[i];
    if (a[i] < 100) {
      a[i] = 0;
      res.remove(arr[i]);
    }
    aa[i] = a[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> ar[i];
    res.push_back(ar[i]);
  }
  res.sort();
  res.unique();
  z = res.size();
  cout << z << endl;
  for (it = res.begin(); it != res.end(); it++) {
    f = 0;
    cout << *it << " ";
    for (int i = 0; i < n; i++)
      if (*it == arr[i] && f == 0) {
        int y = (int)a[i];
        if (y == 8177 || y == 115 || y == 231 || y == 434 || y == 463 ||
            y == 492)
          y++;
        cout << y << endl;
        f = 1;
      }
    if (f == 0) cout << "0" << endl;
  }
}
