#include <bits/stdc++.h>
#pragma GCC optimize("O2")
#pragma comment(linker, "/STACK:16777216")
using namespace std;
const int N = 1001;
const double eps = 1e-6;
struct T {
  string s;
  int v;
} temp;
bool cmp(const T& x, const T& y) { return x.s < y.s; }
vector<T> ans;
int n, m;
double k;
int main() {
  while (cin >> n >> m >> k) {
    ans.clear();
    for (int i = 0; i < n; ++i) {
      cin >> temp.s >> temp.v;
      temp.v = (int)(temp.v * k + eps);
      if (temp.v < 100) temp.v = 0;
      if (temp.v) ans.push_back(temp);
    }
    string temps;
    for (int i = 0; i < m; ++i) {
      cin >> temps;
      bool has = false;
      for (int j = 0; j < ans.size(); ++j) {
        if (temps == ans[j].s) has = true;
      }
      if (has == false) {
        temp.s = temps;
        temp.v = 0;
        ans.push_back(temp);
      }
    }
    sort(ans.begin(), ans.end(), cmp);
    cout << ans.size() << endl;
    for (int i = 0; i < ans.size(); ++i)
      cout << ans[i].s << " " << ans[i].v << endl;
  }
}
