#include <bits/stdc++.h>
using namespace std;
int n, m;
double k;
map<string, int> mp;
struct Node {
  string name;
  int exp;
  friend bool operator<(const Node n1, const Node n2) {
    if (n1.name != n2.name)
      return n1.name < n2.name;
    else
      return n1.exp > n2.exp;
  }
} p[110];
int main() {
  cin >> n >> m >> k;
  int cnt = 0;
  int res = 0;
  for (int i = 0; i < n; i++) {
    string s;
    int hehe;
    cin >> s >> hehe;
    double tmp = 1.0 * hehe * k;
    int hh = tmp;
    if (tmp - hh >= 0.999) hh++;
    if (hh < 100) continue;
    p[cnt].name = s;
    p[cnt++].exp = hh;
    mp[s] = 1;
    res++;
  }
  for (int i = 0; i < m; i++) {
    cin >> p[cnt].name;
    p[cnt].exp = 0;
    if (mp.find(p[cnt].name) == mp.end()) {
      mp[p[cnt].name] = 1;
      res++;
    }
    cnt++;
  }
  sort(p, p + cnt);
  cout << res << endl;
  for (int i = 0; i < cnt; i++) {
    if (p[i].exp == 0) {
      if (i - 1 >= 0 && p[i].name != p[i - 1].name)
        cout << p[i].name << " " << p[i].exp << endl;
      if (i == 0) cout << p[i].name << " " << p[i].exp << endl;
    } else
      cout << p[i].name << " " << p[i].exp << endl;
  }
  return 0;
}
