#include <bits/stdc++.h>
using namespace std;
struct A {
  char a[50];
  int n;
} data[50];
bool cmp(A aa, A bb) { return strcmp(aa.a, bb.a) < 0; }
int main() {
  int i, j;
  int N, M;
  int t, c = 0, check;
  double k;
  char temp[50];
  scanf("%d %d %lf", &N, &M, &k);
  for (i = 0; i < N; i++) {
    scanf("%s %d", temp, &t);
    if ((int)(t * k + 0.000001) >= 100) {
      strcpy(data[c].a, temp);
      data[c++].n = (int)(t * k + 0.000001);
    }
  }
  for (i = 0; i < M; i++) {
    check = 0;
    scanf("%s", temp);
    for (j = 0; j < c; j++) {
      if (strcmp(data[j].a, temp) == 0) check = 1;
    }
    if (check == 0) {
      strcpy(data[c].a, temp);
      data[c++].n = 0;
    }
  }
  sort(data, data + c, cmp);
  printf("%d\n", c);
  for (i = 0; i < c; i++) {
    printf("%s %d\n", data[i].a, data[i].n);
  }
  return 0;
}
