Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func cipher(text string, direction int, int_shift int) string {
	shift, offset := rune(int_shift), rune(26)
	runes := []rune(text)
	for index, char := range runes {
		switch direction {
		case 1:
			if char >= 'a' && char <= 'z'-shift || char >= 'A' && char <= 'Z'-shift {
				char = char + shift
			} else if char > 'z'-shift && char <= 'z' || char > 'Z'-shift && char <= 'Z' {
				char = char + shift - offset
			}
		case -1:
			if char >= 'a'+shift && char <= 'z' || char >= 'A'+shift && char <= 'Z' {
				char = char - shift
			} else if char >= 'a' && char < 'a'+shift || char >= 'A' && char < 'A'+shift {
				char = char - shift + offset
			}
		}
		runes[index] = char
	}
	return string(runes)
}

func main() {
	for scanner.Scan() {
		infos := strings.Split(scanner.Text(), " ")
		plain := make([]string, len(infos))
		// fmt.Println(infos)
		Decryption:
			for i := 0; i < 26; i++ {
				for j := range infos {
					plain[j] = cipher(infos[j], 1, i)
				}
				for j := range plain {
					if plain[j] == "this" || plain[j] == "that" || plain[j] == "the" {
						break Decryption
					}
				}
			}
			fmt.Println(strings.Join(plain, " "))
	}
}

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

C++: #include<iostream>
#include<string>
using namespace std;
int main() {
	string a = "";
	while (getline(cin, a)) {
		a += " ";
		string b = "";
		int z = 0, sum = 0;
		int k = a.length();
		for (int i = 0; i <k; i++) {
			if (a[i] == ' ' || a[i] == '.') {
				b = a.substr(z, i - z);
				int t = (int)'t';
				string c = "";
				if (b.length() == 3 || b.length() == 4) {
					c = "";
					int w = t - (int)b[0];
					for (int i = 0; i < b.length(); i++) {
						int d = (char)((int)b[i] + w);
						if (d > 'z')
							d -= 26;
						else if (d < 'a')
							d += 26;
						c += (char)d;
					}
					if (c == "the" || c == "that" || c == "this") {
						sum = w;
						break;
					}
				}
				z = i + 1;
			}
		}
		string f = "";

		for (int i = 0; i < k - 1; i++) {
			if (a[i] != ' ' && a[i] != '.') {
				int g = (int)a[i] + sum;
				if (g >(int)'z')
					g -= 26;
				else if (g < (int)'a')
					g += 26;
				f += (char)g;
			}
			else {
				f += a[i];
			}
		}
		cout << f << endl;
	}
}

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

typedef long long ll;
#define rep(i,n) for(i=0;i<n;++i)
#define each(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); itr++)
#define mp make_pair
#define pb push_back
#define fi first
#define sc second

int main(int argc, char const *argv[]) {
  string a="abcdefghijklmnopqrstuvwxyz";
  a += a;

  string s;

  while(getline(cin,s)){
    //cout << s << endl;

    string t="";
    bool end=false;
    int i;
    for(int w=0; w<=25; ++w){
      //printf("w=%d\n", w);
      t="";
      int p=0;
      rep(i,s.size()){
        if('a'<=s[i] && s[i]<='z'){
          t+=a[s[i]-'a'+w];
        }
        else{
          t+=s[i];
          string tmp=t.substr(p,i-p);
          //cout << tmp << endl;

          if(tmp=="this" || tmp=="the" || tmp =="that") end=true;

          p=i+1;
        }
      }

      if(end) break;
    }

    std::cout << t << std::endl;
  }
  return 0;
}