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 <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for(int i = s; i < (int)n; i++)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MP make_pair
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define NCLR(a) memset((a), -1 ,sizeof(a))
#define dump(x) cout << #x << " = " << (x) << "\n";
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n";
#define sq(n) (n) * (n)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef priority_queue<int> maxpq;
typedef priority_queue< int, vector<int>, greater<int> > minpq;
typedef complex<double> P;
static const double EPS = 1e-10;
static const double PI = acos( -1.0 );
static const int mod = 1000000007;
static const int INF = 1 << 30;
static const LL LL_INF = 1152921504606846976;
static const int dx[] = { -1, 0, 1, 0, 1, -1, 1, -1 };
static const int dy[] = { 0, -1, 0, 1, 1, 1, -1, -1 };

string str;
map<char, char> change;

int main() {
	for ( int i = 0; i < 26; i++ ) {
		change[ i + 'a' ] = ( i + 1 ) % 26 + 'a';
	}
	getline( cin, str );
	for ( ;; ) {
		for ( int j = 0; j < str.size(); j++ ) {
			if ( str[ j ] >= 'a' && str[ j ] <= 'z' ) {
				str[ j ] = change[ str[ j ] ];
			}
		}
		bool is_can = false;
		for ( int j = 0; j < str.size() - 2; j++ ) {
			if ( str.substr( j, 3 ) == "the" ) {
				is_can = true;
				break;
			}
		}
		for ( int j = 0; j < str.size() - 3; j++ ) {
			if ( str.substr( j, 4 ) == "that" || str.substr( j, 4 ) == "this" ) {
				is_can = true;
				break;
			}
		}
		if ( is_can ) {
			break;
		}

	}
	printf( "%s\n", str.c_str() );
	return 0;
}

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

using namespace std;

int main(int argc, char *argv[]) {
  string str;
  int shif = -1;
  getline(cin, str);
  stringstream ss(str);
  vector<string> words;
  while (ss >> str)
    words.push_back(str);

  vector<string> copy = words;
  bool out = false;
  while (true) {
    for (int i = 0; i < words.size(); i++)
      if (words[i] == "this" || words[i] == "that" ||
          words[i] == "the") {
        out = true;
        break;
      }
    if (out)
      break;
    for (int i = 0; i < words.size(); i++)
      for (int j = 0; j < words[i].size(); j++)
        if ('a' <= words[i][j] && words[i][j] <= 'z') {
          words[i][j] += shif;
        } else if (words[i][j] != '.') {
          words = copy;
          shif = 1;
          break;
        }
  }

  for (int i = 0; i < words.size(); i++) {
    if (i)
      cout << ' ';
    cout << words[i];
  }
  cout << endl;
  return 0;
}

C++: #include <cmath>
#include <iostream>
#include <cstdio>
#include <ctype.h>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <iomanip>
#include <set>
#include <stack>
#include <queue>
#include <vector>
#include <sstream>
 
 
using namespace std;
 
 
 
string shift_str(string str, int num)
{
    int ascii;
    string ret;
     
    for (int i=0; i<str.length(); i++)
    {
        ascii = str[i];
        //cout << "ascii = " << ascii << endl;
         
        if (!('a' <= ascii && ascii <= 'z'))
        {
            ret += ascii;
        } else {
            ascii += num;
            if (ascii > 'z')
            {
                ret += ((ascii - 'z') + 'a' - 1);
            } else {
                ret += ascii;
            }
        }
         
    }
     
    return ret;
}
//?°?????????±????????´?????????num??§?????¢???????????????
 
 
int main()
{
    string str;
    string ret;
     
    while (getline(cin, str))
    {
        for (int i=1; i<=26; i++)
        {
            ret = shift_str(str, i);
            if ( ret.find("the", 0) != -1
                || ret.find("this", 0) != -1
                || ret.find("that", 0) != -1 )
            {
                cout << ret << endl;
                break;
            }
        }
    }
     
    return 0;
}

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

int main(){
  string s;

  while( getline( cin,s ) ){
    for( int i=0;i<26;i++ ){
      for( unsigned int j=0;j<s.length();j++ ){
	if( s[j]<'a' || s[j]>'z' ) continue;
	if( ++s[j]>'z' ) s[j] = 'a';
      }
      
      //    cout << "in loop : " << s << endl;
      int s1 = s.find("the");
      int s2 = s.find("this");
      int s3 = s.find("that");
      //    cout << s1 << "," << s2 << "," << s3 << endl;
      
      if( s1>=0 || s2>=0 || s3>=0 )
	break;
    }
    cout << s << endl;
  }

  return 0;
}

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

int main() {
	int i, j;
	string s, news;
	while (getline(cin, s)){
		news = s;
		for (i = 1; i <= 25; i++) {
			for (j = 0; j < news.size(); j++){
				if (news[j]>'a' && news[j] <= 'z')news[j] -= 1;
				else if (news[j] == 'a') news[j] = 'z';
			}
			for (j = 0; j < news.size() - 3; j++) {
				if ((news[j] == 't'&&news[j + 1] == 'h') && (news[j + 2] == 'e' || (news[j + 2] == 'i'&&news[j + 3] == 's') || (news[j + 2] == 'a'&&news[j + 3] == 't'))) {
					goto end;
				}
			}
		}
	end:
		cout << news << endl;
	}
}