#include <stdio.h>
void cryptogram(char *s, int n)
{
int i;
char w[] = "azAZ09";
while (*s) {
for ( i = 0; i < 6; i += 2) {
if (*s >= w[i] && *s <= w[i + 1]) {
*s = w[i] + (*s - 2 * w[i] + w[i + 1] + n + 1) % (w[i + 1] - w[i] + 1);
}
}
s++;
}
}
int main(void)
{
char s[100];
cryptogram(s, 2);
cryptogram(s, -2);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp2b2lkIGNyeXB0b2dyYW0oY2hhciAqcywgaW50IG4pCnsKICBpbnQgaTsKICBjaGFyIHdbXSA9ICJhekFaMDkiOwogIHdoaWxlICgqcykgewogICAgZm9yICggaSA9IDA7IGkgPCA2OyBpICs9IDIpIHsKICAgICAgaWYgKCpzID49IHdbaV0gJiYgKnMgPD0gd1tpICsgMV0pIHsKICAgICAgICAqcyA9IHdbaV0gKyAoKnMgLSAyICogd1tpXSArIHdbaSArIDFdICsgbiArIDEpICUgKHdbaSArIDFdIC0gd1tpXSArIDEpOwogICAgICB9CiAgICB9CiAgICBzKys7CiAgfQp9CgppbnQgbWFpbih2b2lkKQp7CiAgY2hhciBzWzEwMF07CiAgcHJpbnRmKCJpbnB1dCA9ICIpOwogIHNjYW5mKCIlcyIsIHMpOwogIGNyeXB0b2dyYW0ocywgMik7CiAgcHJpbnRmKCIlc1xuIiwgcyk7CiAgY3J5cHRvZ3JhbShzLCAtMik7CiAgcHJpbnRmKCIlc1xuIiwgcyk7CgogIHJldHVybiAwOwp9Cg==