#include <bits/stdc++.h>
using namespace std;
struct skill {
  string name;
  int exp;
} a[40];
void quicksort(int l, int r) {
  if (l < r) {
    string x = a[r].name;
    skill temp;
    int i = l - 1;
    for (int j = l; j < r; j++) {
      if (x > a[j].name) {
        i++;
        temp = a[i];
        a[i] = a[j];
        a[j] = temp;
      }
    }
    i++;
    temp = a[r];
    a[r] = a[i];
    a[i] = temp;
    quicksort(l, i - 1);
    quicksort(i + 1, r);
  }
}
int main() {
  int m, n, t, i, j;
  float k, mm;
  string str;
  cin >> n >> m >> k;
  for (i = 0, j = 0; i < n; i++) {
    cin >> str >> t;
    mm = t * k;
    t = floor(mm + 0.001);
    if (t >= 100) {
      a[j].name = str;
      a[j].exp = t;
      j++;
    }
  }
  int p;
  for (i = 1; i <= m; i++) {
    cin >> str;
    p = 0;
    while (p < j && str != a[p].name) p++;
    if (p == j) {
      a[j].name = str;
      a[j].exp = 0;
      j++;
    }
  }
  quicksort(0, j - 1);
  cout << j << endl;
  for (i = 0; i < j; i++) cout << a[i].name << " " << a[i].exp << endl;
  return 0;
}
