#include <bits/stdc++.h>
using namespace std;
int main() {
  const double eps = 1e-7;
  int n, m, c[20], e[40], i, j, N, f, Temp;
  double k;
  string a[20], b[20], d[40], temp;
  cin >> n >> m >> k;
  for (i = 0; i < n; i++) cin >> a[i] >> c[i];
  for (i = 0; i < m; i++) cin >> b[i];
  for (i = 0, N = 0; i < n; i++)
    if (c[i] * k >= 100) {
      d[N] = a[i];
      e[N] = c[i];
      N++;
    }
  for (i = 0; i < m; i++) {
    f = 1;
    for (j = 0; j < N; j++)
      if (d[j] == b[i]) {
        f = 0;
        break;
      }
    if (f != 0) {
      d[N] = b[i];
      e[N] = 0;
      N++;
    }
  }
  for (i = 0; i < N - 1; i++) {
    f = 0;
    for (j = 0; j < N - 1; j++)
      if (d[j] > d[j + 1]) {
        temp = d[j];
        d[j] = d[j + 1];
        d[j + 1] = temp;
        Temp = e[j];
        e[j] = e[j + 1];
        e[j + 1] = Temp;
        f = 1;
      }
    if (f == 0) break;
  }
  cout << N << "\n";
  for (i = 0; i < N; i++) {
    if (e[i] * k < 100) e[i] = 0;
    cout << d[i] << " " << int(e[i] * k + eps) << endl;
  }
  return 0;
}
