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 <fstream>
#include <algorithm>
#include <vector>
#include <string>
#include <functional>
#include <array>
#include <stack>
#include <queue>
#include <chrono>
#include <numeric>
#include <memory.h>
#include <map>
#include <math.h>
#include <utility>
#include <set>

#pragma warning(disable:4996)
using namespace std;
#define REP(i,n) for(int i = 0 ; i < n ; ++i)
typedef long long Int;
const double PI = 3.141592653589793238;
const Int INF = 999999999999;
typedef pair<int, int> P;

vector<string> aa;

int main()
{
	string a;

	getline(cin, a);
	auto left = a.begin();
	
	while (true){
		auto right = left;
		while (right != a.end() && *right != ' ')++right;

		aa.emplace_back(left,right);
		if (right == a.end())
			break;

		left = right+1;
	}
	

	string c[3] = { "this", "that" , "the"};

	vector<string> nn;
	vector<string> kk;
	for (auto x : aa){
		auto n = x.length();
		if (n == 3){
			kk.push_back(x);
		}
		if (n == 4){
			nn.push_back(x);
		}
	}

	for (auto x : kk){
		auto n1 = x[0] - c[2][0];
		bool f(true);

		for (int i = 1; i < 3; ++i){
			if (n1 != x[i] - c[2][i])
				f = false;
		}

		if (f){
			int i(0);
			for (auto x : aa){
				for (auto y : x){
					if (y == '.'){
						std::cout << y;
						continue;
					}

					int q = y - 'a';
					if (q - n1 < 0){
						q = 26 - n1;
					}
					else
						q -= n1;

					std::cout << (char)(q + 'a');
				}
				if (i < aa.size() - 1)
					std::cout << " ";
				++i;
			}
			std::cout << endl;
			return 0;
		}
	}

	for (auto x : nn){
		auto n1 = x[0] - c[0][0];
		auto n2 = x[0] - c[1][0];
		bool f(true);
		bool f2(true);

		for (int i = 1; i < 4; ++i){
			if (n1 != x[i] - c[0][i])
				f = false;
			if (n2 != x[i] - c[1][i])
				f2 = false;
		}

		if (f){
			int i(0);
			for(auto x : aa){
				for (auto y : x){
					if (y == '.'){
						std::cout << y;
						continue;
					}

					int q = y - 'a';
					if (q - n1 < 0){
						q = 26 - n1;
					}
					else
						q -= n1;

					std::cout << (char)(q + 'a');
				}
				if (i < aa.size()-1)
					std::cout << " ";
				++i;
			}
			std::cout << endl;
			return 0;
		}
		else if (f2){
			int i(0);
			for (auto x : aa){
				for (auto y : x){
					if (y == '.'){
						std::cout << y;
						continue;
					}

					int q = y - 'a';
					if (q - n2 < 0){
						q = 26 - n2;
					}
					else
						q -= n2;

					std::cout << (char)(q + 'a');
				}
				if (i < aa.size() - 1)
					std::cout << " ";
				++i;
			}
			std::cout << endl;
			return 0;
		}

	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <deque>
#include <list>
#include <string>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <stdio.h>

using namespace std;

int pat[3][3];
int len[3];
int chr[3];
int zure;
int size;
bool atteru[3];
char text[100];
char ptext[100];

int main() {
	//cin >> text;
	while (gets(text)) {
		bool flag = false;
		for (int i = 0; i < size; i++) {
			if (text[i] != ptext[i]) break;
			if (i == size-1) flag = true;
		}
		if (flag) break;
	//int size = text.size();
	int pt = 0;
	size = 100;

	pat[0][0] = 't' - 'h';
	pat[0][1] = 'h' - 'e';
	pat[1][0] = 't' - 'h';
	pat[1][1] = 'h' - 'i';
	pat[1][2] = 'i' - 's';
	pat[2][0] = 't' - 'h';
	pat[2][1] = 'h' - 'a';
	pat[2][2] = 'a' - 't';
	chr[0] = 'e';
	chr[1] = 's';
	chr[2] = 't';
	len[0] = 3;
	len[1] = 4;
	len[2] = 4;

	for (int i = 0; i < 3; i++) {
		for (int j = 0; j < 3; j++) {
			if (pat[i][j] < 0) pat[i][j] += 26;
		}
	}

	zure = -1;

	int cnt = 0;
	atteru[0] = true;
	atteru[1] = true;
	atteru[2] = true;
	for (int i = 0; i < size-1 && zure == -1; i++) {
		if (text[i] == ' ') {
			cnt = 0;
			atteru[0] = true;
			atteru[1] = true;
			atteru[2] = true;
			//cout << "yarinaoshi!" << endl;
			continue;
		}
		if (text[i+1] == ' ' || cnt > 3) continue;
		int dist = text[i] - text[i+1];
		if (dist < 0) dist += 26;
		for (int j = 0; j <= 2; j++) {
			if (!atteru[j]) continue;
			if (cnt >= len[j]-1) continue;
			if (dist != pat[j][cnt]) {
				atteru[j] = false;
				//cout << j << " ha tigau!" << endl;
				continue;
			} else if (cnt == len[j]-2) {
				if (text[i+2] == ' ') {
					//cout << j << " ha atteta!" << endl;
					zure = text[i+1] - chr[j];
					if (zure < 0) zure += 26;
					//cout << "zure = " << zure << endl;
				} else {
					atteru[j] = false;
					continue;
				}
			}
		}
		cnt++;
	}

	for (int i = 0; i < size; i++) {
		if (text[i] == EOF) break;
		if (text[i] < 'a' || text[i] > 'z') continue;
		text[i] = text[i] - zure;
		if (text[i] < 'a') text[i] += 26;
	}

	cout << text << endl;
	}

	return 0;
}

/*@@@@@@@@@@@@@@@@@@@@@@@@@*/
/*@                       @*/
/*@ debug output erased ? @*/
/*@                       @*/
/*@@@@@@@@@@@@@@@@@@@@@@@@@*/

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

using namespace std;

int main() {
	string abc = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz";
	string s;
	while (getline(cin, s)) {
		while (true) {
			string::size_type index = s.find("the");
			string::size_type index2 = s.find("this");
			string::size_type index3 = s.find("that");
			if (index != string::npos || index2 != string::npos || index3 != string::npos) {
				break;
			}
			for (int i = 0; i < s.size(); i++) {
				for (int j = 0; j < 26; j++) {
					if (s[i] == abc[j]) {
						s[i] = abc[j+1];
						break;
					}
				}
			}
		}
		cout << s << endl;
	}
	return 0;
}

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

int main() {
	std::string line;
	while (std::getline(std::cin, line)) {
		for (int i = 0; i < 26; i++) {
			if (line.find("the") != std::string::npos || line.find("this") != std::string::npos || line.find("that") != std::string::npos) break;
			for (std::string::iterator itr = line.begin(); itr != line.end(); itr++) {
				if (*itr >= 'a' && *itr <= 'z') {
					*itr = ((*itr - 'a' + 1) % 26) + 'a';
				}
			}
		}
		std::cout << line << std::endl;
	}
}

C++: //Caesar Cipher
#include<bits/stdc++.h>
using namespace std;

int main(){
  vector<string> v;
  string s;
  while(getline(cin, s)){
    stringstream ss(s);
    string tmp;
    v.clear();
    while(getline(ss, tmp, ' ')){
      v.push_back(tmp);
    }
    while(true){
      bool flag=false;
      for(int i=0; i<v.size(); i++){
        for(int j=0; j<v[i].length(); j++){
          if(v[i][j]=='.') continue;
          if(v[i][j]=='z') v[i][j]='a';
          else v[i][j]++;
        }
      }
      for(int i=0; i<v.size(); i++){
        if(v[i]=="this" || v[i]=="that" || v[i]=="the") flag=true;
      }
      if(flag)break;
    }
    for(int i=0; i<v.size(); i++){
      if(i!=v.size()-1) cout << v[i] << ' ';
      else cout << v[i] << endl;
    }
  }
  return 0;
}