#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  double k;
  cin >> n >> m >> k;
  map<string, int> skills;
  for (int i = 0; i < n; i++) {
    string s;
    int l;
    cin >> s >> l;
    skills[s] += l;
  }
  for (auto cur : skills) skills[cur.first] = cur.second * k + eps;
  set<string> news;
  while (m--) {
    string s;
    cin >> s;
    if (!skills[s] || skills[s] < 100) skills[s] = 0;
    news.insert(s);
  }
  vector<pair<string, int>> ans;
  for (auto cur : skills) {
    if (news.find(cur.first) != news.end()) {
      ans.push_back({cur.first, cur.second});
      continue;
    }
    if (cur.second >= 100) ans.push_back({cur.first, cur.second});
  }
  cout << ans.size() << '\n';
  for (auto cur : ans) cout << cur.first << " " << cur.second << '\n';
  return 0;
}
