Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	for scanner.Scan() {
		var result string
		line := scanner.Text()
		key := make(map[string]string)

		var i int32
		for ; i < 52; i++ {
			makeKey(key, i)
			result = decode(key, line)

			if strings.Contains(result, "the") {
				break
			} else if strings.Contains(result, "this") {
				break
			} else if strings.Contains(result, "that") {
				break
			}
		}

		fmt.Println(result)
	}
}

func makeKey(key map[string]string, shift int32) {
	for i := 'a'; i <= 'z'; i++ {
		cipher := (i + shift)
		if cipher > 'z' {
			cipher = cipher%'z' + 'a' - 1
		} else if cipher < 'a' {
			cipher = cipher + ('z' - 'a') + 1
		}
		key[string(i)] = string(cipher)
	}
}

func decode(key map[string]string, cipher string) string {
	var result string
	for _, v := range cipher {
		if key[string(v)] != "" {
			result += key[string(v)]
		} else {
			result += string(v)
		}
	}
	return result
}

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

using namespace std;

void Shift(string *str, int shift, int vec) {
  for (int str_i = 0; str_i < str->size(); str_i++)
    if (!isspace((*str)[str_i]) && (*str)[str_i] != '.')
      (*str)[str_i] += vec * shift;
}

bool FindTarget(string str) {
  if (str.find("the") != string::npos ||
      str.find("this") != string::npos ||
      str.find("that") != string::npos)
    return true;
  else
    return false;
}

int main() { 
  string input_str;

  int shift = 1;
  while (getline(cin, input_str)) {
    while (1) {
      Shift(&input_str, shift, -1);
      if (FindTarget(input_str))
        break;
      Shift(&input_str, shift, 1);
      Shift(&input_str, shift, 1);
      if (FindTarget(input_str))
        break;
      Shift(&input_str, shift, -1);
      shift++;
    }
    cout << input_str << endl;
  }

  return 0;
}

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

int main(void){
  int len, cnt;
  string str;

  getline( cin, str );
  if( str[str.size()-1] == '\n' )
    str.erase(str.size()-1);
  if( str[str.size()-1] == '\r' )
    str.erase(str.size()-1);

  len = str.length();
  cnt = 0;

  while(true){
    if( str.find("the", 0) != string::npos
	|| str.find("this", 0) != string::npos 
	|| str.find("that", 0) != string::npos
	)
      break;
    for(int i = 0; i < len; i++){
      if( 'a' <= str[i] && str[i] <= 'z' ){
	str[i]++;
	if(str[i] > 'z')
	  str[i] = 'a';
      }
    }

    cnt++;
    if(cnt > 30)
      break;
  }
  
  cout << str << endl;

  return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
int main(){
	string s;
	while(getline(cin,s)){
		for(int i=0;i<26;++i){
			for(int j=0;j<s.size();++j) if('a'<=s[j]&&s[j]<='z') s[j]=((s[j]-'a'+1)%26+'a');
			if(s.find("the")!=-1||s.find("this")!=-1||s.find("that")!=-1)break;
		}
		cout<<s<<endl;
	}
	return 0;
}

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

int main(){
	string str[80];
	int shi_rate;
	int p;
	bool flag, shifted;
	
	p = 0;
	shifted = false;
	while(!flag){
		cin >> str[p];
		//if(str[p] == "\n") break;
		
		if(str[p][str[p].size() - 1] == '.') flag = true;
		else flag = false;
		
		if(!flag && !shifted){
			if(str[p].size() == 3){
				if(str[p][2] - str[p][1] == -3 && str[p][0] - str[p][1] == 12){
					shi_rate = str[p][0] - 116;
					shifted = true;
				}
			}
			else if(str[p].size() == 4){
				if(str[p][0] - str[p][1] == 12 &&
				 ((str[p][0] == str[p][3] && str[p][3] - str[p][2] == 19) ||
				  (str[p][3] - str[p][2] == 10 && str[p][2] - str[p][1] == 1))){
					shi_rate = str[p][0] - 116;
					shifted = true;
				}
			}
		}
		else if(flag && !shifted){
			if(str[p].size() == 4){
				if(str[p][2] - str[p][1] == -3 && str[p][0] - str[p][1] == 12){
					shi_rate = str[p][0] - 116;
					shifted = true;
				}
			}
			else if(str[p].size() == 5){
				if(str[p][0] - str[p][1] == 12 &&
				 ((str[p][0] == str[p][3] && str[p][3] - str[p][2] == 19) ||
				  (str[p][3] - str[p][2] == 10 && str[p][2] - str[p][1] == 1))){
					shi_rate = str[p][0] - 116;
					shifted = true;
				}
			}
		}
		p++;
	}
	
	for(int i = 0; i < p; i++){
		for(int j = 0; j < str[i].size(); j++){
			if(str[i][j] != '.') cout << (char)((str[i][j] - 71 - shi_rate) % 26 + 97);
			else cout << '.';
		}
		if(i < p - 1) cout << " ";
		else cout << endl;
	}
	//cout << shi_rate << endl;
	
	return 0;
}

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

//メイン関数
int main()
{
  char str[81];
   while(fgets(str,sizeof(str),stdin)!=NULL){
  // while(scanf("%[^/n]s",str)!=EOF){

    //strstrで探索
  if((strstr(str,"the")) || (strstr(str,"this")) || (strstr(str,"that"))){
    puts(str);
    continue;
  }
  int len=strlen(str);
    for(int i=1;i<=26;i++){
      for(int j=0;j<len;j++){
	if(str[j]>='a' && str[j]<='z'){       
	  str[j]++;
	  if(str[j]=='{'){
	    str[j]='a';
	  }
	}
      }
      //strstrで探索
      if((strstr(str,"the")) || (strstr(str,"this")) || (strstr(str,"that")))break;
    }
    printf("%s\n",str);
  }
   return 0;
}

C++: #include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
int main(){

  //  string x;
  char x[100];
  gets(x);
  //  cin >> x;
  bool is = true;
  if(strlen(x) >= 3){
    for(int i = 0; i < 30 ; i++){
      //the 
      for(int j = 0; j <= strlen(x)-3; j++){
	if(is && x[j] =='t' && x[j+1] == 'h' && x[j+2] == 'e'){
	  is = false;
	  break;
	}
      }
      // this or that
      if(strlen(x) >= 4){
	for(int j = 0; j <= strlen(x)-4; j++){
	  if(is && x[j] =='t' && x[j+1] == 'h' && x[j+2] == 'a' && x[j+3] =='t' ){
	    is = false;
	    break;
	  }
	  if(is && x[j] =='t' && x[j+1] == 'h' && x[j+2] == 'i' && x[j+3] =='s' ){
	    is = false;
	    break;
	  }
	}
      }
      // increment
      if(is == false) break; 
      for(int j = 0; j < strlen(x) ; j++){
	if(x[j] == 'z') x[j] = 'a';
	else if(x[j] >= 'a' && x[j] < 'z') x[j]++;
      }
    }
    
    if(is == false)	
      cout << x << endl;
  }
  return 0;
}

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

int main()
{
	string s;
	getline(cin, s);
	int n = s.size();
	for (int i = 0; i < 26; i++) {
		bool flag = false;
		for (int j = 0; j + 3 <= n; j++) {
			if (s.substr(j, 3) == "the") {
				flag = true;
			}
		}
		for (int j = 0; j + 4 <= n; j++) {
			if (s.substr(j, 4) == "this") {
				flag = true;
			}
		}
		for (int j = 0; j + 4 <= n; j++) {
			if (s.substr(j, 4) == "that") {
				flag = true;
			}
		}
		if (flag) {
			cout << s << endl;
			break;
		}
		for (int j = 0; j < n; j++) {
			if (s[j] >= 'a' && s[j] <= 'z') {
				s[j] = s[j] == 'z' ? 'a' : s[j] + 1;
			}
		}
	}
	return 0;
}

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

using namespace std;

string rotate(string str) {
    for (int i = 0; i < str.size(); i++) {
        if ('a' <= str[i] && str[i] < 'z')str[i]++;
        if (str[i] == 'z')str[i] = 'a';
    }
    return str;
}

int main() {
    string str;
    while(getline(cin, str)) {
        for (int i = 0; i < 26; i++) {
            str = rotate(str);
            bool flg = false;
            stringstream ss(str);
            string tmp;
            while(ss >> tmp) {
                if (tmp == "the" || tmp == "this" || tmp == "that")flg = true;
                break;
            }
            if (flg)cout << str << endl;
        }
    }
    return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
  int ans=-1,len=0;
  string s;
  getline(cin,s);
  while(len<30){
    ans = s.find("the");
    if(ans!=-1)break;
    ans = s.find("this");
    if(ans!=-1)break;
    ans = s.find("that");
    if(ans!=-1)break;
    for(int i=0;i<s.size();i++){
      if(s[i]=='z') s[i]='a';
      else if(s[i]>='a' && s[i]<'z') s[i]++;
    }
    len++;
  }
  cout << s << endl;
}