#include <bits/stdc++.h>
using namespace std;
map<string, int> ma;
map<string, int>::iterator p;
long i, n, m;
double ex, k;
int main() {
  cin >> n >> m >> k;
  string st;
  for (i = 1; i <= n; i++) {
    cin >> st >> ex;
    ma[st] = (int)(ex * k + 1e-9);
    if (ma[st] < 100) ma.erase(st);
  }
  for (i = 1; i <= m; i++) {
    cin >> st;
    ma[st] += 0;
  }
  cout << ma.size() << endl;
  for (p = ma.begin(); p != ma.end(); p++)
    cout << p->first << " " << p->second << endl;
  return 0;
}
