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 <bits/stdc++.h>

using namespace std;

int main (){
    //freopen("input.txt" , "r", stdin);
    string str1;
    while(getline (cin, str1)){
            
    int cnt =0;

    for(int i=1; i<27; i++){

        cnt++;

        for(int j=0; j<str1.size(); j++){
            if(str1[j]>= 'a' && str1[j]<= 'z'){
                int ascii = (int)  97+ (((str1[j] % 97) + 1) %26);
                str1[j] = ascii;
            }
            else str1[j] = str1[j];
        }

        //cout<<str1<<endl;

        int position =0, flag =0;

        if((position = (str1.find("this"))) != -1 ){
            flag = 1;
            break;
        }

        else if((position = (str1.find("the"))) != -1 ){
            flag = 1;
            break;
        }

        else if((position = (str1.find("that"))) != -1 ){
            flag = 1;
            break;
        }
    }

    //cout<<"The key: "<<cnt<<endl;
    cout<<str1<<endl;
    str1.clear();

    }


    return 0;
}

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

int main() {
  string str,s;
  int key,word;
  vector<string> seq;
  char decode[4],ans;
  while(getline(cin,str)) {
    seq.clear();
    stringstream ss;
    ss << str;
    while(ss >> s) {
      seq.push_back(s);
    }
    ss.str("");
    ss.clear(stringstream::goodbit);

    word = seq.size();
    key = 100;

    for(int i=0;i<word;i++) {

	decode[0] = *seq[i].substr(0,1).c_str();
	decode[1] = *seq[i].substr(1,1).c_str();
	decode[2] = *seq[i].substr(2,1).c_str();
	decode[3] = *seq[i].substr(3,1).c_str();

	for(int j=1;j<27;j++) {
	  for(int k=0;k<4;k++) {
	    decode[k] -= 97; //a-z 0-25
	    decode[k]++;//1-26
	    decode[k] %= 26;//0-25
	    decode[k] += 97;//97-122
	  }
	  if( (decode[0] == 't' && decode[1] == 'h' && decode[2] == 'e') && (seq[i].size() == 3)) {
	    key = j;
	    break;
	  }
	  if( (decode[0] == 't' && decode[1] == 'h' && decode[2] == 'i' && decode[3] == 's') && (seq[i].size() == 4) ) {
	    key = j;
	    break;
	  }
	  if( (decode[0] == 't' && decode[1] == 'h' && decode[2] == 'a' && decode[3] == 't') && (seq[i].size() == 4) ){
	    key = j;
	    break;
	  }
	}
      
      if(key!=100) break;
    }

    for(int i=0;i<word;i++) {
      for(unsigned int j=0;j<seq[i].size();j++) {
	ans = *seq[i].substr(j,1).c_str();
	if(ans <= 'z' && 'a' <= ans){
	  ans -= 97;
	  ans += key;
	  ans %= 26;
	  ans += 97;
	}
	cout << ans;
      }
      if(i==word-1) {
	break;
      }
      cout << " ";
      
    }
    cout << endl;
  }
}

C++: #include <bits/stdc++.h>

using namespace std;

int main() {
	string str;
	while (getline(cin, str)) {
		for (int i = 0; i < 26; ++i) {
			for (int j = 0; j < (int)str.size(); ++j) {
				if (str[j] >= 'a' && str[j] <= 'z') {
					str[j] = (str[j] - 'a' + 1) % 26 + 'a';
				}
			}
			if (str.find("the") != string::npos || str.find("this") != string::npos || str.find("that") != string::npos) break;
		}
		cout << str << endl;
	}
}

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

int main()
{
    string s;
    while(getline(cin,s))
	{
        for(int i=0;i<26;++i)
		{
            for(int j=0;j<s.size();++j) 
				if('a'<=s[j]&&s[j]<='z')
					
						s[j]=((s[j]-'a'+1)%26+'a');
				 }
        cout<<s<<endl;
    }
    return 0;
}