#include <bits/stdc++.h>
using namespace std;
int main() {
  ifstream ff("file.txt");
  int n, m;
  double k;
  cin >> n >> m >> k;
  vector<pair<string, double> > v1(n + m);
  int kol = 0;
  for (int i = 0; i < n; i++) {
    cin >> v1[i].first >> v1[i].second;
    v1[i].second = (v1[i].second * k);
    if ((ceil(v1[i].second) - v1[i].second) < 0.001) {
      v1[i].second = ceil(v1[i].second);
    } else {
      v1[i].second = floor(v1[i].second);
    }
    if (v1[i].second < 100) {
      v1[i].second = -1;
      kol--;
    }
  }
  string y;
  for (int i = n; i < m + n; i++) {
    cin >> v1[i].first;
    v1[i].second = 0;
    for (int j = 0; j < n; j++) {
      if (v1[i].first == v1[j].first && v1[j].second != -1) {
        v1[i].second = -2;
        kol--;
      }
    }
  }
  sort(v1.begin(), v1.end());
  cout << kol + v1.size() << endl;
  for (int i = 0; i < m + n; i++) {
    if (v1[i].second >= 0) {
      cout << v1[i].first << ' ' << v1[i].second << endl;
    }
  }
  return 0;
}
