#include <iostream>
using namespace std;
string encode(string message, string key) {
string encoded = "";
int keyIndex = 0;
int encodedLetter;
int k;
for (char letter : message) {
k = key[keyIndex] - 'a';
encodedLetter = letter + k;
if (encodedLetter > 'z') {
encodedLetter = encodedLetter - 'z' + 'a';
}
encoded += (char)encodedLetter;
keyIndex++;
keyIndex %= key.length();
}
return encoded;
}
int main() {
string message = "computerscience";
string key = "cat";
string encoded = encode(message, key);
cout << encoded << endl;
return 0;
}