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

int main()
{
    int longth,mem;
    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);
            else if(i == 0)if(check(mem2[i],mem2[i + 1],mem2[i + 2],mem2[i + 3]))/*printf("%d\n",i);*/if(mem1[i] <= 20)mem = 20 - mem1[i];else mem = 26 - mem1[i] + 20;
            else if(mem2[i - 1] != 0)if(check(mem2[i],mem2[i + 1],mem2[i + 2],mem2[i + 3]))/*printf("%d\n",i);*/if(mem1[i] <= 20)mem = 19 - mem1[i];else mem = 26 - mem1[i] + 20;
        }
        //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>
#include <string.h>
#include <string>
#include <stdio.h>
using namespace std;
int main() {
	string w[3]={"the","this","that"},st;
	int wn[3]={3,4,4},k,i,j,s,f;
	while(true) {
    k=0; 
	getline(cin,st);
	while(k<st.size()) {
		for (i=0;i<3;i++) {
			s=0; f=0;
			if (st.size()<k+wn[i]) break;
			for (j=0;j<wn[i]-1;j++) if ((w[i][j]-w[i][j+1])==(st[k+j]-st[k+j+1])) s++;
			if (s==wn[i]-1)  { f=1; i=5;}
		}
		if (f==1) break;
		for (k;st[k]>='a' && st[k]<='z' && k<80; k++);
		k++;
	}
	if (f==0) cout << st; else {
		for (i=0;i<st.size();i++) 
			if ((st[i]>='a' && st[i]<='z')) cout << (char)(((st[i]-st[k]+'t')-97+26) % 26 + 97) ; 
		    else cout << st[i];
	}
	cout << endl;
	}
	return 0;
	}

C++: #include<iostream>
#include<string>
#include<cstdio>
using namespace std;
int main() {
	string a = "";
	while (getline(cin, a)) {
		a += " ";
		string b = "";
		int z = 0, sum = 0;
		int k = a.length();
		for (int i = 0; i <k; i++) {
			if (a[i] == ' ' || a[i] == '.' || a[i] == ',') {
				b = a.substr(z, i - z);
				int t = (int)'t';
				string c = "";
				if (b.length() == 3 || b.length() == 4) {
					c = "";
					int w = t - (int)b[0];
					for (int i = 0; i < b.length(); i++) {
						int d = (char)((int)b[i] + w);
						if (d > 'z')
							d -= 26;
						else if (d < 'a')
							d += 26;
						c += (char)d;
					}
					if (c == "the" || c == "that" || c == "this") {
						sum = w;
						break;
					}
				}
				z = i + 1;
			}
		}
		string f = "";

		for (int i = 0; i < k; i++) {
			if (a[i] != ' ' && a[i] != '.' && a[i] != ',') {
				int g = (int)a[i] + sum;
				if (g >(int)'z')
					g -= 26;
				else if (g < (int)'a')
					g += 26;
				f += (char)g;
			}
			else {
				f += a[i];
			}
		}
		cout << f << endl;
	}
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
	string s,t;
	getline(cin,s);t=s;
	for(int i=0;i<26;i++){
		s=t;
		for(int j=0;j<s.size();j++){
			if(s[j]>='a'&&s[j]<='z')for(int k=0;k<i;k++){
				s[j]++;
				if(s[j]>'z')s[j]-=26;
			}
		}
		if(s.find("the")!=s.npos||s.find("this")!=s.npos||s.find("that")!=s.npos)break;
	}
	cout<<s<<endl;
}

C++: #include <iostream>
#include <cstring>
#include <stdio.h>

int find(const std::string &str){
	return (str.find("this",0)!=std::string::npos) + (str.find("that",0)!=std::string::npos) + (str.find("the",0)!=std::string::npos);
}

std::string rot(const std::string &prm, int n)
{
	std::string str=prm;

	for(int i=0; i < str.size(); i++){
		if(('a'<=str[i]) && (str[i]<='z'))
			str[i] = (str[i]+n > 'z')?(str[i]+n-'z'+'a'-1):(str[i]+n);
	}
return str;
}
	
int main(void)
{
	char s[81]="";
	while(std::cin.getline(s,sizeof(s)))
	{
		std::string in=s;
		for(int i=0;i < ('z'-'a')+1;i++)
		{
			if(find(rot(in, i))){
				std::cout << rot(in, i) << std::endl;
				break;
			}
		}
	}
	return 0;
}

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

int main(void)
{
	string s;
	getline(cin, s);
	int diff='t'-s[0];

	for(int i=0; i<s.length(); i++)
	{
		if(s[i]!=' ' && s[i]!='.')
			s[i] = (s[i]+diff-'a'+26)%26+'a';
	}
	cout << s << endl;

	return 0;
}

C++: #include <iostream>
#include <complex>
#include <cmath>
#include <cstdio>
#include <string>

using namespace std;

string rotate(string str) {
    for (int i = 0; i < str.size(); i++) {
        if ('a' <= str[i] && str[i] < 'z')str[i]++;
        if (str[i] == 'z')str[i] = 'a';
    }
    return str;
}

int main() {
    string str;
    while(getline(cin, str)) {
        for (int i = 0; i < 26; i++) {
            str = rotate(str);
            if (str.find("this") != string::npos ||
                str.find("the") != string::npos ||
                str.find("that") != string::npos) {
                cout << str << endl;
                break;
            }
        }
    }
    return 0;
}