if(b1:b9 == b10:b18){

if(b19:b21 == b22:b24){

if(b25 == b26)

{

***b27***

}else//if(b25 == b26)

{

if(b25 == b27)

{

***b26***

}

else

{

***b25***

}

}

}

else //if(b19:b21 == b22:b24)

{

case(b19:b21 < b22:b24){

if(b19,b22,b21 < b20,b26,b27){ //b23,b24 left out

//that means b19 b 21 is lighter

if(b19<b21)

{

***b19***

}

else

{

***b21***

}

}else if(b19,b22,b21 > b20,b26,b27)

{ // that means b20 is lighter

***b20***

}

else if(b19,b22,b21 == b20,b26,b27)

{ // that means left out balls where heavier

if(b23 < b24)

{

***b24***

}

else

{

***b23***

}

}

}

case(b19:b21 > b22:b24){

// same approach as case(b19:b21 < b22:b24)

}

}

}

else //if(b1:b9 == b10:b18)

{

case(b1:b9 < b10:b18){

if(b1,b2,b3,b10,b11,b12,b7,b8,b9 < b4,b5,b6 + 6 equal balls){ //b13:b18 left out

// this means b1,b2,b3,b7,b8,b9 might be ligther

if(b1:b3 < b7:b9){

if(b1 <b2)

{

***b1***

}

else if(b1 > b2)

{

***b2***

}

else(b1 == b2)

{

***b3***

}

}

else

{

// same solutiın as above

}

}else if (b1,b2,b3,b10,b11,b12,b7,b8,b9 > b4,b5,b6 + 6 equal balls){

// this means b10:b12 balls are heavier

if(b10 > b11){

***b10***

}

else if ( b10 < b11){

***b11***

}

else{

***b12***

}

}else if (b1,b2,b3,b10,b11,b12,b7,b8,b9 == b4,b5,b6 + 6 equal balls){

// this means left out balls b13:b18 are heavier

if(b13:b15 > b16:b18){

if(b13 > b14){

***b13***

}

if(b13 < b14){

***b14***

}

if(b13 == b14){

***b15***

}

}

else

{

// same solution as above

}

}

}

case(b1:b9 > b10:b18){

// same solution as above

}

}