#include #include #include #include // Required for std::ios_base int main() { // Faster I/O std::ios_base::sync_with_stdio(false); std::cin.tie(NULL); // Mapping from ciphertext char index (0='a', 1='b', ...) to plaintext char char mapping[26]; mapping['a' - 'a'] = 'c'; mapping['b' - 'a'] = 'q'; mapping['c' - 'a'] = 'l'; mapping['d' - 'a'] = 'm'; mapping['e' - 'a'] = 'd'; mapping['f' - 'a'] = 'r'; mapping['g' - 'a'] = 's'; mapping['h' - 'a'] = 't'; mapping['i' - 'a'] = 'f'; mapping['j' - 'a'] = 'x'; mapping['k' - 'a'] = 'y'; mapping['l' - 'a'] = 'z'; mapping['m' - 'a'] = 'b'; mapping['n' - 'a'] = 'a'; mapping['o' - 'a'] = 'n'; mapping['p' - 'a'] = 'o'; mapping['q' - 'a'] = 'p'; mapping['r' - 'a'] = 'u'; mapping['s' - 'a'] = 'v'; mapping['t' - 'a'] = 'w'; mapping['u' - 'a'] = 'e'; mapping['v' - 'a'] = 'g'; mapping['w' - 'a'] = 'h'; mapping['x' - 'a'] = 'i'; mapping['y' - 'a'] = 'j'; mapping['z' - 'a'] = 'k'; std::string ciphertext; std::cin >> ciphertext; std::string plaintext = ""; // Reserve space for efficiency, though not strictly necessary for length 30 plaintext.reserve(ciphertext.length()); for (char c : ciphertext) { plaintext += mapping[c - 'a']; // Look up the mapping } std::cout << plaintext << "\n"; // Use "\n" for newline, often faster than std::endl return 0; }