Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

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

func incrementByte(b byte) byte {
	if b >= 97 && b < 122 {
		return b + 1
	} else if b == 122 {
		return 97
	}
	return b
}

func main() {
	scanner.Split(bufio.ScanLines)

	for {
		line := nextString()
		if len(line) == 0 {
			break
		}
		for i := 0; i <= 26; i++ {
			decoded := []byte{}
			for j := 0; j < len(line); j++ {
				decoded = append(decoded, incrementByte(line[j]))
			}
			line = string(decoded)
			if strings.Contains(line, "the") || strings.Contains(line, "this") || strings.Contains(line, "that") {
				fmt.Println(line)
				break
			}
		}
	}
}

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

int size;
string str;
void change()
{
  for (int i = 0; i < size; i++){
    if ('a' <= str[i] && str[i] <= 'y'){
      str[i]++;
    }
    else if (str[i] == 'z'){
      str[i] = 'a';
    }
  }
}

int main()
{
 // string str;

  while (getline(cin, str), str != ""){
    size = str.size();

    for (;;){
      if (str.find("the") != -1 || str.find("this") != -1 || str.find("that") != -1){
        cout << str << endl;
        break;
      }
      change();
    }
    str = "";
  }
  return 0;
}

C++: #include <cstdio>
#include <cstring>

int main(){
    char THIS[] = "this";
    char THE[] = "the";
    char THAT[] = "that";
    
    while(feof(stdin) == 0){
        char str[81];
        fgets(str,80,stdin);
        if(str[0] == 0) break;
        
        int str_cnt = 0;
        int z = 0;
        while(str_cnt < strlen(str)){
            char key[10];
            int offset;
            sscanf(&str[str_cnt],"%s ",key);
            str_cnt += strlen(key) + 1;
            
            switch(strlen(key)){
            case 3:
                offset = THE[0] - key[0];
                if(THE[1] - key[1] == offset && THE[2] - key[2] == offset){
                    z = offset;
                    str_cnt = 999999;
                    break;
                }
                break;
            case 4:
                offset = THIS[0] - key[0];
                if(THIS[1] - key[1] == offset && THIS[2] - key[2] == offset && THIS[3] - key[3] == offset){
                    z = offset;
                    str_cnt = 999999;
                    break;
                }
                if(THAT[1] - key[1] == offset && THAT[2] - key[2] == offset && THAT[3] - key[3] == offset){
                    z = offset;
                    str_cnt = 999999;
                    break;
                }
                break;
            }
        }
        //z *= -1;
        for(int i = 0;i < strlen(str);i++){
            if(str[i] != '\n'){
            if(str[i] != ' ' && str[i] != '.') printf("%c",str[i]+z);
            else                               printf("%c",str[i]); 
            }
                
            }
            printf("\n");
    }
}

C++: #include<stdio.h>
#include<string>
#include<stdlib.h>
#include<math.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<numeric>
#include<string.h>
#include<map>
#include<queue>

using namespace std;

typedef pair<int,int> pii;

#define rep(i,j) for(int i=0;i<(j);i++)
#define reps(i,j,k) for(int i=j;i<=k;i++)
#define in(i,j,k) ((i)>=(j)&&(i)<=(k))


int main(){
	char s[81],c,f=1;
	int l,p;
	for(;;){
		p=0;
		do{
			c=getchar();
			s[p++]=c;
		}while(c!=EOF && c!='\n');
		s[p-1]=0;
		l=strlen(s);
		while(strstr(s,"the")==NULL && strstr(s,"that")==NULL && strstr(s,"this")==NULL){
			rep(i,l){
				if(in(s[i],'a','z')){
					s[i]++;
					if(s[i]>'z')s[i]-=26;
				}
			}
		}
		puts(s);
		if(c==EOF)break;
	}
	return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <stdlib.h>
#include <vector>
#include <stack>

using namespace std;


int main(){
	string line;

	while(getline(cin, line)){
		int flag;

		for(int i=0 ; i<26 ; i++){
			for(int j=0 ; j<line.size() ; j++){
				if(line[j] != ' ' && line[j] != '.'){
					if(line[j] == 'a'){
						line[j] = 'z' ;
					}else{
						line[j]--;
					}
				}
			}

			for(int k=0 ; k<line.size()-2 ; k++){
				if(line[k] == 't' && line[k+1] == 'h'){
					flag = 1;
					break;
				}
			}
			if(flag == 1) break;
		}
		cout << line << endl;
	}
	return 0;
}

C++: #include<stdio.h>
#include<string>
#include<stdlib.h>
#include<math.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<numeric>
#include<string.h>
#include<map>
#include<queue>

using namespace std;

typedef pair<int,int> pii;

#define rep(i,j) for(int i=0;i<(j);i++)
#define reps(i,j,k) for(int i=j;i<=k;i++)
#define in(i,j,k) ((i)>=(j)&&(i)<=(k))


int main(){
	char s[81],c;
	int l,p;
	while(gets(s)!=NULL){
		l=strlen(s);
		while(strstr(s,"the")==NULL && strstr(s,"that")==NULL && strstr(s,"this")==NULL){
			rep(i,l){
				if(in(s[i],'a','z')){
					s[i]++;
					if(s[i]>'z')s[i]-=26;
				}
			}
		}
		puts(s);
	}
	return 0;
}

C++: #include<cstdio>
#include<cctype>
#include<cstring>
using namespace std;
int main(){
    int f = 0;
    while(1){
        char a;
        char str[100] = {0};
        scanf("%[^\n]s",str);
        for(int i = 0;i <= 25; i++){
            for(int j = 0;j < strlen(str); j++){
                if(str[j] == '\n' || str[j] == '.')continue;
                str[j] += 1;
                }
                for(int k = 0;k < strlen(str); k++){
                    if(str[k] == 't' &&  str[k+1] == 'h' && str[k+2] == 'e')goto hoge;
                    if(str[k] == 't' &&  str[k+1] == 'h' && str[k+2] == 'i' && str[k+3] == 's')goto hoge;
                    if(str[k] == 't' &&  str[k+1] == 'h' && str[k+2] == 'a' && str[k+3] == 't')goto hoge;
            }
        }
        for(int i = 0;i < strlen(str); i++){
            if(str[i] == '\n' || str[i] == '.')continue;
            str[i] -= 25;
        }

        for(int i = 0;i <= 25; i++){
            for(int j = 0; j< strlen(str); j++){
                if(str[j] == '\n' || str[j] == '.')continue;
                str[j] -= 1;
            }
            for(int k = 0;k < strlen(str); k++){
                    if(str[k] == 't' &&  str[k+1] == 'h' && str[k+2] == 'e')goto hoge;
                    if(str[k] == 't' &&  str[k+1] == 'h' && str[k+2] == 'i' && str[k+3] == 's')goto hoge;
                    if(str[k] == 't' &&  str[k+1] == 'h' && str[k+2] == 'a' && str[k+3] == 't')goto hoge;
            }
        }

        hoge:

        for(int i = 0;i < strlen(str)-1; i++)if(str[i] == 46)str[i] = ' ';
        printf("%s\n",str);
        //for(int i = 0;i < strlen(str); i++)str[i] = 0;
        getchar();
        if(getchar() == EOF)return 0;
    }
    return 0;
}

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

using namespace std;
int main(){
	string str1;
	int i, j, n = 0;
	while(getline(cin, str1)){
		bool change = false;
		for(i = 0;i < 28;i++){
			for(j = 0;j < str1.size();j++){
				if(str1[j] != ' ' && str1[j] != '.'){
					if(str1[j] == 'a'){
						str1[j] = 'z';
					}
					else str1[j] -= 1;
				}
			}
			for(j = 0;j+3 < str1.size();j++){
				if(str1[j] == 't' && str1[j+1] == 'h'){
					if(str1[j+2] == 'e' || (str1[j+2] == 'i' && str1[j+3] == 's') || (str1[j+2] == 'a' && str1[j+3] == 't')){
						n = i + 1;
						change = true;
						break;
					}
				}
			}
			if(change) break;
		}	
		for(i = 0;i < str1.size();i++){
			cout << str1[i];
		}
		
	}


	return 0;
}