#include <stdio.h>
int main() {
int i, j, k, a, b;
for (a = 3; a <= 1500; a++) {
j = 0;
for (i = 1; i < a; i++) {
if (a % i == 0) {
j += i;
}
}
for (b = 2; b < a; b++) {
k = 0;
for (i = 1; i < b; i++) {
if (b % i == 0) {
k += i;
}
}
if (j == b && k == a) {
for (i = 1; i < a; i++) {
if (a % i == 0) {
}
}
for (i = 1; i < b; i++) {
if (b % i == 0) {
}
}
}
}
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbigpIHsKICAgIGludCBpLCBqLCBrLCBhLCBiOwoKICAgIGZvciAoYSA9IDM7IGEgPD0gMTUwMDsgYSsrKSB7CiAgICAgICAgaiA9IDA7CiAgICAgICAgZm9yIChpID0gMTsgaSA8IGE7IGkrKykgewogICAgICAgICAgICBpZiAoYSAlIGkgPT0gMCkgewogICAgICAgICAgICAgICBqICs9IGk7CiAgICAgICAgICAgIH0KICAgICAgICB9CgogICAgICAgIGZvciAoYiA9IDI7IGIgPCBhOyBiKyspIHsKICAgICAgICAgICAgayA9IDA7CiAgICAgICAgICAgIGZvciAoaSA9IDE7IGkgPCBiOyBpKyspIHsKICAgICAgICAgICAgICAgIGlmIChiICUgaSA9PSAwKSB7CiAgICAgICAgICAgICAgICAgICAgayArPSBpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CgogICAgICAgICAgICBpZiAoaiA9PSBiICYmIGsgPT0gYSkgewogICAgICAgICAgICAgICAgcHJpbnRmKCIlZDogIiwgYSk7CiAgICAgICAgICAgICAgICBmb3IgKGkgPSAxOyBpIDwgYTsgaSsrKSB7CiAgICAgICAgICAgICAgICAgICAgaWYgKGEgJSBpID09IDApIHsKICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCIlZCAiLCBpKTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBwcmludGYoIj0lZFxuIiwgaik7CgogICAgICAgICAgICAgICAgcHJpbnRmKCIlZDogIiwgYik7CiAgICAgICAgICAgICAgICBmb3IgKGkgPSAxOyBpIDwgYjsgaSsrKSB7CiAgICAgICAgICAgICAgICAgICAgaWYgKGIgJSBpID09IDApIHsKICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCIlZCAiLCBpKTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBwcmludGYoIj0lZFxuXG4iLCBrKTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgIH0KCiAgICByZXR1cm4gMDsKfQo=