Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func incrementByte(b byte) byte {
	if b >= 97 && b < 122 {
		return b + 1
	} else if b == 122 {
		return 97
	}
	return b
}

func main() {
	scanner.Split(bufio.ScanLines)

	for {
		line := nextString()
		if len(line) == 0 {
			break
		}
		for i := 0; i <= 26; i++ {
			decoded := []byte{}
			for j := 0; j < len(line); j++ {
				decoded = append(decoded, incrementByte(line[j]))
			}
			line = string(decoded)
			if strings.Contains(line, "the") || strings.Contains(line, "this") || strings.Contains(line, "that") {
				fmt.Println(line)
				break
			}
		}
	}
}

C++: #include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;
 
string solve(string s)
{
    int n = s.size();
    for(;;){
        for(int i=0; i<n; ++i){
            if('a' <= s[i] && s[i] <= 'z'){
                if(s[i] == 'z')
                    s[i] = 'a';
                else
                    ++ s[i];
            }
        }
        istringstream iss(s);
        string s1;
        while(iss >> s1){
            if(s1 == "the" || s1 == "this" || s1 == "that")
                return s;
        }
    }
}
 
int main()
{
    for(;;){
        string s;
        getline(cin, s);
        if(s == "")
            return 0;
 
        cout << solve(s) << endl;
    }
}

C++: #include <iostream>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <stdlib.h>
#include <vector>

using namespace std;


int main(){

	string line;

	while(getline(cin, line)){

		string str[80], ans[80];
		int count = 0;
		int flag = 0;
		int slide;

		//???????????????
		/*
		string temp;
		for(int i=0 ; i<line.size()-1 ; i++){
			temp += line[i];
		}
		line = temp;
		*/
		

		//???????????????????????¨???????´?
		for(int i=0 ; i<line.size() ; i++){
			if(line[i] == ' '){
				count++;
			}else{
				str[count] += line[i];
				ans[count] = str[count];
			}
		}
		count++;


		for(int i=1 ; i<=26 ; i++){
			for(int j=0 ; j<count ; j++){
				for(int k=0 ; k<str[j].size() ; k++){
					if(str[j][k] != '.'){
						str[j][k]++;
						if(str[j][k] > 'z'){
							str[j][k] = str[j][k] - 'z' + 'a' -1;
						}
					}
					if(str[j][k] == 'h' && str[j][k-1] == 't'){
						flag = 1;
						slide = i;
						break;
					}
				}

				/*
				if(str[j] == "this" || str[j] == "the" || str[j] == "that"
						|| str[j] == "this." || str[j] == "the." ||str[j] == "that."){
					flag = 1;
					slide = i;
					break;
				}
				*/
			}
			if(flag == 1)break;
		}

		for(int i=0 ; i<count ; i++){
			for(int j=0 ; j<ans[i].size() ; j++){
				if(ans[i][j] != '.'){
					if((ans[i][j] + slide) > 'z' ){
						ans[i][j] = ans[i][j] - 'z' + 'a' + slide -1;
					}else{
						ans[i][j] = ans[i][j] + slide ;
					}
				}
			}
		}

		for(int i=0 ; i<=count ; i++){
			cout << ans[i];
			if(i < count) cout << ' ';
		}
		cout << endl;

	}
	return 0;
}

C++: #include<iostream>
#include<string>

using namespace std;

int main() {
	string str, str2, ans;
	int i, j, l, n = 0;
	while (getline(cin, str)) {
		ans += str;
		ans += '\n';
		if (n != 0) {
			continue;
		}
		l = str.length();
		str2.resize(l);
		for (i = 1; i < 26; i++) {
			for (j = 0; j < l; j++) {
				if (str[j] == '.'||str[j]==' '||str[j]=='\n') {
					continue;
				}
				if (str[j] + i > 'z') {
					str2[j] = str[j] - 26 + i;
				}
				else {
					str2[j] = str[j] + i;
				}
			}
			if (str2.find("the") != string::npos || str2.find("this") != string::npos || str2.find("that") != string::npos) {
				n = i;
				break;
			}
		}
	}
	l = ans.length();
	for (i = 0; i < l; i++) {
		if (ans[i] == '.' || ans[i] == ' ' || ans[i] == '\n') {
			continue;
		}
		if (ans[i] + n > 'z') {
			ans[i] = ans[i] - 26 + n;
		}
		else {
			ans[i] = ans[i] + n;
		}
	}
	cout << ans;
	return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;

bool find(string str, string can) {
  string tmp_can = ' ' + can + ' ';
  string tmp_str = ' ' + str + ' ';
  for (int i = 0; i < tmp_str.length(); ++i) {
    if (string::npos != tmp_str.find(tmp_can, i)) {
      return true;
    }
  }
  return false;
}

int main() {
  string str;
  string candies[] = {"this", "the", "that"};
  while(getline(cin, str)) {
  for (int m = 0; m < 25; ++m) {
    for (int i = 0; i < str.length(); ++i) {
      if (str[i] == ' ') {
        continue;
      }
      if (str[i] == ',' || str[i] == '.') {
        str[i] = ' ';
        continue;
      }
      int char_id = static_cast<int>(str[i]) - 97;
      int shifted = static_cast<int>(char_id + 1);
      str[i] = static_cast<char>(shifted % 26 + 97);
    }
    for (int i = 0; i < sizeof(candies) / sizeof(candies[0]); ++i) {
      if (find(str, candies[i])) {
        cout << str << endl;
        break;
      }
    }
  }
  }
  return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <cstring>
#include <functional>

using namespace std;

#define REP(i,a,b) for((i)=(a);(i)<(int)(b);(i)++)
#define rep(i,n) REP(i,0,n)
// BEGIN CUT HERE
#define foreach(itr,c) for(typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
template<class T> inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}
// END CUT HERE

int main(){
  int i, j;
  string str;

  while(getline(cin,str)){
    int N = str.size();

    while(1){
      rep(i,N) if(str[i] != '.' && str[i] != ' ') str[i]--;
      rep(i,N) REP(j,i,N){
        if(str.substr(i,j) == "this" || str.substr(i,j) == "the" || str.substr(i,j) == "that"){
          cout << str << endl;
          return 0;
        }
      }
    }
  }

  return 0;
}

C++: #include <iostream>
#include <complex>
#include <cmath>
#include <cstdio>
#include <string>
#include <sstream>

using namespace std;

string rotate(string str) {
    for (int i = 0; i < str.size(); i++) {
        if ('a' <= str[i] && str[i] < 'z')str[i]++;
        else if (str[i] == 'z')str[i] = 'a';
    }
    return str;
}

int main() {
    string str;
    while(getline(cin, str)) {
        for (int i = 0; i < 26; i++) {
            str = rotate(str);
            string tmp;
            bool flg = false;
            for (int i = 0; i < str.size(); i++) {
                if (str[i] != '.')tmp += str[i];
            }
            stringstream ss(tmp);
            while(ss >> tmp) {
                if (tmp == "the" || tmp == "this" || tmp == "that")flg = true;
                break;
            }
            if (flg) {
                cout << str << endl;
                break;
            }
            if (i == 25)return 1;
        }
    }
    return 0;
}
#include <iostream>
#include <complex>
#include <cmath>
#include <cstdio>
#include <string>
#include <sstream>

using namespace std;

string rotate(string str) {
    for (int i = 0; i < str.size(); i++) {
        if ('a' <= str[i] && str[i] < 'z')str[i]++;
        else if (str[i] == 'z')str[i] = 'a';
    }
    return str;
}

int main() {
    string str;
    while(getline(cin, str)) {
        for (int i = 0; i < 26; i++) {
            str = rotate(str);
            string tmp;
            bool flg = false;
            for (int i = 0; i < str.size(); i++) {
                if (str[i] != '.')tmp += str[i];
            }
            stringstream ss(tmp);
            while(ss >> tmp) {
                if (tmp == "the" || tmp == "this" || tmp == "that")flg = true;
                break;
            }
            if (flg) {
                cout << str << endl;
                break;
            }
        }
    }
    return 0;
}