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 <cstdio>
#include <iostream>
#include <cstring>

using namespace std;

char data[26]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
char trans[100];
char mozi;
int position=0;
int zoom;
int first_check=0,first_position=0;
int now;
char result;

int main(){
	while(scanf("%c",&mozi)){

		if(first_check == 0)

		for(int i=0;i<26 && first_check == 0;i++){
			if(mozi == data[i]){
				first_position = i;
				zoom = first_position - 19;
				first_check = 1;
				break;
			}
		}




		if(mozi == ' ' || mozi == '.' || mozi == '\n'){
			if(mozi == ' ' || mozi == '.'){
				trans[position] = mozi;
				position++;
			}

			if(mozi == '\n'){
				trans[position] = '\n';
				cout << trans << endl;
				first_check = 0;
				position = 0;
				memset(trans,'\0',sizeof(trans));
			}
		}else{
			for(int i=0;i<26;i++){
				if(data[i] == mozi){
					now = i;
					break;
				}
			}

			trans[position] = data[now - zoom];
			position++;

		}
	}
}

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

bool find(const std::string &text, const std::string pattern){
	int text_i=0,pattern_i=0;
	while(text_i<text.size()&&pattern_i<pattern.size()){
		if(text[text_i]==pattern[pattern_i]) {
			text_i++;
			pattern_i++;
		}else{
			pattern_i=0;
			text_i=text_i-pattern_i+1;
		}
	}
	return (pattern_i==pattern.size()?true:false);
}


void decode( std::string &coded_data,int diff){
	for(int i=0;i<coded_data.size();i++){
		if(isalpha(coded_data[i])){
			coded_data[i]-=diff;
			if(!isalpha(coded_data[i])) coded_data[i]+=26;
		}
	}
}

int main(void){
	std::string coded_data;
	while(std::getline(std::cin,coded_data)){
		for(int i=1;i<26;i++){
			decode(coded_data,1);
			if(find(coded_data,"the") || find(coded_data,"this")||find(coded_data,"that"))
				std::cout<<coded_data<<std::endl;
		}
	}

	return 0;
}

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

int main(){
	char s[100];

	int count = 0;

	gets(s);

	int diff = s[0] - 't';

	for (int j = 0; j < strlen(s); j++){
		if (s[j] == '.' || s[j] == ' ')
			continue;
		s[j] -= diff;
	}

	printf("%s",s);

	return 0;
}

C++: #include <iostream>
#include <string.h>
#include <string>
#include <stdio.h>
using namespace std;
int main() {
	char st[80];
	string w[3]={"the","this","that"};
	int wn[3]={3,4,4},k,i,j,s,f,z;
	while(true) {
    k=0; z=0;
	scanf("%[^\0]",st);
	z=strlen(st);
	while(k<z) {
		for (i=0;i<3;i++) {
			s=0; f=0;
			if (z<k+wn[i]) break;
			for (j=0;j<wn[i]-1;j++) if ((w[i][j]-w[i][j+1])==(st[k+j]-st[k+j+1])) s++;
			if (s==wn[i]-1 && (st[k+wn[i]]<'a' || st[k+wn[i]]>'z' ))  { 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<z;i++) if ((st[i]>='a' && st[i]<='z')) cout << (char)(st[i]-(st[k]-'t')) ; else cout << st[i];
	}	
	cout << endl;
	}
    return 0;
	}

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

int main(){
	char s[80],os[80];
	gets(s);
	int len=strlen(s);
	int i,j;
	for(j=0;j<len;j++)os[j]=s[j];
	os[len]='\0';
	for(j=0;j<26;j++){
		for(i=0;i<len;i++){
			if(s[i]>='a'&&s[i]<='z'){
				s[i]-=j;
				if(s[i]<'a')s[i]+=('z'-'a');
			}
		}
		if(strstr(s,"this")!=NULL||strstr(s,"the")!=NULL||strstr(s,"that")!=NULL){
			goto end;
		}
		for(i=0;i<len;i++)s[i]=os[i];
	}
end:
	for(i=0;i<len;i++){
		if(os[i]>='a'&&os[i]<='z'){
			os[i]-=j;
			if(os[i]<'a')os[i]+=('z'-'a');
		}
	}
	printf("%s\n",os);
	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++){
		for(int i=0;i<str.size();i++){
				if(str[i]-'a'<0 || str[i]-'z'>0) ;
				else if(++str[i]-'z'>0) str[i]-=26;		
		};
		string ptr; string qtr;
		for(int i=0;i<str.size()-4;i++){
		ptr=str.substr(i,4); qtr=str.substr(i,3);
			if(ptr=="this" || ptr=="that" || qtr=="the") flag=true;
			if(flag==true) break;
		};
		if(flag==true) break;
	};
	cout << str << '\n' ;
}

C++: #include<iostream>
#include<vector>
#include<string>
using namespace std;
int main(){
	int res=0;
	vector<string> buf;
	string str;
	while((cin>>str)!=NULL)
		buf.push_back(str);
	for(int ptr=0;ptr<buf.size();++ptr){
		if(res!=0) break;
		if(buf[ptr].length()>2)
		if(buf[ptr][0]-buf[ptr][1]=='t'-'h'){
			int dif='t'-buf[ptr][0];
			cout<<dif<<endl;
			string tmp;
			for(int i=0;i<buf[ptr].length();++i)
				tmp += (buf[ptr][i]-'a'+dif)%26+'a';
			cout << tmp << endl;
			if(tmp=="the" or tmp=="this" or tmp=="that"){
				res = dif;
				break;
			}
		}
		cout<<1;
	}
	if(res!=0){
		for(int ptr=0;ptr<buf.size();++ptr){
			string tmp;
			for(int i=0;i<buf[ptr].length();++i)
				tmp += ((buf[ptr][i]=='.') ? '.' : (buf[ptr][i]-'a'+res)%26+'a');
			cout<<tmp<<" ";
		}
	}
	if(res==0) cout<<"-1";
	cout<<endl;
	return 0;
}

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

int main(void){
  string s;
  string a[3] = {"this","the","that"};
  getline(cin,s);
  vector<string> ss;
  string n = "";
  s += " ";
  for(int i = 0  ; i < s.size() ; i ++){
    if(s[i] == ' '){
      ss.push_back(n);
      n = "";
    }else{
      n += s[i];
    }
  }
  bool ans = true;
  for(int i = 0 ; i < ss.size() ; i ++){
    for(int j = 0 ; j < ss[i].size() ; j ++){
      if('a' > ss[i][j] && ss[i][j] < 'z')continue; 
      ss[i][j] ++;
      if(ss[i][j] == 'z' + 1)ss[i][j] = 'a';
    }
    for(int j = 0 ; j < 3 ; j ++){
      for(int k = 0 ; k < a[i].size() ; k ++){
	if(k == a[i].size() - 1){
	  ans = false;
	}else if(a[i][k] != ss[j][k]){
	  break;
	}
      }
      break;
    }
  }
  while(ans){
    for(int i = 0 ; i < ss.size() ; i ++){
      for(int j = 0 ; j < ss[i].size() ; j ++){
	if('a' > ss[i][j] && ss[i][j] < 'z')continue;
	ss [i][j]++;
	if(ss[i][j] == 'z' + 1)ss[i][j] = 'a';
      }
      for(int j = 0 ; j < 3 ; j ++){
	for(int k = 0 ; k < a[i].size() ; k ++){
	  if(k == a[i].size() - 1){
	    ans = false;
	  }else if(a[i][k] != ss[j][k]){
	    break;
	  }
	}
	break;
      }
    }
  }
  for(int i = 0 ; i < ss.size() ; i ++){
    cout<<ss[i]<<" "; 
  }
  cout<<endl;
}

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

int main(){
	string sa;
	
	while(getline(cin,sa)){
		
		for(int j=0;j<26;j++){
			int a=sa.size();
		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 z=sa.find("this");
			size_t za=sa.find("that");
			size_t zb=sa.find("the");
			if(z!=string::npos){break;}
			else if(za!=string::npos){break;}
			else if(zb!=string::npos){break;}
			}
			cout<<sa<<endl;
			
		}
		return 0;
	}