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>
#include<vector>
using namespace std;

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

  getline( cin, str );

  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;

  return 0;
}

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

using namespace std;

int main() {
    string a;
    
    getline(cin,a);
    
    while (1){
        if(a.find("this")!=-1 || a.find("this")!=-1 || a.find("this")!=-1){
            break;
        }
        
        for(int i=0; i<a.length(); i++){
            if(a[i]==' '|| a[i]=='.'){
                
            }else if(a[i]=='z'){
                a[i]='a';
            }else{
                a[i]++;
            }
        }

    }
    cout<<a<<endl;;
    
    
    return 0;
}

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

int main(){
  string s;
  int cnt=0;

  while(getline(cin, s)){


    while(true){
      bool flag=false;

      for(int i=0;i<s.length();i++){
        string key1 = s.substr(i,3);
        string key2 = s.substr(i,4);
        if(key1 == "the" || key2 == "this" || key2 == "that"){
          flag = true;
          break;
        }
      }

      if(flag){
        cout << s << endl;
        break;
      }

      for(int i=0;i<s.length();i++){
        if(s[i] > 'a' && s[i] < 'z'){
          s[i] -= 'a';
          s[i] -= 1;
          if(s[i] < 0){
            s[i] += 'A' - 'a';
          }
          s[i] += 'a';
        }
      }
    }
  }
}

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

using namespace std;

void CaesarCipher(const string&);
int main(){
  string str;
  while(getline(cin,str)){
    CaesarCipher(str);
  }
}


void CaesarCipher(const string& str){
  string diffstr=str;
  while(diffstr.find("the")==string::npos&&
        diffstr.find("this")==string::npos&&
        diffstr.find("that")==string::npos ){
    for(int i=0;i<str.length();i++){
      diffstr[i]+=isalpha(str[i])?1:0;
    }
  }
}

C++: #include<iostream>
#include<algorithm>
#include<string>
#include<cstdio>
#include<cstring>
using namespace std;
int main(){
  string str;
  char s[256];
  int w = 0;
  while(scanf(" %c",&s[0]) != EOF{
    do {
      w++;
      scanf("%c",&s[w]);
    }while(s[w] != '\n');
    while(1){
      s[w+1] = '\0';
    
      for(int i=0;i<w;i++){
	if(s[i] != ' ' && s[i] != '.'){
	  s[i]++;
	  if(s[i]>'z')s[i] = s[i] - 'z' + 'a' - 1;
	}
      }
      if(strstr(s,"the") != NULL)break;
      if(strstr(s,"that") != NULL)break;
      if(strstr(s,"this") != NULL)break;
    }
    printf("%s",s);
    memset( s , 0 , sizeof(s) );
  }
}

C++: 
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>
#include <time.h>
using namespace std;

int main(){
  int index ,flag=0 ,temp= 'z' - '`';
  string s ,key[3]={ "the" ,"this" ,"that" };

  while( true ){
    flag = 0;
    getline( cin ,s );
    if( cin.eof() ){
      break;
    }

    while( true ){
      for( int i=0 ; i<s.length() ; i++ ){ // シーザー暗号を戻す
	if( s[i] != '.' && s[i] != ' ' && s[i] != '\n' ){ //　記号はスルー
	  s[i]--;
	  if( s[i] < 'a' ){ // aからzに飛ばす
	    s[i] += temp; 
	  }
	}
      }
      
      for( int i=0 ; i<3 ; i++ ){
	index = s.find( key[i] ,0 ); // the ,this ,that を探す
	if( index != string::npos ){ // あった場合
	  cout << s << endl;
	  flag = 1;
	  cin.ignore();
	  break;
	}
      }
      if( flag == 1 ){
	break;
      }
    }
  }
}

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

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

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

string arrs[200];

bool judge4(const string &str) {
	int d1 = str[0] - 't';
	int d2 = str[1] - 'h';
	int d3 = str[2] - 'i';
	int d4 = str[3] - 's';
	int d5 = str[2] - 'a';
	int d6 = str[3] - 't';
	return (d1 == d2 && ((d2 == d3 && d3 == d4) || (d2 == d5 && d3 == d6)));
}

bool judge3(const string &str) {
	int d1 = str[0] - 't';
	int d2 = str[1] - 'h';
	int d3 = str[2] - 'e';
	return (d1 == d2 && d2 == d3);
}

int main() {
	cin.clear();
	int cnt = 0;
	while (!cin.eof()) {
		cin >> arrs[cnt++];
		char ch = getchar();
		if (ch == '\n') {
			bool isOk = 0;
			int delta = 0;
			for (int i = 0; i < cnt; ++i) {
				if (arrs[i].length() == 4) {
					if (judge4(arrs[i])) {
						isOk = 1;
						delta = arrs[i][0] - 't';
						break;
					}
				}else if (arrs[i].length() == 3) {
					if (judge3(arrs[i])) {
						isOk = 1;
						delta = arrs[i][0] - 't';
						break;
					}
				}
			}
			for (int i = 0; i < cnt; ++i) {
				for (int j = 0; j < arrs[i].length(); ++j) 
					if (arrs[i][j] != '.') arrs[i][j]-= delta;
				cout << arrs[i] << ((i == cnt - 1) ? "\n" : " ");
			}
			cnt = 0;
		}
	}
	return 0;
}

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

int main() {
	string sa;
	while (getline(cin, sa)&& sa != "END OF INPUT") {
		int a = sa.size();
		while (1) {
			for (int i = 0; i < a; i++) {
				if (sa[i] >='a' && sa[i] <='z') {
					sa[i] += 1;
				}
					if (sa[i]<'z'){
						sa[i] -= 26;
					}				
			}
			size_t za=sa.find(" this "||" that "||" the ");
			if (za != string::npos) {break;}
		}
		cout << sa << endl;
	}
	return 0;
}