#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  long double k;
  cin >> n >> m >> k;
  cout << std::setprecision(5);
  vector<pair<string, int> > vect;
  for (int i = 0; i < n + m; i++) {
    string skill;
    cin >> skill;
    if (i < n) {
      long double lvl;
      cin >> lvl;
      lvl = k * lvl;
      if (lvl < 100) {
        lvl = -1;
        vect.push_back(make_pair(skill, -1));
      } else {
        vect.push_back(make_pair(skill, lvl + 0.001));
      }
    } else {
      vect.push_back(make_pair(skill, 0));
    }
  }
  sort(vect.begin(), vect.end());
  int no = 0;
  for (int i = 0; i < n + m; i++) {
    int j = i;
    while (j + 1 < n + m && vect[i].first == vect[j + 1].first &&
           vect[i].second > -1) {
      vect[i].second += vect[j + 1].second;
      vect[j + 1].second = -4;
      vect[j + 1].first = '-1';
      j++;
    }
    if (vect[i].second > -1) {
      no++;
    }
  }
  cout << no << endl;
  for (int i = 0; i < n + m; i++) {
    if (vect[i].second >= 0) {
      cout << std::setprecision(5) << vect[i].first << " " << vect[i].second
           << endl;
    }
  }
  return 0;
}
