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 sa;
	while (getline(cin, sa)&& sa != "END OF INPUT") {
		int a = sa.size();
		while (1) {
			for (int i = 0; i < a; i++) {
				if (sa[i] >='a' && sa[i] <='z') {
					sa[i] += 1;
				}
					if (sa[i]<'z'){
						sa[i] -= 26;
					}				
			}
			size_t za=sa.find(" this "||" that "||" the ");
			if (za != string::npos) {break;}
		}
		cout << sa << endl;
	}
	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[] = {"this","the","that"};
    vector<string> in;
    while(true){
	string temp;
	cin >> temp;
	if(cin.eof()) break;
	in.PB(temp);

    }
    bool f = false;
    int d = 1;
    REP(i,30){

	f = true;
	REP(i,in.size()) REP(j,in[i].size()){
	    if(in[i][j] == '.') continue;
	    in[i][j] = (char)( 'a' + ( (int)(in[i][j] - 'a') + d) % 28);
	}
	vector<bool> flgs(3,false);
	for(int i=0;i<in.size();i++){
	    REP(j,3){
		bool flg = true;
		REP(k,s[j].size()) if(s[j][k] != in[i][k]) flg = false;
		if(flg)
		    flgs[j] = true;
	    }
	}
	REP(i,3) if( !flgs[i]) f = false;
	if(f) break;
    }
    REP(i,in.size()-1) cout << in[i] << " ";
    cout << in[in.size()-1] <<  endl;

    return 0;
}

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

char ans[200][82];
int main(){
	char str[82];
	int cor = 0;
	while(gets(str) != NULL){	//改行は読まない。はず!??
		int len;
		//char tran;
		len = strlen(str);
		//tran = 0;
		while(strstr(str,"this") == NULL && strstr(str,"that") == NULL && strstr(str,"the") == NULL){ 
			//tran++;
			for(int i = 0;i < len;i++){
				if(str[i] == 'z'){
					str[i] = 'a';
					continue;
				}
				if(str[i] == ' ' || str[i] == '.')
					continue;
				//str[i] = str[i]+tran;
				str[i]++;
			}
			//printf("%s\n",str);
		}
		strcpy(ans[cor],str);
		cor++;
	}
	for(int i = 0;i < cor;i++){
		printf("%s\n",ans[i]);
	}
	return 0;
}

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


int main(void){
	string org;
	getline(cin,org);

	for(int i=0; i<26; i++){
		for(int j=0; j<org.size(); j++){
			if( org[j] == '.' || org[j] == ' ' ) {}
			else {
				org[j]++;
				if( org[j] > 'z' )
					org[j] -= 26;
			}
		}
		string::size_type pos;
		pos = org.find("the");
		if( pos != string::npos ){
			cout << org << endl;
		}
		else{
			pos = org.find("this");
			if( pos != string::npos ){
				cout << org << endl;
			}
			else{
			pos = org.find("that");
			if( pos != string::npos ){
				cout << org << endl;
			}
			}
		}
	}
	return 0;
}

C++: #include <iostream>
#include <string.h>
#include <string>
#include <stdio.h>
using namespace std;
int main() {
	string w[3]={"the","this","that"},st;
	int wn[3]={3,4,4},k,i,j,s,f;
	while(getline(cin,st)) {
    k=0; 
	while(k<st.size()) {
		for (i=0;i<3;i++) {
			s=0; f=0;
			if (st.size()<k+wn[i]) break;
			for (j=0;j<wn[i]-1;j++) if (((w[i][j]-w[i][j+1]+26) % 26)==((st[k+j]-st[k+j+1]+26) % 26)) s++;
			if (s==wn[i]-1)  { f=1; i=5;}
		}
		if (f==1) break;
		for (k;st[k]>='a' && st[k]<='z' ; k++);
		k++;
	}
	if (f==0) cout << st; else {
		for (i=0;i<st.size();i++) 
			if ((st[i]>='a' && st[i]<='z')) cout << (char)(((st[i]-st[k]+'t')-97+26) % 26 + 97) ; 
		    else cout << st[i];
	}
	cout << endl;
	}
	return 0;
	}

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

using namespace std;
static const int MAXV = 81;

bool hantei(char* data);
void irekae(char* data);

int main() {
  while(!feof(stdin)) {
    char data[MAXV];
    if(fgets(data, sizeof(data), stdin)==NULL) break;
    while(!hantei(data))
      irekae(data);
    printf("%s", data);
  }
}

bool hantei(char* data) {
  if(strstr(data, "the")) return 1;
  if(strstr(data, "this")) return 1;
  if(strstr(data, "that")) return 1;
  return 0;
}

void irekae(char* data) {
  for(int i=0;data[i]!=0;i++) {
    if(data[i]>='a' && data[i]<='z') {
      if(data[i]=='z')data[i]='a';
      else data[i]++;
    }
  }
}

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

#define SIZE 3

using namespace std;

int main() {
	string str, value[SIZE] = {"the", "this", "that"};
	bool judge;
	while (getline(cin, str)) {
		judge = false;
		for (int i = 0; i < 25; i++) {
			for (int j = 0; j < str.size(); j++) {
				if ('a' <= str[j] && str[j] <= 'y') {
					str[j]++;
				}
				else if (str[j] == 'z') {
					str[j] = 'a';
				}
			}

			for (int j = 0; j < SIZE; j++) {
				if (str.find(value[j]) != str.npos) {
					judge = true;
				}
			}

			if (judge) {
				cout << str << endl;
				break;
			}
		}
	}

	return 0;
}

C++: #include <stdio.h>
#include <stdlib.h>
#include <string.h>
int caesar(char s[]);
bool search(char s[]);

int main(){
	char s[256];
	int i,j=0,n=10;
	while(scanf("%[^\n]",&s)!=EOF){
		while(!search(s)){
			for(i=0;s[i]!='.';i++){
				if(s[i]!=' ') s[i]++;
				if(s[i]>122) s[i]=97;
			}
		}
		printf("%s\n",s);
	}
	return 0;
}

bool search(char s[]){
	char *is,*e,*at;
	char *tmp;
	is="this";e="the";at="that";
	tmp = strchr(s,is[0]);
	if(tmp==NULL) return false;
	while(tmp[0]!=NULL){
		if(!strncmp(tmp,is,4))	return true;
		if(!strncmp(tmp,e,4))	return true;
		if(!strncmp(tmp,at,3))	return true;
		tmp++;
	}
	return false;
}

C++: #include <bits/stdc++.h>
 
using namespace std;
 
#define FOR(i, j, k) for(int i = j; i < k; ++i)
#define rep(i, j) FOR(i, 0, j)
#define repr(i, j) for(int i = j; i >= 0; --i)
#define INF (1 << 30)
#define MOD 1e9 + 7
 
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
 
int main() {
    string s;
    while(getline(cin, s)){
    	rep(i, 26) {
	    	rep(j, s.size()) {
	            if('a' <= s[j] && s[j] <= 'z') s[j] = s[j] + 'a';
	            else if(s[j] == 'z') s[j] = 'a';
	        }
	        if(s.find("the") != string::npos || s.find("this") != string::npos || s.find("that") != string::npos){
                cout << s << endl;
            }
	    }
    }
    return 0;
}

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

int main(){
  int str;
  string s;
  string tmp;
  getline(cin,s);
  for(int i=0;i<27;i++){
    for(int j=0;j<s.size();j++){
      if(s[j] >= 'a' && s[j] <= 'y') s[j]++;
      else if(s[j] == 'z') s[j]='a';
    }
      if((s.find("this")!=string::npos) || (s.find("that")!=string::npos) || (s.find("the")!=string::npos)) break;
    }
  cout << s << endl;
}