import java.util.*;
import java.math.*;
class Main
{
public static void main
(String[] args
) {
Scanner in
= new Scanner
(System.
in); in.useDelimiter(""); //Чтение по одному символу.
int a = (int)in.next().charAt(0); //Первый ключ
int c = (int)in.next().charAt(0); //Пробел
int b = (int)in.next().charAt(0); //Второй ключ
c = (int)in.next().charAt(0); //Пробел
while(in.hasNext()){
c = (int)in.next().charAt(0);
System.
out.
print((char)((c
*a
+b
)%256
)); System.
out.
print((char)((c
*a
+b
)/256)); }
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5tYXRoLio7CiAKY2xhc3MgTWFpbgp7CglwdWJsaWMgc3RhdGljIHZvaWQgbWFpbiAoU3RyaW5nW10gYXJncykKCXsKCQlTY2FubmVyIGluID0gbmV3IFNjYW5uZXIoU3lzdGVtLmluKTsKCQlpbi51c2VEZWxpbWl0ZXIoIiIpOyAvL9Cn0YLQtdC90LjQtSDQv9C+INC+0LTQvdC+0LzRgyDRgdC40LzQstC+0LvRgy4KCQkKCQlpbnQgYSA9IChpbnQpaW4ubmV4dCgpLmNoYXJBdCgwKTsgLy/Qn9C10YDQstGL0Lkg0LrQu9GO0YcKCQlpbnQgYyA9IChpbnQpaW4ubmV4dCgpLmNoYXJBdCgwKTsgLy/Qn9GA0L7QsdC10LsKCQlpbnQgYiA9IChpbnQpaW4ubmV4dCgpLmNoYXJBdCgwKTsgLy/QktGC0L7RgNC+0Lkg0LrQu9GO0YcKCQljID0gKGludClpbi5uZXh0KCkuY2hhckF0KDApOyAgICAgLy/Qn9GA0L7QsdC10LsKCQkKCQl3aGlsZShpbi5oYXNOZXh0KCkpewoJCQljID0gKGludClpbi5uZXh0KCkuY2hhckF0KDApOwoJCQlTeXN0ZW0ub3V0LnByaW50KChjaGFyKSgoYyphK2IpJTI1NikpOwoJCQlTeXN0ZW0ub3V0LnByaW50KChjaGFyKSgoYyphK2IpLzI1NikpOwoJCX0KCX0KfQ==