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 <bits/stdc++.h>
#include <vector>
using namespace std;
string str;	
int a, b, c, d;
int main(){
	getline(cin, str);
	a = str.length();
	for(int i = 0; i < a; i++){
		if(str[i] < 97 || str[i] > 122){
			cout << str[i];
		}
		else {
			b = (int)str[i];
			b = b - 4;
			if(b < 97)
				b = b + 26;
			cout << (char)b;
		}
	}
	return 0;
}

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

int main() {
  string str,s,newstr;
  int key,word;
  vector<string> seq;
  char decode[4],ans;
  while(getline(cin,str)) {
    seq.clear();
    stringstream ss;
    ss << str;
    while(ss >> s) {
      seq.push_back(s);
    }
    ss.str("");
    ss.clear(stringstream::goodbit);

    word = seq.size();
    key = 100;

    for(int i=0;i<word;i++) {

	decode[0] = *seq[i].substr(0,1).c_str();
	decode[1] = *seq[i].substr(1,1).c_str();
	decode[2] = *seq[i].substr(2,1).c_str();
	decode[3] = *seq[i].substr(3,1).c_str();

	for(int j=1;j<27;j++) {
	  for(int k=0;k<4;k++) {
	    decode[k] -= 97; //a-z 0-25
	    decode[k] ++;//1-26
	    decode[k] %= 26;//0-25
	    decode[k] += 97;//97-122
	  }
	  if(decode[0] == 't' && decode[1] == 'h' && decode[2] == 'i' && decode[3] == 's') {
	    key = j;
	    break;
	  }
	  if(decode[0] == 't' && decode[1] == 'h' && decode[2] == 'a' && decode[3] == 't') {
	    key = j;
	    break;
	  }
	}
      
      if(key!=100) break;
    }

    for(int i=0;i<word;i++) {
      for(int j=0;j<seq[i].size();j++) {
	ans = *seq[i].substr(j,1).c_str();
	if(ans <= 'z' && 'a' <= ans){
	  ans -= 97;
	  ans += key;
	  ans %= 26;
	  ans += 97;
	}
	cout << ans;
      }
      if(i==word-1) {
	break;
      }
      cout << " ";
      
    }
    cout << endl;
  }
}

C++: #include<stdio.h>
#include<iostream>
#include<math.h>
#include<string>
using namespace std;
int main(){
char s[1000];
while(cin.getline(s,1000)){
for(int i=0;s[i]!='\0';i++){
if(((s[i]-s[i+1]+26)%26=='t'-'h')&&(((s[i+1]-s[i+2]+26)%26==('h'-'e'+26)%26)||(((s[i+1]-s[i+2]+26)%26==('h'-'i'+26)%26)&&((s[i+2]-s[i+3]+26)%26==('i'-'s'+26)%26))||(((s[i+1]-s[i+2]+26)%26==('h'-'a'+26)%26)&&((s[i+2]-s[i+3]+26)%26==('a'-'t'+26)%26)))){
for(int j=0;s[j]!='\0';j++){
if((s[j]!=' ')&&(s[j]!='.')&&(s[j]!='\n')){
putchar((s[j]+'t'-s[i]-'a'+26)%26+'a');
}else{
putchar(s[j]);
}
}cout<<endl;
break;
}
}
}
return 0;
}

C++: #include<iostream>
using namespace std;
int main()
{
	char key[80] = "";
	
	cin.getline(key, sizeof(key);

		for (int i = 0; i < sizeof(key); i++)
		{
			//if (key[i] == (int)" ")cout << "space";
			if ((int)key[i] == 0)break;
			if ((int)key[i] <= 122 && (int)key[i] >= 97)
				key[i] = (int)key[i] - 1;
			if (key[i] == 96)key[i] = 122;
		}
		for (int i = 0; i < sizeof(key); i++)
		{
			if ((int)key[i] == 0)break;
			cout << key[i];
		}
	
	return 0;
}

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

using namespace std;

inline char shift(char c, int i) {
  return char(((c + i) - 'a') % 26 + 'a');
}

int main() {
  string str;
  getline(cin, str);

  int n;
  for (int i = 0; i < 26; ++i) {
    string target;
    for (char c : str) {
      if ('a' <= c && c <= 'z')
        target += shift(c, i);
      else
        target += c;
    }
    for (string key : {"the", "this", "that"}) {
      size_t pos = target.find(key);
      if (pos != string::npos) {
          n = i;
          str = target;
          goto found;
      }
    }
  }

  found:
    cout << str << endl;
}

C++: #include <cmath>
#include <iostream>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
#include <sstream>

using namespace std;


bool check(string inp){
    stringstream words(inp);
    string word;
    while(getline(words, word, ' ')){
        if(word=="the"||word=="this"||word=="that"||word=="the."||word=="this."||word=="that.")
            return true;
    }
    return false;
}

int main(){
    string input;
    while(getline(cin,input)){
        for(int i=0;i<26;i++){
            for(int j=0;j<input.length();j++){
                if(isalpha(input[j])){
                    input[j]++;
                    if(input[j]>'z') input[j]='a';
                }
            }
            if(check(input)){
                break;
            }
        }
        cout << input << endl;
    }
    return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<complex>
#include<iomanip>

#define EPS (1e-10)
using namespace std;
#define PI (3.1415926535)

int main(){
	int i;
	bool b;
	string str;
	string word[3] = {"the", "this", "that"};

	while(getline(cin, str)){
		b = false;
		for(i = 0; i < 26 && !b; i++){
			for(int j = 0; j < str.size(); j++){
				if(str[j] >= 'a' && str[j] <= 'z'){
					str[j]++;
					if(str[j] > 'z'){
						str[j] -= 26;
					}
				}
			}
			for(int j = 0; j < 3; j++){
				if(str.find(word[j]) != -1){
					b = true;
					break;
				}
			}
		}
		cout << str << endl;
	}


	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
using namespace std;
string a,b;
char c[81];
int flg;
int main(){
    getline(cin,a);
    for(;;){
        if(flg==1)break;
        for(int i=0;i<26;i++){
            for(int j=0;j<a.size();j++){
                if(a[j]>='a'&&a[j]<='z'){
                    if(a[j]-1>='a'){
                        a[j]-=1;
                    }else{
                        a[j]+=25;
                    }
                }
            }
            for(int j=0;j<a.size()-3;j++){
                b=a.substr(j,3);
                if(b=="the")flg=1;
                b=a.substr(j,4);
                if(b=="that"||b=="this")flg=1;
                if(flg==1)break;
            }
            if(flg==1)break;
        }
    }
    cout<<a<<endl;
return 0;
}

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

int main()
{
  int n,i,j;
  string s,t;
  bool f;
  while(getline(cin,s)){
    f=true;
    for(i=0;f && i<26;i++){
      t=s;
      for(j=0;j<t.size();j++){
	if(!islower(t[j]))continue;
	t[j]-='a';
	t[j]=(t[j]+i)%26;
	t[j]+='a';
      }
      if(t.find("this ",0)==0)f=false;
      if(t.find("that ",0)==0)f=false;
      if(t.find("the ",0)==0)f=false;
      if(t.find(" this",t.size()-5)==t.size()-5)f=false;
      if(t.find(" that",t.size()-5)==t.size()-5)f=false;
      if(t.find(" the",t.size()-4)==t.size()-4)f=false;
      if(t.find(" this ")!=string::npos)f=false;
      if(t.find(" that ")!=string::npos)f=false;
      if(t.find(" the ")!=string::npos)f=false;
    }
    cout<<t<<endl;
  }
}