#include <bits/stdc++.h>
using namespace std;
struct P {
  int val;
  char c[25];
} t[45];
bool cmp(struct P x, struct P y) { return strcmp(x.c, y.c) < 0; }
int main(void) {
  int n, m, i, j, x, y;
  double k;
  char c[25];
  scanf("%d %d %lf", &n, &m, &k);
  j = 0;
  for (i = 0; i < n; i++) {
    scanf("%s %d", c, &x);
    k = k + 0.000000005;
    y = x * k;
    if (y >= 100) {
      strcpy(t[j].c, c);
      t[j++].val = y;
    }
  }
  y = j;
  for (i = 0; i < m; i++) {
    scanf("%s", c);
    for (j = 0; j < y; j++) {
      if (strcmp(t[j].c, c) == 0) break;
    }
    if (j == y) {
      strcpy(t[y].c, c);
      t[y].val = 0;
      y++;
    }
  }
  sort(t, t + y, cmp);
  printf("%d\n", y);
  for (i = 0; i < y; i++) printf("%s %d\n", t[i].c, t[i].val);
  return 0;
}
