#include <bits/stdc++.h>
using namespace std;
const double eps = 0.000001;
struct node {
  int skill, flag;
  char str[100];
} S1[55];
int n, m;
double k;
bool cmp(node a, node b) {
  if (strcmp(a.str, b.str) != 1)
    return 1;
  else
    return 0;
}
int judge(char *s) {
  for (int i = 0; i < m; ++i)
    if (!strcmp(s, S1[i + n].str)) return i;
  return -1;
}
int main() {
  while (scanf("%d %d %lf", &n, &m, &k) != EOF) {
    for (int i = 0; i < n; ++i) {
      scanf("%s %d", S1[i].str, &S1[i].skill);
      S1[i].flag = 0;
    }
    for (int i = 0; i < m; ++i) {
      scanf("%s", S1[i + n].str);
      S1[n + i].flag = 1;
      S1[n + i].skill = 0;
    }
    for (int i = 0; i < n; ++i) {
      int x = S1[i].skill * k + eps;
      if (x >= 100) {
        S1[i].skill = x;
        S1[i].flag = 1;
        int l = judge(S1[i].str);
        if (l != -1) S1[l + n].flag = 0;
      }
    }
    int tot = 0;
    for (int i = 0; i < n + m; ++i)
      if (S1[i].flag == 1) tot++;
    sort(S1, S1 + n + m, cmp);
    printf("%d\n", tot);
    for (int i = 0; i < n + m; ++i)
      if (S1[i].flag == 1) printf("%s %d\n", S1[i].str, S1[i].skill);
  }
  return 0;
}
