#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(i=1,k=0; i<b; i++) {
if(b%i==0) {
k+=i;
}
}
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;
}
I2luY2x1ZGU8c3RkaW8uaD4KCmludCBtYWluKCkgewogICAgaW50IGksaixrLGEsYjsKCiAgICBmb3IoYT0zOyBhPD0xNTAwOyBhKyspIHsKICAgICAgICBmb3IoaT0xLGo9MDsgaTxhOyBpKyspIHsKICAgICAgICAgICAgaWYoYSVpPT0wKSB7CiAgICAgICAgICAgICAgICBqKz1pOwogICAgICAgICAgICB9CiAgICAgICAgfQoKICAgICAgICBmb3IoYj0yOyBiPGE7IGIrKykgewogICAgICAgICAgICBmb3IoaT0xLGs9MDsgaTxiOyBpKyspIHsKICAgICAgICAgICAgICAgIGlmKGIlaT09MCkgewogICAgICAgICAgICAgICAgICAgIGsrPWk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIGlmKGo9PWIgJiYgaz09YSkgewogICAgICAgICAgICAgICAgcHJpbnRmKCIlZDoxIiwgYSk7CiAgICAgICAgICAgICAgICBmb3IoaT0yOyBpPGE7IGkrKykgewogICAgICAgICAgICAgICAgICAgIGlmKGElaT09MCkgewogICAgICAgICAgICAgICAgICAgICAgICBwcmludGYoIislZCIsIGkpOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIHByaW50ZigiPSVkXG4iLCBqKTsKCiAgICAgICAgICAgICAgICBwcmludGYoIiVkOjEiLCBiKTsKICAgICAgICAgICAgICAgIGZvcihpPTI7IGk8YjsgaSsrKSB7CiAgICAgICAgICAgICAgICAgICAgaWYoYiVpPT0wKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHByaW50ZigiKyVkIiwgaSk7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgcHJpbnRmKCI9JWRcblxuIiwgayk7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9CiAgICByZXR1cm4gMDsKfQo=