#include <bits/stdc++.h>
using namespace std;
map<string, int> M;
string S;
int main() {
  int n, m;
  double k;
  scanf("%d%d%lf", &n, &m, &k);
  for (int i = 0; i < n; ++i) {
    cin >> S;
    int x;
    scanf("%d", &x);
    x = int(x * k + 1e-8);
    if (x >= 100.0) M[S] = x;
  }
  for (int i = 0; i < m; ++i) {
    cin >> S;
    if (!M[S]) M[S] = 0;
  }
  printf("%d\n", M.size());
  for (map<string, int>::iterator iter = M.begin(); iter != M.end(); ++iter) {
    printf("%s %d\n", iter->first.c_str(), iter->second);
  }
  return 0;
}
