#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  double k;
  cin >> n >> m >> k;
  vector<pair<string, int> > a, b;
  for (int i = 0; i < n; i++) {
    string s;
    int l;
    cin >> s >> l;
    l = (k * l + 0.000000001);
    if (l < 100) l = -1;
    a.push_back(make_pair(s, l));
  }
  for (int i = 0; i < m; i++) {
    string s;
    cin >> s;
    a.push_back(make_pair(s, 0));
  }
  sort(a.begin(), a.end());
  for (int i = 0; i < a.size(); i++) {
    if (a[i].second > 0) {
      b.push_back(make_pair(a[i].first, a[i].second));
    }
    if (a[i].second == 0 &&
        (i == a.size() - 1 || a[i + 1].first != a[i].first)) {
      b.push_back(make_pair(a[i].first, a[i].second));
    }
  }
  cout << b.size() << endl;
  for (int i = 0; i < b.size(); i++)
    cout << b[i].first << " " << b[i].second << endl;
  return 0;
}
