#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  double y;
  cin >> n >> m >> y;
  map<string, int> mp;
  for (int i = 0; i < n; i++) {
    string s;
    int v;
    cin >> s >> v;
    int x = (v * y) + 0.0001;
    if (x >= 100) {
      mp[s] = x;
    }
  }
  for (int i = 0; i < m; i++) {
    string s;
    cin >> s;
    if (mp[s] == 0) {
      mp[s] = 0;
    }
  }
  cout << mp.size() << "\n";
  for (auto i : mp) {
    cout << i.first << " " << i.second << "\n";
  }
}
