#include #include using namespace std; int main() { string s1,s2; cin >> s1; while ( s1 != "0" ) { cin >> s2; string coded = ""; int s1length = s1.length(); for ( int i = 0; i < s2.length(); i++ ) { char thisChar = (s2[i]-'A')+(s1[i%s1length] - 'A'+1); thisChar %= 26; thisChar = 'A' + thisChar; coded += thisChar; } cout << coded << endl; cin >> s1; } return 0; }