#include <bits/stdc++.h>
using namespace std;
int main() {
  int spam1;
  char spam2;
  int n, m, k;
  cin >> n >> m >> spam1 >> spam2 >> k;
  vector<pair<string, int> > res;
  set<string> st;
  for (int i = 0; i < n; ++i) {
    string s;
    int t;
    cin >> s >> t;
    t = t * k / 100;
    if (t >= 100) {
      res.push_back(pair<string, int>(s, t));
      st.insert(s);
    }
  }
  for (int i = 0; i < m; ++i) {
    string s;
    cin >> s;
    if (st.find(s) != st.end()) continue;
    res.push_back(pair<string, int>(s, 0));
  }
  sort(res.begin(), res.end());
  cout << res.size() << endl;
  for (int i = 0; i < res.size(); ++i)
    cout << res[i].first << " " << res[i].second << endl;
}
