class E286 {
public static void main
(String[] args
) { rFactorial(3628800);
rFactorial(479001600);
rFactorial(6);
rFactorial(18);
}
private static void rFactorial(float in) {
int ori = (int) in;
int i;
for (i = 2; in > 1; i++)
in /= i;
if (in == 1)
System.
out.
printf("%d = %d!\n", ori, i
-1); else
System.
out.
printf("%d NONE\n", ori
); }
}
Y2xhc3MgRTI4NiB7CglwdWJsaWMgc3RhdGljIHZvaWQgbWFpbiAoU3RyaW5nW10gYXJncykgewoJCXJGYWN0b3JpYWwoMzYyODgwMCk7CgkJckZhY3RvcmlhbCg0NzkwMDE2MDApOwoJCXJGYWN0b3JpYWwoNik7CgkJckZhY3RvcmlhbCgxOCk7Cgl9CgkKCXByaXZhdGUgc3RhdGljIHZvaWQgckZhY3RvcmlhbChmbG9hdCBpbikgewoJCWludCBvcmkgPSAoaW50KSBpbjsKCQlpbnQgaTsKCQkKCQlmb3IgKGkgPSAyOyBpbiA+IDE7IGkrKykKCQkJaW4gLz0gaTsKCQkKCQlpZiAoaW4gPT0gMSkKCQkJU3lzdGVtLm91dC5wcmludGYoIiVkID0gJWQhXG4iLCBvcmksIGktMSk7CgkJZWxzZQoJCQlTeXN0ZW0ub3V0LnByaW50ZigiJWQgTk9ORVxuIiwgb3JpKTsKCX0KfQ==