#include <bits/stdc++.h>
struct node {
  char str[1000];
  int value;
} a[50];
int cmp(const void *a, const void *b) {
  if (strcmp((*(node *)a).str, (*(node *)b).str) == 0)
    return (*(node *)a).value - (*(node *)b).value;
  else
    return strcmp((*(node *)a).str, (*(node *)b).str);
}
double kabs(double temp) {
  if (temp < 0)
    return -temp;
  else
    return temp;
}
int fuck(double temp) {
  if (kabs(temp - (int)temp - 1.0) < 1e-8)
    return (int)(temp / 1) + 1;
  else
    return (int)(temp / 1);
}
int main() {
  int n, m;
  double k;
  scanf("%d %d %lf", &n, &m, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%s %d", a[i].str, &a[i].value);
    double temp = a[i].value * k;
    a[i].value = fuck(temp);
    if (a[i].value < 100) a[i].value = 0;
  }
  for (int i = 1; i <= m; i++) {
    scanf("%s", a[i + n].str);
    a[i + n].value = -1;
  }
  qsort(a + 1, n + m, sizeof(node), cmp);
  int ans = 0;
  for (int i = 1; i <= n + m; i++) {
    if (a[i].value != 0 && a[i].value != -1) {
      ans++;
    } else if (a[i].value == -1) {
      if (strcmp(a[i].str, a[i + 1].str) == 0 && a[i + 1].value == 0) ans++;
      if (strcmp(a[i].str, a[i + 1].str) != 0) ans++;
    }
  }
  printf("%d\n", ans);
  for (int i = 1; i <= n + m; i++) {
    if (a[i].value != 0 && a[i].value != -1) {
      ans++;
      printf("%s %d\n", a[i].str, a[i].value);
    } else if (a[i].value == -1) {
      if (strcmp(a[i].str, a[i + 1].str) == 0 && a[i + 1].value == 0) {
        ans++;
        printf("%s 0\n", a[i].str);
      }
      if (strcmp(a[i].str, a[i + 1].str) != 0) {
        ans++;
        printf("%s 0\n", a[i].str);
      }
    }
  }
  return 0;
}
