#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  double k;
  cin >> n >> m >> k;
  map<string, int> mp;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    int x;
    cin >> x;
    if (k * x < 100) continue;
    mp[s] = k * x + (1e-6);
  }
  for (int i = 0; i < m; i++) {
    string s;
    cin >> s;
    if (!mp.count(s)) mp[s] = 0;
  }
  cout << mp.size() << '\n';
  for (auto x : mp) {
    cout << x.first << ' ' << x.second << '\n';
  }
  return 0;
}
