#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
int lcm(int a, int b) { return abs(a * b) / gcd(a, b); }
const int inf = (int)1e9;
const int mod = inf + 7;
const double eps = 1e-9;
const int N = 2e5 + 10;
int a[N];
int b[N];
void solve() {
  int n, m;
  double k;
  cin >> n >> m >> k;
  map<string, int> can;
  for (int i = 0; i < n; i++) {
    string s;
    int exp;
    cin >> s >> exp;
    int trans = (int)(k * exp + eps);
    if (trans < 100) continue;
    can[s] = trans;
  }
  for (int i = 0; i < m; i++) {
    string s;
    cin >> s;
    if (can.find(s) == can.end()) can[s] = 0;
  }
  cout << (int)can.size() << endl;
  for (auto x : can) cout << x.first << " " << x.second << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  for (int i = 1; i <= t; i++) solve();
  return 0;
}
