a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];

for(i=0; i<10;i++){

total=0;

temp = a[i]/2;

(for j=1; j<=temp; j++){

if(a[i]%j==0){

total = total + j;

}

}

if (total == a[i]) {

print( a[i] : + "is" + "ABC");

}

else{

print( a[i] : + "is" + "XYZ");

}

}