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 <stdio.h>
int check(int a,int b,int c)
{
    //printf("[%d][%d][%d]\n",a,b,c);
    if(a != 14)return 0;
    else if(b == 23)return 1;
    else if(b == 1 && c == 10)return 1;
    else if(b == 19 && c == 19)return 1;
    else return 0;
}

int main()
{
    int longth,mem = 0;
    while(1)
    {
        char str[90] = {0};
        int mem1[90] = {0},mem2[90] = {0};
        if(scanf("%c",&str[0]) == -1)return 0;
        if(str[0] >= 'a' && 'z' >= str[0])mem1[0] = str[0] - 'a' + 1;
        for(int i = 1; i < 80; i++)
        {
            scanf("%c",&str[i]);
            if(str[i] == '\n')break;
            longth = i;
            if(str[i] >= 'a' && 'z' >= str[i])mem1[i] = str[i] - 'a' + 1;
        }
        for(int i = 0; i < longth; i++)
        {
            if(mem1[i] == 0);
            else if(mem1[i + 1] != 0)
            {
                if(mem1[i] <= mem1[i + 1])mem2[i] = mem1[i + 1] - mem1[i];
                else mem2[i] = 26 - mem1[i] + mem1[i + 1];
            }
        }
        /*for(int i = 0; i < longth; i++)
        {
            printf("[%d]",mem2[i]);
        }
        printf("\n");*/
        for(int i = 0; i < longth; i++)
        {
            if(mem2[i] != 0)/*printf("[%d]\n",i);*/if(check(mem2[i],mem2[i + 1],mem2[i + 2]))if(mem1[i] <= 20)mem = 20 - mem1[i];else mem = 26 - mem1[i] + 20;
            //else printf("no\n");
        }
        //printf("{{%d}}\n",mem);
        for(int i = 0; i < longth + 1; i++)
        {
            if(str[i] >= 'a' && 'z' >= str[i])printf("%c",(str[i] - 'a' + mem) % 26 + 'a');
            else printf("%c",str[i]);
        }
        printf("\n");
    }
}

C++: #include<iostream>
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(s[j] == 'z') s[j] = 'a';
	else if(s[j] >= 'a' && s[j] < 'z') s[j]++;
      }
      if(s.find("this") != string::npos ||
	 s.find("the") != string::npos||
	 s.find("that") != string::npos){
	cout <<s<<endl;
	break;
      }
    }
  }
  return 0;
}

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

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

using namespace std;

int main(int argc, char *argv[]) {
  string str;
  vector<string> result;
  while (getline(cin, str)) {
    while (true) {
      if (str.find(" this ") != string::npos ||
          str.find(" that ") != string::npos ||
          str.find(" the ") != string::npos)
        break;
      else
        for (int i = 0; i < str.size(); i++)
          if ('a' <= str[i] && str[i] <= 'z') {
            if (str[i] == 'a')
              str[i] = 'z';
            else
              str[i]--;
          }
    }
    cout << str << endl;
  }
  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;
    bool new_line_flag = false;

    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();
            }
        }
        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;




/**
    while(cin >> noskipws >> x) {
        cout << x << endl;

        input.push_back(x);
        len = x.size();
        if(x.back() == '\n') {
            x.pop_back();
            new_line_flag = true;
        }
        if((int)x.back() < 97 | (int)x.back() > 122 ) {
            x.pop_back();
        }
        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];
            }
        }
        if(new_line_flag) {
            new_line_flag = false;
            break;
        }
    }
    int input_size = input.size();
    for(int i = 0; i < input_size; 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;
            }
        }
        if(i != input_size-1) {
            cout << " ";
        }
        else{
            cout <<endl;
        }
    }
    return 0;
    **/
}