#include <bits/stdc++.h>
using namespace std;
struct skill {
  int exp;
  string name;
};
bool check(skill i, skill j);
int n;
int m;
int k;
vector<skill> S;
vector<skill> s;
int Max;
vector<skill> print;
int main() {
  cin >> n;
  cin >> m;
  char a;
  char b;
  cin >> a;
  cin >> b;
  cin >> k;
  Max = m + n;
  for (int i = 0; i < n; i++) {
    skill x;
    cin >> x.name;
    cin >> x.exp;
    S.push_back(x);
  }
  for (int i = 0; i < m; i++) {
    skill x;
    cin >> x.name;
    x.exp = 0;
    s.push_back(x);
  }
  for (int i = 0; i < S.size(); i++) {
    S[i].exp = (((S[i].exp) * k) / 100);
    if (S[i].exp < 100) {
      S[i].exp = -1;
      Max--;
    }
  }
  for (int i = 0; i < s.size(); i++) {
    for (int j = 0; j < S.size(); j++) {
      if (S[j].name == s[i].name && S[j].exp != -1) {
        s[i].exp = -1;
        Max--;
      }
    }
  }
  cout << Max << endl;
  for (int i = 0; i < S.size(); i++) {
    if (S[i].exp != -1) {
      print.push_back(S[i]);
    }
  }
  for (int i = 0; i < s.size(); i++) {
    if (s[i].exp != -1) {
      print.push_back(s[i]);
    }
  }
  sort(print.begin(), print.end(), check);
  for (int i = 0; i < print.size(); i++) {
    cout << print[i].name << " " << print[i].exp << endl;
  }
}
bool check(skill i, skill j) {
  if (i.name <= j.name) {
    return true;
  }
  return false;
}
