#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-4;
const int maxn = 61;
int n, m;
int k;
char tnam[25];
int t, p;
struct skill {
  char name[25];
  int exp;
} ans[maxn];
int cmp(const void *a, const void *b) {
  return strcmp(((skill *)a)->name, ((skill *)b)->name);
}
int search(char *sr) {
  for (int i = 0; i < p; i++) {
    if (strcmp(sr, ans[i].name) == 0) return i;
  }
  return -1;
}
void read() {
  char c;
  int ps = 0;
  while (true) {
    c = getchar();
    if ((('0') <= (c) && (c) <= ('9'))) break;
    if (c == '\n') {
      while (tnam[ps - 1] == ' ') ps--;
      tnam[ps] = '\0';
      return;
    }
    tnam[ps++] = c;
  }
  while (tnam[ps - 1] == ' ') ps--;
  tnam[ps] = '\0';
  t = c - '0';
  while (true) {
    c = getchar();
    if (c == '\n') return;
    t = 10 * t + c - '0';
  }
}
int main(void) {
  p = 0;
  scanf("%d %d 0.%d%*c", &n, &m, &k);
  for (int i = 0; i < n; i++) {
    read();
    if (k * t >= 10000) {
      strcpy(ans[p++].name, tnam);
      ans[p - 1].exp = k * t / 100;
    }
  }
  for (int i = 0; i < m; i++) {
    read();
    int cur = search(tnam);
    if (cur == -1) {
      strcpy(ans[p++].name, tnam);
      ans[p - 1].exp = 0;
    }
  }
  printf("%d\n", p);
  qsort(ans, p, sizeof(skill), cmp);
  for (int i = 0; i < p; i++) {
    printf("%s %d\n", ans[i].name, ans[i].exp);
  }
  return 0;
}
