#include #include using namespace std; const int size = 23456; string data[size]; int mystery(string s) { int len = s.length(); unsigned int h = 1287545; for (int i = 0; i < len; i += 1) h = h * 69 + s[i]; if (h < 0) h = - h; return h % size; } void main() { while (true) { string s; cin >> s; if (cin.fail()) break; int h = mystery(s); cout << s << " " << h << "\n"; } }