import java.math.*;
class Ideone {
public static void main
(String[] args
) { }
if (perm1
== null || perm
== null || (perm1.
equals(BigInteger.
ZERO) || (perm.
equals(BigInteger.
ZERO)))) return false;
}
}
aW1wb3J0IGphdmEubWF0aC4qOwoKY2xhc3MgSWRlb25lIHsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKQl7CgkJU3lzdGVtLm91dC5wcmludGxuKHZlcmlmaWNhUGVybWlzc2FvKEJpZ0ludGVnZXIudmFsdWVPZigwKSwgQmlnSW50ZWdlci52YWx1ZU9mKDApKSk7CgkJU3lzdGVtLm91dC5wcmludGxuKHZlcmlmaWNhUGVybWlzc2FvKEJpZ0ludGVnZXIudmFsdWVPZigxKSwgQmlnSW50ZWdlci52YWx1ZU9mKDEpKSk7CgkJU3lzdGVtLm91dC5wcmludGxuKHZlcmlmaWNhUGVybWlzc2FvKEJpZ0ludGVnZXIudmFsdWVPZigyKSwgQmlnSW50ZWdlci52YWx1ZU9mKDEpKSk7Cgl9CgkKCXB1YmxpYyBzdGF0aWMgYm9vbGVhbiB2ZXJpZmljYVBlcm1pc3NhbyhCaWdJbnRlZ2VyIHBlcm0xLCBCaWdJbnRlZ2VyIHBlcm0pIHsKCSAgICBpZiAocGVybTEgPT0gbnVsbCB8fCBwZXJtID09IG51bGwgfHwgKHBlcm0xLmVxdWFscyhCaWdJbnRlZ2VyLlpFUk8pIHx8IChwZXJtLmVxdWFscyhCaWdJbnRlZ2VyLlpFUk8pKSkpCgkgICAgICAgIHJldHVybiBmYWxzZTsKCSAgICByZXR1cm4gIXBlcm0uYW5kKHBlcm0xKS5lcXVhbHMoQmlnSW50ZWdlci5aRVJPKTsKCX0KfQ==