#include <bits/stdc++.h>
using namespace std;
long long bin_pow(long long a, long long b) {
  if (b == 0) return 1;
  if (b % 2 == 0) {
    long long t = bin_pow(a, b / 2);
    return t * t % 1000000007;
  } else
    return a * bin_pow(a, b - 1) % 1000000007;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long t = 1, n, m, k = 0, x = 0, y = 0, z = 0, sum = 0, l = 0, r = 0,
            ans = 0, mn = LLONG_MAX, mx = LLONG_MIN;
  string s;
  cin >> n >> m >> s;
  k = (s[2] - '0') * 10 + s[3] - '0';
  vector<pair<string, long long>> a(n), c;
  vector<string> b(m);
  for (int i = 0; i < n; i++) {
    cin >> a[i].first >> a[i].second;
    a[i].second *= k;
    a[i].second /= 100;
    if (a[i].second >= 100) c.push_back({a[i].first, a[i].second});
  }
  vector<string> d(c.size());
  sort(c.begin(), c.end());
  for (int i = 0; i < c.size(); i++) d[i] = c[i].first;
  for (int i = 0; i < m; i++) {
    cin >> b[i];
    z = lower_bound(d.begin(), d.end(), b[i]) - d.begin();
    if (z != d.size() && d[z] == b[i]) {
    } else
      c.push_back({b[i], 0});
  }
  sort(c.begin(), c.end());
  cout << c.size() << "\n";
  for (auto u : c) cout << u.first << " " << u.second << "\n";
  return 0;
}
