#include <bits/stdc++.h>
using namespace std;
template <class A, class B>
A cvt(B x) {
  stringstream ss;
  ss << x;
  A y;
  ss >> y;
  return y;
}
int main() {
  int n, m, k, x;
  string s;
  double kd;
  cin >> n >> m >> kd;
  k = (int)round(kd * 100);
  map<string, int> skills;
  for (int i = 0; i < n; i++) {
    cin >> s >> x;
    int y = x * k / 100;
    if (y >= 100) skills[s] = y;
  }
  for (int i = 0; i < m; i++) {
    cin >> s;
    if (skills.count(s) == 0) skills[s] = 0;
  }
  cout << skills.size() << endl;
  for (typeof(skills.begin()) it = skills.begin(); it != skills.end(); it++) {
    cout << it->first << " " << it->second << endl;
  }
  return 0;
}
