#include <bits/stdc++.h>
using namespace std;
struct Node {
  string s;
  int x;
  bool operator<(const Node& b) const { return s < b.s; }
};
int n, m, k;
Node a[1005];
map<string, int> f;
int main() {
  double tk;
  cin >> n >> m >> tk;
  k = int(tk * 100 + 1e-5);
  for (int i = 0; i < n; ++i) {
    cin >> a[i].s >> a[i].x;
    a[i].x = a[i].x * k / 100;
    f[a[i].s] = 1;
    if (a[i].x < 100) {
      a[i].x = 0;
      f[a[i].s] = 2;
    }
  }
  int an = n;
  for (int i = 0; i < m; ++i) {
    string ss;
    cin >> ss;
    if (f[ss] == 1) continue;
    if (f[ss] == 2) {
      f[ss] = 1;
      continue;
    }
    a[an].s = ss;
    a[an++].x = 0;
    f[ss] = 1;
  }
  sort(a, a + an);
  int cc = 0;
  for (int i = 0; i < an; ++i)
    if (f[a[i].s] == 1) ++cc;
  cout << cc << endl;
  for (int i = 0; i < an; ++i)
    if (f[a[i].s] == 1) cout << a[i].s << " " << a[i].x << endl;
  return 0;
}
