Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

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 {
		infos := strings.Split(nextString(), " ")
		plain := make([]string, len(infos))
		if len(infos) == 0 {
			break
		}
		// 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 <cmath>
using namespace std;
int main(){
  string s,t;
  while(true){

    getline(cin,s);
    if(cin.eof())break;

    for(int i = 0 ; i < 26 ; i++ ){
      t = "";
      for(int j = 0 ; j < (int)s.size() ; j++ ){
	if('a'<= s[j] && s[j]<= 'z'){
	  if((s[j] + i) > 'z')t+=(char)(s[j] + i - 26);
	  else t+=(char)(s[j]+i);
	}
	else t += s[j];
      }
      if(t.find("the") != string::npos ||
	 t.find("this") != string::npos ||
	 t.find("that") != string::npos ){
	cout << t << endl;
	break;
      }
    }
  }
  return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
  int ans=-1;
  string s;
  getline(cin,s);
  while(1){
    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]++;
    }

  }
  cout << s << endl;
}

C++: #include <stdio.h>
#include <string.h>
int main(void){
	int i = 0;
	int j;
	int k = 0;
	char s[41][81] = {};

	while (scanf("%s ", s[i]) != EOF)
		i++;

		while (1) {
			for (j = 0; j < i; j++)
				if (strcmp(s[j], "the") == 0 || strcmp(s[j], "this") == 0 || strcmp(s[j], "that") == 0)
					break;

			if (strcmp(s[j], "the") == 0 || strcmp(s[j], "this") == 0 || strcmp(s[j], "that") == 0)
				break;
			if (strcmp(s[j--], "the.") == 0 || strcmp(s[j], "this.") == 0 || strcmp(s[j], "that.") == 0)
				break;

			for (j = 0; j < i; j++) {
				k = 0;
				while (s[j][k]){
					if (s[j][k] == 'z')
						s[j][k] = 'a';
					else if (s[j][k] == '.')
						;
					else s[j][k]++;
					k++;
				}
			}
		}

	for (j = 0; j < i; j++)
		printf("%s ", s[j]);

	putchar('\n');

	return 0;
}

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

#define SIZE 3

using namespace std;

int main() {
	string str, value[SIZE] = {"the", "this", "that"};
	bool judge;
	while (getline(cin, str)) {
		judge = false;
		for (;;) {
			for (int j = 0; j < str.size(); j++) {
				if ('a' <= str[j] && str[j] <= 'y') {
					str[j]++;
				}
				else if (str[j] == 'z') {
					str[j] = 'a';
				}
			}

			for (int j = 0; j < SIZE; j++) {
				if (str.find(value[j]) != str.npos) {
					judge = true;
				}
			}

			if (judge) {
				cout << str << endl;
				break;
			}
		}
	}

	return 0;
}

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

int main(void)
{
    list<string> input;
    int dec = 0;
    string s;
    while (cin >> s)
    {
        input.push_back(s);

        if (dec == 0)
        {
            int d;
            d = s[0] - 't';

            string t = "";
            for (int i = 0; i < s.length(); i++)
                t += s[i] - d;

            if (t == "the" || t == "this" || t == "that")
                dec = d;
        }
    }
    for (list<string>::iterator i = input.begin(); i != input.end(); i++)
    {
        string out = *i;
        for (int j = 0; j < out.length(); j++)
        {
            if (out[j] != '.')
            {
                cout << (char)(out[j] - dec);
            }
            else
            {
                cout << '.';
            }
        }
        cout << ' ';
    }

    cout << 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",str);
  }
   return 0;
}