#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void checkmin(T &a, T b) {
  if (a > b) a = b;
}
template <class T>
inline void checkmax(T &a, T b) {
  if (a < b) a = b;
}
const int oo = 1 << 30;
const double eps = 1e-7;
const int N = 1;
const int M = 1;
const long long P = 10000000097ll;
int up;
map<string, int> mp;
map<string, int>::iterator it;
void in(int n) {
  string s;
  int tp;
  int i, j, k;
  for ((i) = 0; i < (n); (i)++) {
    cin >> s >> tp;
    tp = tp * up / 100;
    if (tp >= 100) {
      mp[s] = tp;
    }
  }
}
void in_(int n) {
  string s;
  int i, j, k;
  for ((i) = 0; i < (n); (i)++) {
    cin >> s;
    mp[s];
  }
}
int main() {
  int T, _ = 0;
  int n, m;
  int i, j, k;
  double x;
  scanf("%d %d %lf", &n, &m, &x);
  up = x * 100 + 0.5;
  in(n);
  in_(m);
  n = mp.size();
  printf("%d\n", n);
  for (it = mp.begin(); it != mp.end(); it++) {
    cout << it->first << " " << it->second << endl;
  }
  return 0;
}
