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 <string>
using namespace std;

int main() {
	string cipher;
	getline(cin, cipher);
	
	for (int i = 0; i < 26;i++) {
		for (unsigned int n = 0;n < cipher.length();n++) {
			if (cipher.at(n) == 'z') {
				cipher.at(n) = 'a';
			}else if(cipher.at(n)>='a'&&cipher.at(n)<='y'){
				cipher.at(n)++;
			}
		}

		if (cipher.find("the") != string::npos || 
			cipher.find("this") != string::npos ||
			cipher.find("that") != string::npos) {
			cout << cipher << endl;
		}
	}
	
	
	return 0;
}

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



int main(int argc, const char * argv[])
{
    while (1) {
        string word;
        getline(cin, word);
        int cnt = 0;
        for (char tmp2 = word[0]; tmp2 < 'z'; tmp2++) {
            if (tmp2 == 't') {
                break;
            }
            cnt++;
        }
        cnt = 0;
        for (char tmp2 = word[0]; tmp2 > 'a'; tmp2--) {
            if (tmp2 == 't') {
                break;
            }
            cnt--;
        }
        for (int i = 0; i < word.size(); i++) {
            if (word[i] == '.') {
                
            }
            else if (word[i] != ' ') {
                word[i] += cnt;
            }
        }
        cout << word << endl;
    }

    
    return 0;
}

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

using namespace std;

int main(int argc, char **argv)
{
	char a[82], t;
	int n, p;
	
	while(gets(a)!=NULL){
		n = strlen(a);
		for(int i = 0; i < n; i++){
			p = (int)(a[i++]-'t');
			if(a[i] == ' '){
				continue;
			}
			t = a[i++]-p;
			if(t < 'a'){
				t += 25;
			} else if(t > 'z'){
				t -= 25;
			}
			if(a[i] == ' '){
				continue;
			}
			if(t == 'h'){
				t = a[i++]-p;
				if(t < 'a'){
					t += 25;
				} else if(t > 'z'){
					t -= 25;
				}
				if(t == 'e' && a[i] == ' '){
					break;
				} else if(t == 'i'){
					t = a[i++]-p;
					if(t < 'a'){
						t += 25;
					} else if(t > 'z'){
						t -= 25;
					}
					if(t == 's' && a[i] == ' '){
						break;
					}
				} else if(t == 'a'){
					t = a[i++]-p;
					if(t < 'a'){
						t += 25;
					} else if(t > 'z'){
						t -= 25;
					}
					if(t == 't' && a[i] == ' '){
						break;
					}
				}
			}
		}
		
		for(int i = 0; i < n; i++){
			if(a[i] == ' ' || a[i] == '.' || a[i] == ','){
				printf("%c",a[i]);
			} else {
				t = a[i]-p;
				if(t < 'a'){
					t += 25;
				} else if(t > 'z'){
					t -= 25;
				}
				printf("%c",t);
			}
		}
		cout << endl;
	}
	
	return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
int main()
{
	string str;int n=0; bool flag=false;
	getline(cin,str);
	for(int k=0;k<26;k++)
	{
		int i=0;
		for(i=0;i<str.size();i++)
		{
				if(str[i]-'a'<0 || str[i]-'z'>0) continue;
				else
				{
					str[i]++;
					if(str[i]-'z'>0) str[i]-=26;
				}
		};
		string ptr=""; string qtr="";
		for(i=0;i<str.size();i++)
		{
			if(i+4<str.size()) ptr=str.substr(i,4);
			if(i+3<str.size()) qtr=str.substr(i,3);
			if(ptr=="this" || ptr=="that" || qtr=="the") {flag=true; break;}
		};
		if(flag==true) break;
	};
	cout << str << endl ;
}

C++: #include <stdio.h>
#include <math.h>
#include <ctype.h>

char buf[128];

int main(void)
{
	int i, j, flag = 0;
	scanf("%[^\n]s", buf);
	
	for (i = 'a'; i <= 'z' && flag == 0; i++){
		//check
		for (j = 0; j < 80; j++){
			if (buf[j] == 't' && buf[j + 1] == 'h'){
				if ((buf[j + 2] == 'i' && buf[j + 3] == 's') || (buf[j + 2] == 'a' && buf[j + 3] == 't') || (buf[j+2]=='e')){
					//this	that	the
					flag = 1;
				}
			}
		}

		//add 1
		if (flag == 0){
			for (j = 0; j < 80; j++){
				if (isalpha(buf[j])){
					if (buf[j] == 'z'){
						buf[j] = 'a';
					}
					else{
						buf[j]++;
					}
				}
			}
		}
	}

	for (i = 0; i < 80; i++){
		printf("%c", buf[i]);
	}
	return 0;
}

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

void coding(){
  string s;
  int cnt=0;

  while(getline(cin, s)){


    while(true){
      bool flag=false;
      
      for(int i=0;i<s.length();i++){
	string key1 = s.substr(i,3);
	string key2 = s.substr(i,4);
	if(key1 == "the" || key2 == "this" || key2 == "that"){
	  flag = true;
	  break;
	}
      }
      
      if(flag){
	cout << s << endl;
	break;
      }
    
      for(int i=0;i<s.length();i++){
	if(s[i] > 'a' && s[i] < 'z'){
	  s[i] -= 'a';
	  s[i] += 1;
	  s[i] = s[i]%('A'-'a');
	  s[i] += 'a';
	}
      }
    }
  }
}


int main(){
  coding();
}

C++: #include <iostream>
#include <iomanip>
#include <list>
#include <map>
#include <algorithm>
#include <stack>
#include <string>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>

using namespace std;


int main(){
	string tmp;
	string key[] = {"the","this","that"};
	int alfabet;
	bool clearFlag;
	while(getline(cin,tmp)){
		clearFlag = false;
		alfabet = 26;
		while(alfabet--){

			for(string::iterator it = tmp.begin(); it != tmp.end(); it++){
				if(*it == '\n'){
					it = tmp.erase(it);
				}
				if(*it >= 'a' && *it <= 'z'){
					(*it)++;
					if(*it >= 'z'){
						*it = 'a';
					}
				}
			}
			for(int j = 0; j < 3; j++){
				if(tmp.find(key[j]) != string::npos){
					cout << tmp << endl;
					clearFlag = true;
					break;
				}
			}

			if(clearFlag == true){
				break;
			}

		}

	}
	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;

		while(fgets(input,100,stdin)!=NULL){;
		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;
					}
				}
			}

			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]!='\0';i++){
			if(input[i]!='.' && input[i]!=' ' && input[i]!='\n'){
				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;
}