#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  double k;
  cin >> n >> m >> k;
  map<string, int> ans;
  string skill;
  int level;
  double result;
  int i;
  for (i = 0; i < n; i++) {
    cin >> skill >> level;
    if (level < 100 || level * k < 100)
      continue;
    else {
      result = level * k;
      result = result + 1e-6;
    }
    ans.insert({skill, (int)result});
  }
  for (i = 0; i < m; i++) {
    cin >> skill;
    ans.insert({skill, 0});
  }
  cout << ans.size() << "\n";
  for (auto it : ans) cout << it.first << " " << it.second << "\n";
  return 0;
}
