#include <bits/stdc++.h>
using namespace std;
map<string, int> mp;
int main() {
  int n, m;
  string s;
  double k, x;
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++) {
    cin >> s >> x;
    x *= k;
    if (x >= 100) mp[s] = (int)(x + 1e-6);
  }
  for (int i = 0; i < m; i++) {
    cin >> s;
    if (!mp[s]) mp[s] = 0;
  }
  cout << mp.size() << endl;
  for (auto p : mp) cout << p.first << " " << p.second << endl;
  return 0;
}
