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 <algorithm>
#include <vector>
#include <string>
#include <sstream>
#include <fstream>

using namespace std;

int main()
{

//	cut here before submit 
//	freopen("testcase.cc", "r", stdin);
	const string key[] = { "the", "this", "that" };

	string str = "";
	
	while (getline (cin, str )){
		int len = str.length();
		int i,j;
		vector <bool> match (3, false);

		for (j = 0; j < 26; ++j){
			string curr = str;
			for (i = 0; i < len; ++i){
				if ( isalpha(str[i]) ){
					curr[i] = (str[i] - 'a' + j) % 26 + 'a';
				} // end if
			} // end for

			for (i = 0; i < 3; ++i){
				if ( curr.find(key[i]) != string::npos ){
					match[i] = true;
				} // end if
			} // end for
//			if ((int)count(match.begin(), match.end(), true ) > 0){
			if ((int)count(match.begin(), match.end(), true ) == sizeof(key)/sizeof(key[0]) ){

				cout << curr << endl;
				break;
			} // end if
		} // end for
	} // end while
		
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include<string>
#include<vector>
int main() {
	std::string s,a;
	std::getline (std::cin , s);
	int p = s[0] - 't';
	for (int i = 0; i < s.size(); ++i) {
		if (s[i] != ' ' &&s[i]!= '.') {
			if (s[i] - p < 'a') {
				a += 'z' - ('a' - (s[i] - p)-1);
			}
			else a += s[i] - p;
		}
		else a += s[i];
	}
	std::cout << a<< std::endl;
	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]++;
        else 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);
            string tmp;
            bool flg = false;
            for (int i = 0; i < str.size(); i++) {
                if (str[i] != '.')tmp += str[i];
            }
            stringstream ss(tmp);
            while(ss >> tmp) {
                if (tmp == "the" || tmp == "this" || tmp == "that")flg = true;
                break;
            }
            if (flg) {
                cout << str << endl;
                break;
            }
        }
    }
    return 0;
}

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

using namespace std;

int main() {
    while(!cin.eof()) {
        string str;
        getline(cin, str);
        for(int shift = 0; shift < 26; ++shift) {
            if(str.find("the") != string::npos || str.find("this") != string::npos || str.find("that") != string::npos) break;
            for(int i = 0; i < str.size(); ++i) 
                if(islower(str[i]) && ++str[i] > 'z') str[i] = 'a';
        }
        cout << str << endl;
    }
    return 0;
}

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

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

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

int main(){
	string s, strCopy;
	while (getline(cin, s)) {
		for(int j=0 ; j<26 ; j++){
			for(int i=0 ; i<s.size() ; i++){
				if(s[i]>='a' && s[i]<='z'){
					s[i] = (s[i]=='z')? 'a' : s[i] + 1;
				}
			}
			if( s.find( "the" ) != string::npos || s.find( "this" ) != string::npos || s.find( "that" ) != string::npos){
				cout << s << endl;
			}
		}
	}
	
	return 0;
}

C++: #include<iostream>
#include<cstring>
#include<cstdio>
#include<cstdlib>
using namespace std;
int main(){
  char str;
  while(1){
    str = getchar();
    if(str=='.'){
      cout<<str;
      break;
    }
    if(str!=' '){
      str=str-4;
      cout<<str;
    }else{
      cout<<" ";
    }
  }
  cout<<endl;
  return 0;
}

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

int main()
{
    string s;
    while (getline(cin, s))
    {
        for(int n=1; n<26; n++)
        {
            for(int i=0; i<s.size(); i++)
            {
                if(s[i] >= 'a' && s[i] < 'z')
                {
                    s[i]=s[i]+1;
                }
                else if(s[i] == 'z')
                {
                    s[i] = 'a';
                }
                else
                {

                }
            }
            if(  s.find("the")  != std::string::npos
              || s.find("this") != std::string::npos
              || s.find("that") != std::string::npos)
            {
                cout << s << endl;
                break;
            }
        }
    }

    return 0;
}

C++: //C++14 (Clang 3.8.0)

#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <string>
#include <climits>
using namespace std;
typedef long long ll;
typedef pair<long long,long long> P;

bool judge(string s1,int x){
  for(int i=0;i<s1.size();i++){
    if((int)s1[i]+x>122 or (int)s1[i]+x<97) return false;
  }
  if (s1.size()==4){
    if((char)((int)s1[0]+x)=='t' and (char)((int)s1[1]+x)=='h' and (char)((int)s1[2]+x)=='a' and (char)((int)s1[3]+x)=='t') return true;
    if((char)((int)s1[0]+x)=='t' and (char)((int)s1[1]+x)=='h' and (char)((int)s1[2]+x)==    'i' and (char)((int)s1[3]+x)=='s') return true;
  }
  if (s1.size()==3){
    if((char)((int)s1[0]+x)=='t' and (char)((int)s1[1]+x)=='h' and (char)((int)s1[2]+x)==    'e') return true;
  }
  return false;
}
int main(){
  vector<string> v;
  while(1){
    string s;
    cin>>s;
    if(s[s.size()-1]=='.'){
      string tmp="";
      for (int i=0;i<s.size()-1;i++){
        tmp+=s[i];
      }
      v.push_back(tmp);


      break;
    }
    v.push_back(s);
  }
  int ans=10000;
  for (int i=0;i<v.size();i++){
    for(int j=-123;j<123;j++){
      if(judge(v[i],j)){
        ans=j;
        break;
      }
    }
  }
  for(int i=0;i<v.size();i++){
    for (int j=0;j<v[i].size();j++)cout<<(char)(v[i][j]+ans);
    cout<<" ";
  }
  cout<<"."<<endl;
      
}