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