/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
public static void kamisama(int N)
{
int n = 0;
for (int i = 1; i <= N; i++)
{
n += 22;
if (n >= i) n %= i;
}
System.
out.
printf("%d -> %d%n", N, n
+ 1); }
public static void main
(String[] args
) {
kamisama(589284012);
kamisama(454895875);
kamisama(292762468);
kamisama(1000000000);
for(int i = 1; i <= 100; i++) kamisama(i);
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBrYW1pc2FtYShpbnQgTikKICAgIHsKICAgICAgICBpbnQgbiA9IDA7CiAgICAgICAgZm9yIChpbnQgaSA9IDE7IGkgPD0gTjsgaSsrKQogICAgICAgIHsKICAgICAgICAgICAgbiArPSAyMjsKICAgICAgICAgICAgaWYgKG4gPj0gaSkgbiAlPSBpOwogICAgICAgIH0KICAgICAgICBTeXN0ZW0ub3V0LnByaW50ZigiJWQgLT4gJWQlbiIsIE4sIG4gKyAxKTsKICAgIH0KCiAgICBwdWJsaWMgc3RhdGljIHZvaWQgbWFpbihTdHJpbmdbXSBhcmdzKQogICAgewogICAgICAgIGthbWlzYW1hKDU4OTI4NDAxMik7CiAgICAgICAga2FtaXNhbWEoNDU0ODk1ODc1KTsKICAgICAgICBrYW1pc2FtYSgyOTI3NjI0NjgpOwogICAgICAgIGthbWlzYW1hKDEwMDAwMDAwMDApOwogICAgICAgIGZvcihpbnQgaSA9IDE7IGkgPD0gMTAwOyBpKyspIGthbWlzYW1hKGkpOwogICAgfQp9