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<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;
  while(ans){
    for(int i = 0 ; i < ss.size() ; i ++){
      for(int j = 0 ; j < ss[i].size() ; j ++){
	ss[i][j] ++;
      }
      //cout<<ss[i]<<" ";
      for(int j = 0 ; j < 3 ; j ++){
	if(ss[i] == a[j]) ans = false;
	break;
      }
    }
  }
  for(int i = 0 ; i < ss.size() ; i ++){
    cout<<ss[i]<<" "; 
  }
  cout<<endl;
}

C++: #include <iostream>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <map>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,b) FOR(i,0,b)
#define PB push_back
#define MP make_pair
char rec(char x,int s){
  if(x-s<'a')return x-s+26;
  if(x-s>'z')return x-s-26;
  return x-s;
}
int main(){
  string s[80];
  int k=0,l=0;
  while(cin>>s[k]){
    int y=s[k][0]-'t';
    if(s[k].size()==3){
      if(rec(s[k][1],y)=='h'&&rec(s[k][2],y)=='e')l=y;
    }
    if(s[k].size()==4){
      if(rec(s[k][1],y)=='h'&&rec(s[k][2],y)=='a'&&rec(s[k][3],y)=='t')l=y;
      else if(rec(s[k][1],y)=='h'&&rec(s[k][2],y)=='i'&&rec(s[k][3],y)=='s')l=y;
    }
    k++;
  }
  for(int i=0;i<k;i++){
    for(int j=0;j<s[i].size();j++){
      if(s[i][j]=='.')cout<<'.';
      else cout<<rec(s[i][j],l);
    }
    if(i==k-1)cout<<endl;
    else cout<<" ";
  }
}

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

int main() {
	string str; 
	while (getline(cin, str)) {
		for (int i = 0; i < 26; i++) {
			for (auto &itr : str) if (isalpha(itr)) itr = (itr - 'a' + 1) % 26 + 'a';
			if (str.find("the") != -1) { cout << str << endl; break; }
			if (str.find("this") != -1) { cout << str << endl; break; }
			if (str.find("that") != -1) { cout << str << endl; break; }
		}
	}
	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<cmath>
#include<vector>
#include<list>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<string>
#include<utility>
#include<algorithm>
#include<functional>
#include<deque>
#include<string.h>
#include<ctype.h>
#include<time.h>
#include<stdlib.h>
using namespace std;

char c[80], word[40][10];
int p = 0, q = 0;

bool search_th(){
  for (int i = 0; i <= p; i++){
    if (word[i][0] == 't' && word[i][1] == 'h'){
      if (word[i][2] == 'e' || (word[i][2] == 'i' && word[i][3] == 's') || (word[i][2] == 'a' && word[i][3] == 't')){
        return true;
      }
    }
  }
  return false;
}

void split_words(){
  for (int i = 0; i < 40; i++){
    for (int j = 0; j < 10; j++){
      word[i][j] = '\0';
    }
  }
  for (int i = 0; i < strlen(c); i++){
    if (c[i] >= 'a' && c[i] <= 'z'){
      word[p][q++] = c[i];
    } else {
      p++;
      word[p++][0] = c[i];
      q = 0;
    }
  }
  for (int i = 0; i <= p; i++){
    printf("word[%d]:%s\n", i, word[i]);
  }
}

int main(){
  while (cin.getline(c, sizeof(c))){
    p = 0;  q = 0;
    split_words();
    while (1){
      if (search_th() == true){
        for (int i = 0; i <= p; i++){
          cout << word[i];
        }
        puts("");  break;
      } else {
        for (int i = 0; i <= p; i++){
          for (int j = 0; j < strlen(word[i]); j++){
            if (word[i][j] >= 'a' && word[i][j] <= 'y') word[i][j]++;
            if (word[i][j] == 'z')                      word[i][j] = 'a';
          }
        }
      }
    }
    for (int i = 0; i < 80; i++){
      c[i] = '\0';
    }
  }
  return 0;
}

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

bool howMuchWords(string s, string key){
  string::size_type index = s.find(key);
  if(index == string::npos){
    return false;
  }else{
    //???????????£???.
    return true;
  }
}
    

int main(){
  string s;
  getline(cin ,s);
  int cnt=0;

  while(true){
    if(howMuchWords(s, "that") || howMuchWords(s, "this") || howMuchWords(s, "the")){
      // cout << cnt << ": ";
      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;
	if(s[i] < 0){
	  s[i] += 'A' - 'a';
	}
	s[i] += 'a';
      }
    }
    
  }
}

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

using namespace std;

string dict = "abcdefghijklmnopqrstuvxwyz";

string decode(string s, int v) {
    string ans = s;
    for(int i = 0; i < (int) s.size(); i++) {
        if(s[i] >= 'a' && s[i] <= 'z') {
            ans[i] =  dict[((s[i] + v) % 26)];
        }
    }
    return ans;
}

int main() {
    string s;

    while(getline(cin, s)) {
        for(int i = 1; ; i++) {
            string tmp = decode(s, i);
            if(tmp.find("this") != string::npos && tmp.find("the") != string::npos && tmp.find("that") != string::npos) {
                cout << tmp << endl;
                break;
            }
         }
    }
    return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

int main()
{
    char line[100];
    int dist,a,b,h,e,i,s,t,aa;
    while(gets(line)){
        int l=strlen(line);
        //printf("length %d\n",l);
        char *token;
        token=strtok(line," ");
        while(token!=NULL) {//cout<<token<<" ";
            int tl=strlen(token);
            //printf("tl %d\n",tl);
            if(tl==3 || tl==4){
                if(tl==3){
                    a=abs(token[0]-'t');

                    h=token[1]-'a'-a;
                    h+=26;
                    h=h%26;

                    e=token[2]-'a'-a;
                    e+=26;
                    e=e%26;
                    if(h+'a'=='h' && e+'a'=='e'){

                        dist = a;
                        break;
                    }
                }
                if(tl==4){
                    a=abs(token[0]-'t');
                    //printf("a %d\n",a);

                    h=token[1]-'a'-a;
                    h+=26;
                    h=h%26;

                    i=token[2]-'a'-a;
                    i+=26;
                    i=i%26;

                    aa=token[2]-'a' -a;
                    aa+=26;
                    aa=aa%26;

                    s=token[3]-'a'-a;
                    s+=26;
                    s=s%26;

                    t=token[3]-'a' - a;
                    a += 26;
                    a = a%26;

                    if(h+'a'=='h' && (i+'a'=='i' ||aa+'a'=='a') && (s+'a'=='s' || t+'a'=='t')){

                        dist = a;
                        break;
                    }
                }
            }
            token=strtok(NULL," ");
            }

        //printf("length %d\n",dist);
            for(int i=0;i<l;i++){
            if(line[i]>='a' && line[i]<='z'){
                a=line[i]-'a';
                a=(a-dist);
                a+=26;
                a=a%26;
                line[i]='a'+a;
                printf("%c",a+'a');
            }
            else
                printf("%c",line[i]);
        }
        printf("\n");
    }

    return 0;
}