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>
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<stdio.h>
#include<string.h>

int main(void){
	char data[100];
	char s1[]="the",
		 s2[]="this",
		 s3[]="that";
	int i,cnt=0;
	char *p;

	while(1){
		fgets(data,100,stdin);
		if(data[0]=='\n')
				break;
		while(cnt<=26){
			p=strstr(data,s1);
			if(p)
				break;
			p=strstr(data,s2);
			if(p)
				break;
			p=strstr(data,s3);
			if(p)
				break;
			for(i=0;i<100;i++){
				if(data[i]=='\0')
					break;
				if('a'<=data[i] && data[i]<='y')
					data[i]++;
				if('z'==data[i])
					data[i]='a';
			}
			cnt++;
		}
		cnt=0;
		printf("%s\n",data);
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
string word[3] = {"this","that","the"};
int main(){
  char c;
  string s[80];
  int smax = 0;
  while(scanf("%c",&c) != EOF){
    if(c == '\n' || c == ' '){
      smax++;s[smax] += c;
      smax++;
    }else{
      s[smax] += c;
    }
  }smax++;
  bool flag = false;
  while(1){
    for(int i = 0;i < smax;i++){
      for(int j = 0;j < s[i].size();j++){
	if(isalpha(s[i][j])){
	  s[i][j]++;
	  if(s[i][j] == 'z' + 1)s[i][j] = 'a';
	}
	for(int j = 0;j < 3;j++){
	  if(word[j] == s[i]){flag = true;break;}
	}for(int j = 0;j < 3;j++){
	  if(word[j] + '.' == s[i]){flag = true;break;}
	}
      }
    }
    if(flag)break;
  }
  for(int i = 0;i < smax;i++)cout << s[i];
  return 0;
}

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

int main(){
  char cip[80][80];
  int words;
  int i, j;
  int gap;

  words=0;
  while(cin>>cip[words]) words++;

  for(i=0; i<words; i++){
    for(j=0; j<strlen(cip[i]); j++){
      if(cip[i][j]=='.') continue;
      cip[i][j]-='a';
    }
    if(strlen(cip[i])==3
       && (cip[i][1]-cip[i][0]+26)%26==14
       && (cip[i][2]-cip[i][0]+26)%26==11){
      gap=(cip[i][0]-('t'-'a')+26)%26;
      continue;
    }
    if(strlen(cip[i])>3
       && (cip[i][1]-cip[i][0]+26)%26==14
       && (cip[i][2]-cip[i][0]+26)%26==15
       && (cip[i][3]-cip[i][0]+26)%26==25){
      gap=(cip[i][0]-('t'-'a')+26)%26;
      continue;
    }
    if(strlen(cip[i])>3
       && (cip[i][1]-cip[i][0]+26)%26==14
       && (cip[i][2]-cip[i][0]+26)%26==7
       && (cip[i][3]-cip[i][0]+26)%26==0){
      gap=(cip[i][0]-('t'-'a')+26)%26;
      continue;
    }
  }
  for(i=0; i<words; i++){
    for(j=0; j<strlen(cip[i]); j++){
      if(cip[i][j]=='.') continue;
      cip[i][j]=(cip[i][j]-gap+26)%26+'a';
    }
    if(i==words-1) printf("%s\n", cip[i]);
    else printf("%s ", cip[i]);
  }

  return 0;
}

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

void shift(string &line){
  for ( int i = 0; i < line.size(); i++ ){
    if ( line[i] == 'z' ) line[i] = 'a';
    else if ( 'a' <= line[i] && line[i] <= 'y' ){
      line[i] = (line[i]-1);
    }
  }
}
int main(){
  string line;
  while(getline(cin,line)){
    if ( cin.eof() ) break;
    while(true){
      if (line.find("the") != string::npos ||
          line.find("this") != string::npos ||
          line.find("that") != string::npos) {
        cout << line << endl;
        break;
      }
      shift(line);
    }
  }
  return 0;
}

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

using namespace std;

int main()
{
  string stro, str;
  while(getline(cin, stro)){
    for(int i = 0; i < 26; i++){
      str = stro;
      for(int j = 0; j < stro.length(); j++){
	if(str[j] >= 'a' && str[j] <= 'z')
	  if(str[j] + i > 'z')
	    str[j] += i - 26;
	  else
	    str[j] += i;
      }
      if(str.find("the") != string::npos || str.find("this") != string::npos || str.find("that") != string::npos)
	cout << str << endl;
    }
  }
}

C++: #include<iostream>
#include<string>
#include<cstring>
#include<vector>
using namespace std;
int word_search(vector<string> s,  string key){
	for(int i = 0; i < s.size(); i++){
		if(s[i].length() <= 2 || s[i].length() >= 6) continue;
		for(int j = 0; j < s[i].length() - 1; j++)
			if(s[i][j] == '.') continue;
		if(s[i][s[i].length() - 1] == '.') s[i].erase(s[i].end() - 1);
		for(int j = 0; j < 26; j++){
			string turned_word;
			for(int k = 0; k < s[i].length(); k++){
				turned_word.push_back((s[i][k] + j - 'a') % 26 + 'a');
			}
			if(turned_word == key) return j;
		}
	}
	return -1;
}
int main(){
	for(;;){
		char line[200];
		if(fgets(line, sizeof(line), stdin) == NULL) break;
		vector<string> s;
		char *token = strtok(line, " ");
		s.push_back(token);
		for(;;){
			token = strtok(NULL, " ");
			if(token == NULL) break;
			s.push_back(token);
		}
		int num;
		if(word_search(s, "the") != -1) num = word_search(s, "the");
		if(word_search(s, "this") != -1) num = word_search(s, "this");
		if(word_search(s, "that") != -1) num = word_search(s, "that");
		for(int i = 0; i < s.size(); i++){
			for(int j = 0; j < s[i].length(); j++){
				if(s[i][j] == '.' || s[i][j] == '\n') cout << s[i][j];
				else cout << (char)((s[i][j] + num - 'a') % 26 + 'a');
			}
			if(i != s.size() - 1)cout << ' ';
		}
	}
	return 0;
}

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

using namespace std;

int main() {
    string s;
    int len;
    
    while (getline(cin, s)) {
        while (1) {
            len = s.size();
            for (int i = 0; i < len; i++) {
                if ('a' <= s[i] && s[i] <= 'z') {
                    if (s[i] == 'a') {
                        s[i] = 'z';
                    }
                    else {
                        s[i]--;
                    }
                }
            }
            int res1 = s.find("the");
            int res2 = s.find("this");
            int res3 = s.find("that");
            if ((res1 >= 0 && res1 < 80) || (res2 >= 0 && res2 < 80) || (res3 >= 0 && res3 < 80)) {
                cout << s << endl;
                break;
            }
        }
    }

    return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <cctype>
#include <cstdio>
#include <math.h>
#include <map>
#include <queue>
#include <string>
using namespace std;

char ch;
string text;

int main() {
    while(getline(cin,text)){
    	for(int i=0;i<25;i++){
    		for(int j=0;j<text.size();j++){
    			if(text[j]>='a'&&text[j]<='y')text[j]+=1;
    			if(text[j]=='z')text[j]='a';
    		}
    		int p=text.find("the"),q=text.find("this"),r=text.find("that");
    		if(p!=string::npos||q!=string::npos||r!=string::npos){
    			cout<<text<<endl;
    			break;
    		}
    	}
    }
}

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

using namespace std;

int main()
{
	string S = "";

	getline(cin, S);

	for (int i = 0; i < 26; i++)
	{
		if (!(S.find("this") == S.npos && S.find("that") == S.npos && S.find("the") == S.npos))
		{
			cout << S;
		}

		for (string::size_type j = 0; j < S.size(); j++)
		{
			if (isalpha(static_cast<int>(S[j])))
			{
				if (S[j] == 'z')
				{
					S[j] = 'a';
				}
				else
				{
					S[j]++;
				}
			}
		}
	}

	return 0;
}