#include <map>
#include <string>
#include <iostream>
#include <iomanip>
#include <fstream>

using namespace std;

int main(int argc, char* argv[]) {
  map<string, int> points;

  ifstream names(argv[1]);
  string s;
  while (names >> s) points[s];

  cout << "Teilnehmer  Punkte:" << endl;
  int n;
  while (cin >> s >> n) {
    if (points.find(s) != points.end())
      points[s] += n;
    else {
      char c;
      cout << "Neuer Teilnehmer (j/N)? "; cin >> c;
      if (c == 'j') points.insert(pair<string, int>{s, n});
    }
  }

  for (pair<string, int> entry: points)
    cout << setw(10) << entry.first
         << setw(3) << entry.second
         << endl;

  return 0;
}
