#include <bits/stdc++.h>
using namespace std;
int i, j, k, m, n;
double c;
string s;
map<string, int> M;
int main() {
  cin >> n >> m >> c;
  for (i = 0; i < n; i++) {
    cin >> s >> k;
    j = (k * c + 1e-10);
    if (j >= 100) M[s] = j;
  }
  for (i = 0; i < m; i++) {
    cin >> s;
    if (!M.count(s)) M[s] = 0;
  }
  cout << M.size() << endl;
  for (map<string, int>::iterator it = M.begin(); it != M.end(); it++)
    cout << it->first << " " << it->second << endl;
  return 0;
}
