#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <cmath>
#include <random>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define FOR(i,a,b) for(int (i)=(a); (i)<(b); (i)++)

char affinechar(char c, int a, int b) {
    if (islower(c)) {
        return 'a' + (a * (c - 'a') + b) % 26;
    }else {
        return c;
    }
}

void affineconv(string &s, int a, int b) {
    REP(i,s.size()) {
        s[i] =  affinechar(s[i], a, b);
    }
}

bool isEnglish(string s) {
    return s.find("that") != string::npos || s.find("this") != string::npos;
}

random_device rnd;

int rnda() {
    int a = rnd();
    a = abs(a) % 26;
    if (a % 2 == 0 || a % 13 == 0) {
        return rnda();
    }else {
        return a;
    }
}

int rndb() {
    return rnd() % 26;
}

int main() {
    string s;
    while(getline(cin, s)) {
        if (s.size() > 3) {
            while (!isEnglish(s)) {
                affineconv(s, rnda(), rndb());
                //cout << s << endl;
            }
            cout << s << endl;
        }
    }
    return 0;
}