Jhulka problem on SPOJ

This is my code:
import java.io.;
import java.util.
;
import java.math.BigInteger;
class apples
{
static void apple(BigInteger a, BigInteger diff)
{
a=a.subtract(diff);
a=a.divide(BigInteger.valueOf(2));
System.out.println(a.add(diff));
System.out.println(a);

}
public static void main(String args[])
{
	int A=10;
	while(A!=0)
	{
	Scanner sc=new Scanner(System.in);
	BigInteger a=sc.nextBigInteger();
	BigInteger b=sc.nextBigInteger();
	apple(a,b);
	A--;
}
}

}

It is producing Runtime Error (NZEC) on SPOJ submission.
Please help?

Got it, error in re-declaring BigIntegers inside loop again and again.
Thanks.