#include <bits/stdc++.h>
using namespace std;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	
	string murc, vic;
	set<string> s;
	map<string, int> mp;
	while (cin >> murc >> vic) {
		mp[murc]++;
		s.insert(vic);
	}
	cout << "HALL OF MURDERERS\n";
	for (auto it : mp) {
		if (!s.count(it.first))
			cout << it.first << " " << it.second << "\n";
	}
}