#include <bits/stdc++.h>
using namespace std;
struct axe {
  string name;
  int point;
  bool operator<(const axe &a) const {
    return name == a.name ? point > a.point : name < a.name;
  }
} axes[100];
int main() {
  int N, M;
  double K;
  while (cin >> N >> M >> K) {
    for (int i(0); i < N; ++i) {
      cin >> axes[i].name >> axes[i].point;
      double tmp = axes[i].point;
      tmp *= K;
      tmp = int(tmp + 1e-6);
      axes[i].point = tmp < 100 ? -1 : tmp;
    }
    for (int i(0); i < M; ++i) {
      cin >> axes[N + i].name;
      axes[N + i].point = 0;
    }
    sort(axes, axes + N + M);
    int cnt(0);
    for (int i(0); i < M + N; i++) {
      if (axes[i].point >= 0 && (!i || axes[i].name != axes[i - 1].name)) {
        ++cnt;
      }
    }
    cout << cnt << endl;
    for (int i(0); i < M + N; i++) {
      if (axes[i].point >= 0 && (!i || axes[i].name != axes[i - 1].name)) {
        cout << axes[i].name << " " << axes[i].point << endl;
      }
    }
  }
  return 0;
}
