Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func cipher(text string, direction int, int_shift int) string {
	shift, offset := rune(int_shift), rune(26)
	runes := []rune(text)
	for index, char := range runes {
		switch direction {
		case 1:
			if char >= 'a' && char <= 'z'-shift || char >= 'A' && char <= 'Z'-shift {
				char = char + shift
			} else if char > 'z'-shift && char <= 'z' || char > 'Z'-shift && char <= 'Z' {
				char = char + shift - offset
			}
		case -1:
			if char >= 'a'+shift && char <= 'z' || char >= 'A'+shift && char <= 'Z' {
				char = char - shift
			} else if char >= 'a' && char < 'a'+shift || char >= 'A' && char < 'A'+shift {
				char = char - shift + offset
			}
		}
		runes[index] = char
	}
	return string(runes)
}

func main() {
	for scanner.Scan() {
		infos := strings.Split(scanner.Text(), " ")
		plain := make([]string, len(infos))
		// fmt.Println(infos)
		Decryption:
			for i := 0; i < 26; i++ {
				for j := range infos {
					plain[j] = cipher(infos[j], 1, i)
				}
				for j := range plain {
					if plain[j] == "this" || plain[j] == "that" || plain[j] == "the" {
						break Decryption
					}
				}
			}
			fmt.Println(strings.Join(plain, " "))
	}
}

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

bool find( string a, string b )                         //文字列aの中に、bが含まれているかどうか判定する関数
{
    for( int i = 0; i <= a.size() - b.size(); i++ )
    {
        int j = i, k = 0;
        while( k < b.size() )
        {
            if( a[j] == b[k] )
            {
                j++;
                k++;
            }
            else
                break;
        }
        if( k == b.size() )
            return true;
    }
    return false;
}

int main()
{
    string cipher;
    string cand;

    int i = 0;                                               //cand[24]まで順にずらした文字列を順に格納
    while ( getline( cin, cipher ) )
    {
        for( int k = 1; k < 26; k++ )
        {
            cand = "";
            for( int j = 0; j < cipher.size(); j++, i++ )    //candに文字列を入れる操作
            {
                if( cipher[j] == ' ' )
                    cand += " ";
                else if( cipher[j] == '.' )
                    cand += ".";
                else
                    cand += 97 + ( cipher[j] + k ) % 26;     //cipherの文字列を順にずらして、candに格納
            }
            if( find( cand, "this" ) == true || find( cand, "that" ) == true || find( cand, "the" ) == true )
                cout << cand << endl;
        }
    }
    return 0;
}

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

int main(int argc, const char * argv[])
{
    char input[60][40];
    int i = 0;
    int k, m, o, q, s, u;
    while (scanf("%s", input[i]) != EOF) {
        i++;
    }
    for (o = 0; o < 26; o++) {
        for (k = 0; k < i; k++) { //行分繰り返す
            for (m = 0; m < strlen(input[k]); m++) {//何文字目か
                if (isalpha(input[k][m])) {
                    input[k][m] += 1;
                    if (input[k][m] > 'z') {
                        input[k][m] -= 26;
                    }
                }
            }
        }
        for (s = 0; s < i; s++) {
            for (u = 0; u < strlen(input[s]); u++) {
                if (input[s][u] == 't') {
                    if (input[s][u + 1] == 'h') {
                        if (input[s][u + 2] == 'e' && u + 2 == strlen(input[s]) - 1) {
                            goto finish;
                        }
                        else if (input[s][u + 2] == 'i'){
                            if (input[s][u + 3] == 's' && u + 3 == strlen(input[s]) - 1) {
                                goto finish;
                            }
                        }
                        else if (input[s][u + 1] == 'a'){
                            if (input[s][u + 2] == 't' && u + 2 == strlen(input[s]) - 1) {
                                goto finish;
                            }
                        }
                    }
                }
            }
        }
    }
finish:
    for (q = 0; q < i; q++) {
        printf("%s", input[q]);
        if (q != i - 1) {
            printf(" ");
        }
    }
    puts("");
    return 0;
}

C++:  string s

C++: #include <iostream>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <stdlib.h>

using namespace std;


int main(){
	string line;

	while(getline(cin, line)){
		int flag = 0;

		for(int i=0 ; i<26 ; i++){
			for(int j=0 ; j<line.size() ; j++){
				if(line[j] != ' ' && line[j] != '.'){
					if(line[j] == 'a'){
						line[j] = 'z' ;
					}else{
						line[j]--;
					}
				}
			}

			for(int k=0 ; k<line.size()-2 ; k++){
				if(line[k] == 't' && line[k+1] == 'h'){
					flag = 1;
					cout << line << endl;
					break;
				}
			}
			if(flag == 1) break;
		}
		//cout << line << endl;
	}
	return 0;
}

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

using namespace std;

int main()
{
	string S[80]; int C = 0;

	while (getline(cin, S[C]))
	{
		C++;
	}

	for (int i = 0; i < 26; i++)
	{
		for (int c = 0; c < C; c++)
		{
			if (!(S[c].find("this") == string::npos && S[c].find("that") == string::npos && S[c].find("the") == string::npos))
			{
				for (int j = 0; j < C; j++) { cout << S[j] << endl; }

				goto Exit;
			}

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

Exit:;

	return 0;
}

C++: //
// Created by Tian Wang on 16/4/3.
//
#include <iostream>
#include <string>
#include <vector>

using namespace std;

bool ascii_diff(string x1, string x2) {
    int len = x1.size();
    bool flag = true;
    for(int i = 1; i < len; i++) {
        int diff1 = (int)x1[i] - (int)x1[i-1];
        int diff2 = (int)x2[i] - (int)x2[i-1];
        if(diff1 != diff2) {
            flag = false;
        }
    }
    return flag;
}

int main() {
    string str1 = "the";
    string str2 = "this";
    string str3 = "that";
    string x;
    int len, len_whole;
    int diff=0;
    string word;
    int word_len;
    int sent_len;
    int ascii;
    char k;
    vector<string> input;

    for(string line; getline(cin, line);) {
        len_whole = line.size();
        string x1;
        for(int i = 0; i < len_whole; i++) {
            k = line[i];

            if((int)k >= 97 & (int)k <=122) {
                x1.push_back(k);
            }
            else {
                input.push_back(x1);
                x1.clear();
                x1.push_back(k);
                input.push_back(x1);
                x1.clear();
            }
        }
        if(x1.size() > 0) {
            input.push_back(x1);
        }
        x1.clear();
        sent_len = input.size();
        for(int i =0; i < sent_len; i++) {
            x = input[i];
            len = x.size();
            if(len == 3) {
                if(ascii_diff(str1, x)) {
                    diff = (int)x[0] - (int)str1[0];
                }
            }
            else if(len == 4) {
                if(ascii_diff(str2, x)) {
                    diff = (int)x[0] - (int)str2[0];
                }
                else if (ascii_diff(str3, x)) {
                    diff = (int)x[0] - (int)str3[0];
                }
            }
        }
        for(int i = 0; i < sent_len; i++) {
            word = input[i];
            word_len = word.size();
            for(int j = 0; j < word_len; j++) {
                ascii = (int)word[j];
                if(ascii >= 97 & ascii <=122) {
                    cout << (char)(ascii-diff);
                }
                else {
                    cout << (char)ascii;
                }
            }
        }
        cout << endl;
        input.clear();
    }
    return 0;
}