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>

int search_number(const std::string &s)
{
    for (unsigned i = 0; i < s.size() - 3; ++i) {
        if (s[i] - s[i + 1] == 't' - 'h'
                && s[i + 1] - s[i + 2] == 'h' - 'i'
                && s[i + 2] - s[i + 3] == 'i' - 's')
            return s[i] - 't';
    }
    return 0;
}

int main()
{
    std::string s;
    while (getline(std::cin, s)) {
        int n = search_number(s);
        for (unsigned i = 0; i < s.size(); ++i) {
            if (s[i] != ' ' && s[i] != ',' && s[i] != '.') {
                s[i] -= n;
                if (s[i] < 'a') s[i] += 26;
                if (s[i] > 'z') s[i] %= 26;
            }
        }
        std::cout << s << std::endl;
    }
}

C++: #include <bits/stdc++.h>
#define rep(i,a,n) for(int i=a;i<n;i++)
#define repr(i,a,n) for(int i=a;i>=n;i--)
#define INF 999999999
#define INF_M 2147483647
#define pb(a) push_back(a)

using namespace std;
typedef pair<int, int> pii;
typedef long long int ll;
typedef vector<pii> VP;

int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};

int main() {
    string s;
    getline(cin,s);
    string t;
    rep(j,0,26) {
    	t.clear();
    	rep(i,0,s.length()) {
			if('a' <= s[i] && s[i] <= 'z') t += (s[i] + j > 'z') ? (s[i] + j - 26) : (s[i] + j);
			else t += s[i];
    	}
    	if(t.find("this") != string::npos) break;
    	else if(t.find("the") != string::npos) break;
    	else if(t.find("that") != string::npos) break;
    }
    cout << t << endl;
    return 0;
}

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

using namespace std;

string decode(string inp,int n){
    string in=inp;
    for(int i=0;i<in.length();i++){
        if('a'<=in[i]&&in[i]<='z'){
            
            in[i]=in[i]-n;
            if(in[i]<'a') in[i]+=('z'-'b');
        }
    }
    return in;
}


int main(){
    string input,decoded;
    while(getline(cin,input)){
        for(int i=0;i<26;i++){
            input=decode(input,1);
            if(input.find("the")!=string::npos||input.find("this")!=string::npos||input.find("that")!=string::npos){
                break;
            }
        }
        cout << input << endl;
    }
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;


int main()
{
   // freopen("input.txt","r",stdin);
    char str[] = "wxyzabcdefghijklmnopqrstuvwxyz";
    char c;
    while(scanf("%c",&c)!=EOF)
    {
        if(isalpha(c))
            cout << str[(int)c-'a'];
        else
            cout << c;
    }
    return 0;
}

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

using namespace std;

int main(){
	string str;
	while(getline(cin,str)){
		for(int num=0;num<26;num++){
			for(int i=0;i<str.length();i++){
				if(97<=str[i] && str[i]<=122){
					str[i]+=1;
					if(str[i]>122) str[i] -=26;
				}
			}
			string::size_type index1 = str.find("the");
			string::size_type index2 = str.find("this");
			string::size_type index3 = str.find("that");
		
			if( index1 == string::npos && index2 == string::npos &&
				index3 == string::npos){
				continue;
			}else{
				cout << str <<endl;
				break;
			}
		}
	}
	return 0;

}

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

using namespace std;

int main()
{
  string temp,mainstr;
  
  while(getline(cin,mainstr)){
    temp = mainstr;
    vector<string> str;
    int i,j,k,judge=0,gosuu=0;
    
    //入力を単語ごとに分割
    i=0;
    while(1){
      int index;
      index = temp.rfind(" ");
      
      if (index==-1){
	str.push_back(temp.substr(index+1));
	temp = temp.substr(0,temp.size()-str[i].size()-1);
	gosuu++;
	break;
      }else{
	str.push_back(temp.substr(index+1));
	temp = temp.substr(0,temp.size()-str[i].size()-1);
	gosuu++;
	i++;
      } 
    }
    
    //単語からピリオドを取り除く
    for(i=0;i<gosuu;i++){
      if (str[i].find(".")!=-1)
	str[i] = str[i].substr(0,str[i].size()-1);
    }
    
    //単語を変換してチェックしていく
    for(i=0;i<gosuu;i++){
      for(k=1;k<26;k++){
	
	//単語を1個ずらしたものに変換
	for(j=0;j<str[i].size();j++){
	  if (str[i][j] == 'z')
	    str[i][j] = 'a';
	  else
	    str[i][j] += 1;
	}
	
	if ((str[i]=="this")||(str[i]=="that")||(str[i]=="the")){
	  judge = 1;
	  break;
	}
	
      }
      if (judge==1) break;
    }
    
    //文章の変換
    
    for(j=0;j<k;j++){
      for(i=0;i<mainstr.size();i++){
	if ((mainstr[i]!=' ')&&(mainstr[i]!='.')){
	  if (mainstr[i] == 'z')
	    mainstr[i] = 'a';
	  else
	    mainstr[i] += 1;
	}
      }
    }
    //変換した文字の出力
    cout << mainstr <<endl;
    
    /*
    for(i=0;i<str.size();i++){
      cout << str[i] <<endl;
    }*/
    
  }

  return 0;
}

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

int main(int argc, const char * argv[])
{
    char input[60][40];
    int i = 0;
    int k, m, o, q, s, u;
    while (scanf("%s", input[i]) != EOF) {
        i++;
    }
    for (o = 0; o < 26; o++) {
        for (k = 0; k < i; k++) { //行分繰り返す
            for (m = 0; m < strlen(input[k]); m++) {//何文字目か
                if (isalpha(input[k][m])) {
                    input[k][m] += 1;
                    if (input[k][m] > 'z') {
                        input[k][m] -= 26;
                    }
                }
            }
        }
        for (s = 0; s < i; s++) {
            for (u = 0; u < strlen(input[s]); u++) {
                if (input[s][u] == 't') {
                    if (input[s][u + 1] == 'h') {
                        if (input[s][u + 2] == 'e' && u + 2 == strlen(input[s]) - 1) {
                            goto finish;
                        }
                        else if (input[s][u + 2] == 'i'){
                            if (input[s][u + 3] == 's' && u + 3 == strlen(input[s]) - 1) {
                                goto finish;
                            }
                        }
                        else if (input[s][u + 2] == 'a'){
                            if (input[s][u + 3] == 't' && u + 3 == strlen(input[s]) - 1) {
                                goto finish;
                            }
                        }
                    }
                }
            }
        }
    }
finish:
    for (q = 0; q < i; q++) {
        printf("%s", input[q]);
        if (q != i - 1) {
            printf(" ");
        }
    }
    puts("");
    return 0;
}

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

using namespace std;

string decode(string inp,int n){
    string in=inp;
    for(int i=0;i<in.length();i++){
        if(isalpha(in[i])){
            in[i]=in[i]+n;
            if(in[i]>'z') in[i]='a'+(in[i]-'z'-1);
        }
    }
    return in;
}
bool check(string inp){
    stringstream words(inp);
    string word;
    while(getline(words, word, ' ')){
        if(word=="the"||word=="this"||word=="that"||word=="the."||word=="this."||word=="that.")
            return true;
    }
    return false;
}

int main(){
    string input;
    while(getline(cin,input)){
        for(int i=0;i<=26;i++){
            if(check(input)){
                break;
            }
            input=decode(input,1);
        }
        cout << input << endl;
    }
    return 0;
}