#include <bits/stdc++.h>
using namespace std;
const int MAX = 1010;
int n, m;
struct node {
  char s[MAX];
  double score;
  int flag;
} d[MAX];
bool cmp(node a, node b) { return strcmp(a.s, b.s) < 0; }
int main() {
  int i, j;
  double k;
  while (~scanf("%d%d%lf", &n, &m, &k)) {
    memset(d, 0, sizeof(d));
    int cont = 0;
    map<string, int> q;
    for (i = 0; i < n; i++) {
      scanf("%s%lf", d[i].s, &d[i].score);
      q[d[i].s]++;
      d[i].score = d[i].score * k;
      if (d[i].score < 100) {
        q[d[i].s] = 0;
        cont++;
        d[i].flag = 1;
      }
    }
    while (m--) {
      char c[110];
      scanf("%s", c);
      if (q[c] == 0) {
        strcpy(d[n++].s, c);
        q[c]++;
        d[n - 1].score = 0;
      }
    }
    sort(d, d + n, cmp);
    printf("%d\n", n - cont);
    for (i = 0; i < n; i++) {
      if (q[d[i].s] == 0 || d[i].flag == 1) continue;
      if (d[i].score < 100 - 1e-6) d[i].score = 0;
      printf("%s %.0lf\n", d[i].s, abs(d[i].score - 0.499999));
    }
  }
  return 0;
}
