#include <bits/stdc++.h>
using namespace std;
map<string, int> mp;
int n, m, co;
float k;
char tmp[111];
vector<pair<string, int> > v;
int main() {
  v.clear();
  mp.clear();
  char tt[11];
  scanf("%d%d%s", &n, &m, tt);
  int h = 0;
  for (int i = 2; i < 4; i++) {
    h += (tt[i] - '0');
    h *= 10;
  }
  h /= 10;
  int f = h;
  for (int i = 0; i < n; i++) {
    scanf("%s%d", tmp, &co);
    co = (int)float(co) * f;
    co /= 100;
    if (co >= 100) mp[tmp] = co;
  }
  for (int i = 0; i < m; i++) {
    scanf("%s", tmp);
    if (mp[tmp] == 0) mp[tmp] = 0;
  }
  printf("%d\n", mp.size());
  for (map<string, int>::iterator it = mp.begin(); it != mp.end(); it++)
    printf("%s %d\n", it->first.c_str(), (int)it->second);
}
