/* 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
{
private static long fact1(int a) {
if (a <= 1) return 1;
return a * fact1(a - 1);
}
private static long fact2(int a) {
long result = 1;
while (a > 1) {
result *= a;
a--;
}
return result;
}
public static void main
(String[] args
) { }
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKICAgIHByaXZhdGUgc3RhdGljIGxvbmcgZmFjdDEoaW50IGEpIHsKICAgICAgICBpZiAoYSA8PSAxKSByZXR1cm4gMTsKICAgICAgICByZXR1cm4gYSAqIGZhY3QxKGEgLSAxKTsKICAgIH0KCiAgICBwcml2YXRlIHN0YXRpYyBsb25nIGZhY3QyKGludCBhKSB7CiAgICAgICAgbG9uZyByZXN1bHQgPSAxOwogICAgICAgIHdoaWxlIChhID4gMSkgewogICAgICAgIAlyZXN1bHQgKj0gYTsKICAgICAgICAJYS0tOwogICAgICAgIH0KICAgICAgICByZXR1cm4gcmVzdWx0OwogICAgfQoKICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBtYWluKFN0cmluZ1tdIGFyZ3MpIHsKICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oZmFjdDEoNSkpOwogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbihmYWN0Mig1KSk7CiAgICB9Cn0=