#include #include #include #include #include using namespace std; string strip(string & s) { string t; // strip non-alpha characters for(int i = 0; i < s.length(); i++) if(isalpha(s[i])) { t += s[i]; } return t; } string encrypt(string input, int key, int offset, int length) { for(int i = 0; i < length; i++) { string e; for(int j = 0; j < input.length(); j++) { e += (char)(((input[j] - 'a') + key) % 26 + 'a'); } input = e; key += offset; } return input; } void test(string s, string e) { s = strip(s); for(int i = 0; i <= 25; i++) { string test = encrypt(s, i, 0, 1); if(test == e) { cout << i << " " << 0 << " " << 1 << endl; return; } } } int main() { while(!cin.eof()) { char s[80], e[80]; cin.getline(s, 80); cin.getline(e, 80); string s1(s), e1(e); test(s1, e1); } return 0; }