#include <bits/stdc++.h>
using namespace std;
long long n, m, i, j, x, ck;
long double k, dx;
map<string, long long> a;
map<string, long long>::iterator it;
string s;
long long max(long long a, long long b) {
  if (a > b)
    return a;
  else
    return b;
}
long long min(long long a, long long b) {
  if (a < b)
    return a;
  else
    return b;
}
int main() {
  cin >> n >> m >> k;
  for (i = 0; i < n; i++) {
    cin >> s >> x;
    ck = k * 1000000000;
    x *= ck;
    x /= 1000000000;
    if (x >= 100) {
      a[s] = x;
    }
  }
  for (i = 0; i < m; i++) {
    cin >> s;
    x = 0;
    j = a.count(s);
    if (j == 0) {
      a[s] = x;
    }
  }
  cout << a.size() << endl;
  for (it = a.begin(); it != a.end(); it++)
    cout << it->first << " " << it->second << endl;
  return 0;
}
