// here's code fragments useful for the sample problems

// sample problem 1

#include <map>
#include <vector>
#include <algorithm>
using namespace std;


vector<pair<int, string>> theList;

// read in names and strings
// negate the heights so they are sorted in the desired order
// first element of pair is height, since that is more important
int i;
string s;
while(cin >> i >> s) theList.push_back(make_pair(-i, s));
sort(theList.begin(), theList.end());



// sample problem 2
// using next permutation to try all word twists
#include <algorithm>
#include <string>
using namespace std;

cin >> word;
sort(word.begin(), word.end());
do {
    if (isGoodWord(word)) cout << word;
} while(next_permutation(word.begin(), word.end()));


// sample problem 3
#include <algorithm>
#include <string>
#include <map>
using namespace std;

// using sorting and a map to remember the answers
map<string, string> memory;
string problem, answer;
while(cin >> problem >> answer) {
  sort(problem.begin(), problem.end());
  memory[problem] = answer;
}
string newProblem;
while(cin >> newProblem) {
  sort(newProblem.begin(), newProblem.end());
  if (memory.count(newProblem) > 0) {
    cout << memory[newProblem] << endl;
  }
  else cout << "I am stumped." << endl;
}
