solved JULKA on spoj using BigInteger in java