#include <iostream>
#include <stdio.h>
#include <string>
#include <cstring>
using namespace std;
int main() {
setlocale(LC_ALL, "rus");
char msg[] = "Привет мир!";
unsigned char key = 84;
int N = strlen(msg);
cout << N << endl;
for (int i = 0; i < N; ++i) {
msg[i] ^= key;
msg[i] = ((msg[i] >> 2) | (msg[i] << 6));
}
for (int i = 0; i < N; ++i) cout << msg[i];
cout << endl;
for (int i = 0; i < N; ++i) {
msg[i] = ((msg[i] >> 6) | (msg[i] << 2));
msg[i] ^= key;
}
for (int i = 0; i < N; ++i) cout << msg[i];
cout << endl;
return 0;
}