#include <bits/stdc++.h>
using namespace std;
string s2[30], temps;
vector<pair<string, int> > ans, s;
int main() {
  ios_base::sync_with_stdio(0);
  int n, m, k = 0, l1, l2, len, tempa;
  double k1;
  cin >> n >> m >> k1;
  for (int i = 0; i < n; i++) {
    cin >> temps >> tempa;
    tempa = (int)(tempa * k1 + 0.000000001);
    if (tempa >= 100) {
      s.push_back(make_pair(temps, tempa));
      k++;
    }
  }
  for (int i = 0; i < m; i++) cin >> s2[i];
  sort(s.begin(), s.end());
  sort(s2, s2 + m);
  l1 = l2 = 0;
  while (l1 < k && l2 < m) {
    if (s[l1].first < s2[l2]) {
      ans.push_back(make_pair(s[l1].first, s[l1].second));
      l1++;
    } else if (s[l1].first > s2[l2]) {
      ans.push_back(make_pair(s2[l2], 0));
      l2++;
    } else {
      ans.push_back(make_pair(s[l1].first, s[l1].second));
      l1++;
      l2++;
    }
  }
  while (l1 < k) {
    ans.push_back(make_pair(s[l1].first, s[l1].second));
    l1++;
  }
  while (l2 < m) {
    ans.push_back(make_pair(s2[l2], 0));
    l2++;
  }
  len = ans.size();
  cout << len << "\n";
  for (int i = 0; i < len; i++)
    cout << ans[i].first << " " << ans[i].second << "\n";
  return 0;
}
