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++: #define scanf_s scanf
#define gets_s gets
#include <stdio.h>
#include <string>
#include <iostream>
#include <math.h>
using namespace std;
#define MAX 81
#define _MAX 100
#define ABC 26
int main(void)
{
	int n, s = 0, x, y, r = 0, d;
	char str[MAX];
	while (gets_s(str) != NULL) {
		for (int i = 0; str[i] != '\0'; ++i) {
			if (str[i] - 't' == str[i + 1] - 'h') {
				d = str[i] - 't';
				if ((str[i + 2] - 'a' - d + ABC) % ABC == 'e' - 'a') { break; }
				else if ((str[i + 2] - 'a' - d + ABC) % ABC == 'i' - 'a' && (str[i + 3] - 'a' - d + ABC) % ABC == 's' - 'a') { break; }
				else if ((str[i + 2] - 'a' - d + ABC) % ABC == 'a' - 'a' && (str[i + 3] - 'a' - d + ABC) % ABC == 't' - 'a') { break; }
			}
		}
		for (int i = 0; str[i] != '\0'; ++i) {
			if ('a' <= str[i] && str[i] <= 'z') {
				printf("%c", (str[i] - 'a' - d + ABC) % ABC + 'a');
			}
			else { printf("%c", str[i]); }
		}
		printf("\n");
	}
}

C++: #include<iostream>
#include<cstdio>
#include<cmath>
#include<vector>
#include<list>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<string>
#include<utility>
#include<algorithm>
#include<functional>
#include<deque>
#include<string.h>
#include<ctype.h>
#include<time.h>
#include<stdlib.h>
using namespace std;

char c[80], word[40][10];
int p = 0, q = 0;

bool search_th(){
  for (int i = 0; i <= p; i++){
    if (word[i][0] == 't' && word[i][1] == 'h'){
      if (word[i][2] == 'e' || (word[i][2] == 'i' && word[i][3] == 's') || (word[i][2] == 'a' && word[i][3] == 't')){
        return true;
      }
    }
  }
  return false;
}

void split_words(){
  for (int i = 0; i < 40; i++){
    for (int j = 0; j < 10; j++){
      word[i][j] = '\0';
    }
  }
  for (int i = 0; i < strlen(c); i++){
    if (c[i] >= 'a' && c[i] <= 'z'){
      word[p][q++] = c[i];
    } else {
      p++;
      word[p++][0] = c[i];
      q = 0;
    }
  }
  for (int i = 0; i <= p; i++){
    printf("word[%d]:%s\n", i, word[i]);
  }
}

int main(){
  while (cin.getline(c, sizeof(c))){
    p = 0;  q = 0;
    split_words();
    while (1){
      if (search_th() == true){
        for (int i = 0; i <= p; i++){
          cout << word[i];
        }
        puts("");  break;
      } else {
        for (int i = 0; i <= p; i++){
          for (int j = 0; j < strlen(word[i]); j++){
            if (word[i][j] >= 'a' && word[i][j] <= 'y'){
              word[i][j]++;
            } else if (word[i][j] == 'z'){
              word[i][j] = 'a';
            }
          }
        }
      }
    }
    for (int i = 0; i < 80; i++){
      c[i] = '\0';
    }
  }
  return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string.h>
#include <queue>
#include <stack>
#include <utility>
#include <queue>
#define mp make_pair
#define pii pair<int,int> 
#define ff first
#define ss second

using namespace std;

char a[1000];
int b,c;

int main()
{
	while(fgets(a,999,stdin))
	{
		c=0;
		while(true)
		{
			if(strstr(a,"this")||strstr(a,"the")||strstr(a,"that"))break;
			for(b=0;b<strlen(a);b++)
			{
				if(islower(a[b]))
				a[b]++;
				if(a[b]>122)
				a[b]=97;
			}
			c++;
			if(c>27)
			break;
		}
		printf("%s",a);
	}
	return 0;
}

C++: #include <iostream>
#include <cstring>
#include <string>
using namespace std;
int main(){
	string str[81]; int diff; int i=0;int flag=0;
	while(cin >> str[i]){
	if(flag==0) diff='t'-str[i][0];
	if(flag==1) ;
	else if(str[i].size()==3 && str[i][1]+diff=='h' && str[i][2]+diff=='e') flag=1;
	else if(str[i].size()==4 && str[i][1]+diff=='h' && str[i][2]+diff=='i' && str[i][3]+diff=='s') flag=1;
	else if(str[i].size()==4 && str[i][1]+diff=='h' && str[i][2]+diff=='a' && str[i][3]+diff=='t') flag=1;
	i++;
	};
	for(int j=0;j<i;j++){
		if(j) cout << ' ' ;
		for(int k=0;k<str[j].size();k++){
			char ch=str[j][k]+diff;
			if(str[j][k]-'a'>=0 && str[j][k]-'z'<=0) cout << ch ;
			else cout << str[j][k] ;
		};
	};
	cout << '\n' ;
}

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++){
      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';
      }
      if((s.find("this ")!=string::npos) || (s.find("that ")!=string::npos) || (s.find("the ")!=string::npos)) break;
    }
    cout << s << endl;
  }
}

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

int main(){
	char input[100],str[50][100];
	const char cmp[3][5]={"that","this","the"};
	int pos=0,last_pos=0,i,j,k,diff,n;
	bool flag;

		fgets(input,100,stdin);
		for(i=0;input[i]!='\0';i++){
			if(input[i]==' ' || input[i]=='.' || input[i]=='\n'){
				for(j=last_pos;j<i;j++){
					str[pos][j-last_pos]=input[j];
				}
				str[pos][j-last_pos]='\0';
				pos++;
				last_pos=i+1;
			}
		}

		n=0;
		flag=false;
		while(++n){
			for(i=0;i<pos;i++){
				for(j=0;str[i][j]!='\0';j++){
					str[i][j]+=1;
					if('a'>str[i][j]){
						str[i][j]+='z'-'a'+1;
					}else if('z'<str[i][j]){
						str[i][j]+='a'-'z'-1;
					}
				}
			}

			for(i=0;i<pos;i++){
				for(j=0;j<3;j++){
					if(strcmp(str[i],cmp[j])==0){
						flag=true;
                        j=3;i=pos;
					}
				}
			}
			if(flag) break;
		}

		int temp;
		for(i=0;input[i]!='\0';i++){
			if(input[i]!='.' && input[i]!=' ' && input[i]!='\n'){
				temp=input[i]+n;
				if('a'>temp){
					input[i]=temp+'z'-'a'+1;
				}else if('z'<temp){
					input[i]=temp+'a'-'z'-1;
				}else{
					input[i]=temp;
				}
			}
		}
		printf("%s",input);

	return 0;
}