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 <string>

using namespace std;

int main(int argc, const char * argv[])
{
    int shift = 1, i=0;
    string in,out;
    getline(cin,in);
    out = in;
    do {
        for (i=0; i<in.length(); i++) {
            if (in[i]!=' '&&in[i]!='.') {
                out[i] = ((in[i] - 'a' + shift) % 26) + 'a';
            }
        }
        if (out.find("the")!=std::string::npos||out.find("that")!=std::string::npos||out.find("this")!=std::string::npos) {
            break;
        }
        else
            shift++;
    } while (shift<=25);
    
    cout<<out<<endl;
    return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<string>
#include<cstdio>
#include<cstring>
using namespace std;
int main(){
  string str;
  char s[256];
  int w = 0;
  while(scanf("%c",&s[0]) != EOF){
    do {
      w++;
      scanf("%c",&s[w]);
    }while(s[w] != '\n');
    while(1){
      s[w] = '\0';
    
      for(int i=0;i<w;i++){
	if(s[i] != ' ' && s[i] != '.'){
	  s[i]++;
	  if(s[i]>'z')s[i] = s[i] - 'z' + 'a' - 1;
	}
      }
      if(strstr(s,"the") != NULL)break;
      if(strstr(s,"that") != NULL)break;
      if(strstr(s,"this") != NULL)break;
    }
    printf("%s\n",s);
    memset( s , 0 , sizeof(s) );
  }
}

C++: #include <algorithm>
#include <iostream>
#include <cstdio>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <string.h>
using namespace std;

#define ISEQ(c) (c).begin(), (c).end()
typedef long long ll;

int main() {
  char s[90];
  while (fgets(s, 81, stdin) != 0) {
    for (int i = 0; i < 26; i++) {
      for (int j = 0; j < strlen(s); j++) {
	if (isalpha(s[j])) {
	  if (s[j] == 'z') s[j] = 'a';
	  else s[j]++;
	}
      }
      if (strstr(s, "the") != NULL or strstr(s, "this") != NULL or strstr(s, "that") != NULL) break;
    }
    printf("%s\n", s);
  }
}

C++: #include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <fstream>
using namespace std;
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v;}
template<class T> inline string toStr(T x) { ostringstream sout; sout << x; return sout.str();}
typedef vector<int> vi;
typedef vector<vi>  vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n) FOR(i,0,(n)-1)
const double EPS = 1e-12;
const double PI = acos(-1.0);
const int INF = INT_MAX/10;
 
int main() {
    string s;
    while(getline(cin, s)) {
        REP(i, 26) {
            REP(j, s.length()) {
                if('a' <= s[j] && s[j] <= 'z') {
                    s[j]++;
                    if('z' < s[j]) {
                        s[j] -= 26;
                    }
                }
            }
 
            if(s.find("the") != string::npos) {
                cout << s << endl;
                goto next;
            } else if(s.find("this") != string::npos) {
                cout << s << endl;
                goto next;
            } else if(s.find("that") != string::npos) {
                cout << s << endl;
                goto next;
            }
        }
 
        next:;
    }
 
    return 0;
}

C++: #include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b) - 1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)

#define PB push_back
#define INF INT_MAX/3
#define ALL(a) (a).begin(),(a).end()
#define CLR(a) memset(a,0,sizeof(a))

typedef long long int ll;

using namespace std;

int main(){

    string s[] = {"the","this","that"};
    string in;
    while(true){
	getline(cin,in);
	if(cin.eof()) break;
	bool f = false;
	int d = 1;
	REP(i,30){

	    f = true;
	    REP(i,in.size()){
		if(in[i] == '.' || in[i] == ' ' || in[i] == '\n') continue;
		in[i]= (char)( 'a' + ( (int)(in[i] - 'a') + d) % 26);
	    }
	    vector<bool> flgs(3,false);
	    REP(j,3){
		if(in.substr(0,s[j].size()) == s[j] && in[s[j].size()] == ' ') flgs[j] = true;
	    }
	    for(int i=0;i<in.size();i++){
		if(in[i] == ' '){
		    REP(j,3){
			if(in.substr(i+1,s[j].size()) == s[j] && in[i + s[j].size() + 1] == ' ') flgs[j] = true;
		    }
		}
	    }
	    if(flgs[0] || flgs[1] || flgs[2]) break;
	}
	cout << in << endl;
    }

    return 0;
}

C++: #include <string>
#include <vector>
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <map>
#define INF 100000000
#define rep(i,a) for(int i=0;i<(a);i++)

using namespace std;
typedef long long ll;

char p(char ch){
    char ret=ch+1;
    if(ret==('{'))ret='a';
    return ret;
}


int main(){
    string s;
    getline(cin,s);


    rep(i,30){
        rep(i,s.size()){
            if(s[i]!=' ' && s[i]!='.'){
                s[i]=p(s[i]);
            }
        }

        if( s.find("the",0)!=-1 || s.find("this",0)!=-1 || s.find("this",0)!=-1 ){
            break;
        }
    }
    cout<<s<<endl;
    
    return 0;
    
}

C++: #include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main(){
  string s;
  int pl=0;
  getline(cin,s);
  for(int i =-27;i<27;i++){
    for(int j = 0; j < s.size() - 3; j++){
      if(s[j]+i=='t' &&s[j+1]+i == 'h' && s[j+2]+i == 'e'){
	pl = i;
	break;
      }
      else if(s[j]+i=='t' &&s[j+1]+i == 'h' && s[j+2]+i == 'a' && s[j+3]=='t'){
	pl = i;
	break;
      }
      else if(s[j]+i=='t' &&s[j+1]+i == 'h' && s[j+2]+i == 'i' && s[j+3]=='s'){
	pl = i;
	break;
      }
      if(pl!=0) break;
    }
  }
  for(int i=0;i <s.size();i++){
    if(s[i]<='z' && s[i]>='a'){
      s[i] += pl;
    }
  }
  cout<<s<<endl;
}

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

using namespace std;

int main() {
    string input;
    const int alph_lim = 26;

    while (getline(cin, input, '\n')) {
        for (int i = 0; i < alph_lim; i++) {
            for (int j = 0; j < input.size(); j++){
                if(islower(input[j])) {
                    input[j]++;
                    if (input[j] > 'z') {
                        input[j] -= alph_lim;
                    }
                }
            }

            if (input.find("this") != string::npos
                || input.find("that") != string::npos
                || input.find("ths") != string::npos) {

                cout << input << endl;
                break;
            }
        }
    }
}

C++: #include <stdio.h>
int main(){
char c;
while(scanf("%c",&c)!=EOF){
if(c-'a'==0)printf("z");
else if(c-'a'>0&&c-'a'<26)printf("%c",c-1);
else printf("%c",c);
}
}