#include <bits/stdc++.h>
using namespace std;
struct skill {
  string name;
  int exp;
  bool operator<(const skill t) const { return name < t.name; }
} a[30], b[60];
int n, m;
double k;
string mz;
bool ok;
int main() {
  int i, j = 0, l;
  cin >> n >> m >> k;
  for (i = 1; i <= n; i++) cin >> a[i].name >> a[i].exp;
  for (i = 1; i <= n; i++) {
    if (a[i].exp * k < 100) continue;
    j++;
    b[j] = a[i];
    b[j].exp = int(b[j].exp * k + 1e-6);
  }
  for (i = 1; i <= m; i++) {
    ok = false;
    cin >> mz;
    for (l = 1; l <= j; l++)
      if (b[l].name == mz) {
        ok = true;
        break;
      }
    if (ok) continue;
    j++;
    b[j].name = mz;
    b[j].exp = 0;
  }
  cout << j << endl;
  sort(b + 1, b + j + 1);
  for (i = 1; i <= j; i++) cout << b[i].name << " " << b[i].exp << endl;
  return 0;
}
