#include <bits/stdc++.h>
using namespace std;
int N, M;
double K;
map<string, int> skill;
int main() {
  cin >> N >> M >> K;
  for (int i = 0; i < N; i++) {
    string name;
    int exp;
    cin >> name >> exp;
    if (exp * K + 0.000001 >= 100) skill[name] = exp * K + 0.000001;
  }
  for (int i = 0; i < M; i++) {
    string name;
    cin >> name;
    skill[name] = max(skill[name], 0);
  }
  cout << skill.size() << endl;
  for (map<string, int>::iterator it = skill.begin(); it != skill.end(); it++)
    cout << it->first << " " << it->second << endl;
  return 0;
}
