/* 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
{
{
d();
}
static void d() {
for (int i = 2, j; i < 25; i++) {
for (j = 2; j < 25; j++) {
final long s
= (long) (Math.
pow(i, j
) + Math.
pow(j, i
)); if ((s < (1L << 31)) & !t.contains(s)) {
t.add(s);
}
}
}
for(long l:t){
}
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCWQoKTsKCX0KCQoJc3RhdGljIHZvaWQgZCgpIHsKICAgIGZpbmFsIExpc3Q8TG9uZz4gdCA9IG5ldyBBcnJheUxpc3QoKTsKICAgIGZvciAoaW50IGkgPSAyLCBqOyBpIDwgMjU7IGkrKykgewogICAgICBmb3IgKGogPSAyOyBqIDwgMjU7IGorKykgewogICAgICAgIGZpbmFsIGxvbmcgcyA9IChsb25nKSAoTWF0aC5wb3coaSwgaikgKyBNYXRoLnBvdyhqLCBpKSk7CiAgICAgICAgaWYgKChzIDwgKDFMIDw8IDMxKSkgJiAhdC5jb250YWlucyhzKSkgewogICAgICAgICAgdC5hZGQocyk7CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgICBDb2xsZWN0aW9ucy5zb3J0KHQpOwogICAgZm9yKGxvbmcgbDp0KXsKICAgICAgICBTeXN0ZW0ub3V0LnByaW50KGwrIiAiKTsKICAgIH0KICB9Cn0=