#include <bits/stdc++.h>
using namespace std;
int n, m, k;
map<string, int> A;
int main() {
  scanf("%i %i 0.%i", &n, &m, &k);
  char T[30];
  int j = 0;
  for (int i = 0; i < n; ++i) {
    scanf("%s %i", T, &j);
    j = j * k / 100;
    if (j >= 100) A[T] = j;
  }
  for (int i = 0; i < m; ++i) {
    scanf("%s", T);
    if (A.count(T) == 0) A[T] = 0;
  }
  map<string, int>::iterator I = A.begin();
  int z = A.size();
  cout << z << endl;
  for (; I != A.end(); ++I) {
    cout << I->first << " " << I->second << endl;
  }
  return 0;
}
