#include <bits/stdc++.h>
using namespace std;
const int oo = (int)2147483647;
const double PI = 2 * acos(0.0);
const long double eps = 1e-11;
int diri[] = {0, 1, 0, -1, 1, 1, -1, -1, 0};
int dirk[] = {1, 0, -1, 0, 1, -1, 1, -1, 0};
int main() {
  int n, m;
  double k;
  map<string, int> mp;
  cin >> n >> m >> k;
  k *= 100.0;
  k += eps;
  for (int i = ((int)0); i <= ((int)n - 1); i++) {
    string a;
    int b;
    cin >> a >> b;
    if (b * k / 100 > 100) mp[a] = b * k;
  }
  for (int i = ((int)0); i <= ((int)m - 1); i++) {
    string a;
    cin >> a;
    map<string, int>::iterator itt = mp.find(a);
    if (itt == mp.end()) mp[a] = 0;
  }
  cout << mp.size() << endl;
  for (__typeof(mp).begin() it = (mp).begin(); it != (mp).end(); it++)
    cout << it->first << " " << it->second / 100 << endl;
  return 0;
}
