Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	for scanner.Scan() {
		var result string
		line := scanner.Text()
		key := make(map[string]string)

		var i int32
		for ; i < 52; i++ {
			makeKey(key, i)
			result = decode(key, line)

			if strings.Contains(result, "the") {
				break
			} else if strings.Contains(result, "this") {
				break
			} else if strings.Contains(result, "that") {
				break
			}
		}

		fmt.Println(result)
	}
}

func makeKey(key map[string]string, shift int32) {
	for i := 'a'; i <= 'z'; i++ {
		cipher := (i + shift)
		if cipher > 'z' {
			cipher = cipher%'z' + 'a' - 1
		} else if cipher < 'a' {
			cipher = cipher + ('z' - 'a') + 1
		}
		key[string(i)] = string(cipher)
	}
}

func decode(key map[string]string, cipher string) string {
	var result string
	for _, v := range cipher {
		if key[string(v)] != "" {
			result += key[string(v)]
		} else {
			result += string(v)
		}
	}
	return result
}

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

using namespace std;

int main()
{
  char s[81];

  while(gets(s) != NULL){

    int len = strlen(s);
    
    if(strstr(s,"this") || strstr(s,"that") || strstr(s,"the")){
      cout << s << endl;
      continue;
    }
    
    for(int i = 0;i < len;i++){
      for(int j = 0;j < len;j++){
	if(s[j] >= 'a' && s[j] <= 'z'){
	  if(s[j]+1 > 'z'){
	    s[j] = 'a';
	  }
	  else{
	    s[j]++; 
	  }
	}
      }
      if(strstr(s,"this") || strstr(s,"that") || strstr(s,"the")){
	cout << s << endl;
	break;
      }
    }
  }
}

C++: #include<iostream>
#include<cstring>
#include<cstdio>
using namespace std;
int main(){
	int f = 0,i;
	for(;;){
		char word[100]={0};
		for(i=0;;i++){
			if(scanf("%c",&word[i]) == EOF){f = 1;word[i]=10; break;}
			if(word[i] == 10){break;}
		}
		for(;;){
			for(i=0;i<(int)strlen(word);i++){
				if(word[i] == 't' && word[i+1] == 'h' && word[i+2] == 'i' && word[i+3] == 's' && word[i+4] == ' '){break;}
				else if(word[i] == 't' && word[i+1] == 'h' && word[i+2] == 'a' && word[i+3] == 't' && word[i+4] == ' '){break;}
				else if(word[i] == 't' && word[i+1] == 'h' && word[i+2] == 'e' && word[i+3] == ' '){break;}
				else if(word[i] == 't' && word[i+1] == 'h' && word[i+2] == 'i' && word[i+3] == 's' && word[i+4] == '\n'){break;}
				else if(word[i] == 't' && word[i+1] == 'h' && word[i+2] == 'a' && word[i+3] == 't' && word[i+4] == '\n'){break;}
				else if(word[i] == 't' && word[i+1] == 'h' && word[i+2] == 'e' && word[i+3] == '\n'){break;}
			}
			if(i != (int)strlen(word)){cout<<word;break;}
			for(i=0;i<(int)strlen(word);i++){
				if(word[i]==122){word[i]=97;}
				else if(word[i]>=97 && word[i]<122){word[i]++;}
			}
		}
		if(f == 1){break;}
	}
	return 0;
}

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

using namespace std;

bool CheckText(string x)
{
    if(x.find("this") < x.length())
    {
        return false;
    }
    else if(x.find("the") < x.length())
    {
        return false;
    }
    else if(x.find("that") < x.length())
    {
        return false;
    }
    else
    {
        return true;
    }
}

int main()
{
    string Alphabet = "abcdefghijklmnopqrstuvwxyza";
    string Text;

    while(getline(cin, Text))
    {
                while(CheckText(Text))
        {
            for(unsigned int a = 0; a < Text.length(); a++)
            {
                for(int b = 0; b < 26; b++)
                {
                    if(Text[a] == Alphabet[b])
                    {
                        Text[a] = Alphabet[b+1];
                        break;
                    }
                    else if(Text[a] == ' ')
                    {
                        break;
                    }
                }
            }

        }

        cout << Text << endl;
    }

}

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

int main(){
   string str;
   bool ans=false;
   getline(cin,str);
   
   string::iterator ite=str.begin();
   
   while(1){
      //cout << str.find("the");
      if(str.find("the")<str.size()) ans=true;
      else if(str.find("this")<str.size()) ans=true;
      else if(str.find("that")<str.size()) ans=true;
      if(ans) break;
      for(int i=0;i<str.size();i++){
         if(*(ite+i)!=' '&&*(ite+i)!='.') *(ite+i)+=1;
      }
   }
   cout << str << endl;
}

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

using namespace std;

int main()
{
  string stro, str;
  while(getline(cin, stro)){
    for(int i = 1; i < 26; i++){
      str = stro;
      for(int j = 0; j < stro.length(); j++){
	if(str[j] != ' ' && str[j] != '.')
	  if(str[j] + i > 'z')
	    str[j] += i - 26;
	  else
	    str[j] += i;
      }
	if(str.find("the", 0) != string::npos || str.find("this", 0) != string::npos || str.find("that", 0) != string::npos)
	  cout << str << endl;	
    }
  }
}

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

using namespace std;

#define dump(n) cout<<"# "<<#n<<"="<<(n)<<endl
#define debug(n) cout<<__FILE__<<","<<__LINE__<<": #"<<#n<<"="<<(n)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,n) repi(i,0,n)
#define iter(c) __typeof((c).begin())
#define tr(c,i) for(iter(c) i=(c).begin();i!=(c).end();i++)
#define allof(c) (c).begin(),(c).end()
#define mp make_pair

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int,int> pii;

string replace(string s,char table[])
{
	rep(i,s.size())
		if(islower(s[i]))
			s[i]=table[s[i]-'a'];
	return s;
}

int main()
{
	for(string s;getline(cin,s);){
		char table[]="abcdefghijklmnopqrstuvwxyz";
		rep(i,26){
			string s2=" "+s+" ";
			rep(i,s2.size())
				if(s2[i]=='.' || s2[i]=='\n')
					s2[i]=' ';
			s2=replace(s2,table);
			if(s2.find(" the ")!=string::npos || s2.find(" this ")!=string::npos ||s2.find(" that ")!=string::npos){
				cout<<replace(s,table)<<endl;
				break;
			}
			rotate(table,table+1,table+26);
		}
	}
	
	return 0;
}

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

int main(){
	char input[100],str[50][100];
	const char cmp[3][5]={"that","this","the"};
	int pos=0,last_pos=0,i,j,k,diff,n;
	bool flag;

		fgets(input,100,stdin);
		for(i=0;input[i]!='\0';i++){
			if(input[i]==' ' || input[i]=='.' || input[i]=='\n'){
				for(j=last_pos;j<i;j++){
					str[pos][j-last_pos]=input[j];
				}
				str[pos][j-last_pos]='\0';
				pos++;
				last_pos=i+1;
			}
		}

		n=0;
		flag=false;
		while(++n){
			for(i=0;i<pos;i++){
				for(j=0;str[i][j]!='\0';j++){
					str[i][j]+=1;
					if('a'>str[i][j]){
						str[i][j]+='z'-'a'+1;
					}else if('z'<str[i][j]){
						str[i][j]+='a'-'z'-1;
					}
				}
				puts(str[i]);
			}

			for(i=0;i<pos;i++){
				for(j=0;j<3;j++){
					if(strcmp(str[i],cmp[j])==0){
						flag=true;
                        j=3;i=pos;
					}
				}
			}
			if(flag) break;
		}

		int temp;
		for(i=0;input[i]!='\n';i++){
			if(input[i]!='.' && input[i]!=' '){
				temp=input[i]+n;
				if('a'>temp){
					input[i]=temp+'z'-'a'+1;
				}else if('z'<temp){
					input[i]=temp+'a'-'z'-1;
				}else{
					input[i]=temp;
				}
			}
		}
		printf("%s",input);

	return 0;
}

C++: #include<stdio.h>
#include<string.h>

int main(){
	char s[85];
	int i;
	memset(s,'0',sizeof(s));
	while(gets(s)){

		while(1){
			for(i=0;i<81;i++){
				switch(s[i]){
				case '.':
				case ' ':
				case '0':
				case '\0':
				case 10:
				case 13:
					continue;
				}
				s[i]='a'+(s[i]-'a'+1)%26;
			}
			if((NULL!=strstr(s,"the")) || (NULL!=strstr(s,"this")) || (NULL!=strstr(s,"that"))){
				printf("%s\n",s);
				memset(s,'0',sizeof(s));
				break;
			}
		}
	}
	return 0;
}