#include <bits/stdc++.h>
const double ebs = 1e-7;
using namespace std;
int main() {
  int n, m;
  double k;
  cin >> n >> m >> k;
  vector<pair<string, double>> skills;
  for (int i = 0; i < n; i++) {
    string s;
    double f;
    cin >> s >> f;
    f = f * k + ebs;
    if (f >= 100) skills.push_back(make_pair(s, f));
  }
  for (int i = 0; i < m; i++) {
    string s;
    double f;
    bool found = 0;
    cin >> s;
    for (int j = 0; j < skills.size(); j++)
      if (s == skills[j].first) found = 1;
    if (!found) {
      skills.push_back(make_pair(s, 0));
    }
  }
  sort(skills.begin(), skills.end());
  cout << skills.size() << endl;
  for (int i = 0; i < skills.size(); i++) {
    cout << skills[i].first << ' ' << int(skills[i].second) << endl;
  }
  return 0;
}
