Pasha recently buy new phone jPager start add friend phone number each phone number consist exactly n digitsalso Pasha number k sequence length nk n divisible k a1a2ank b1b2bnk Lets split phone number block length k the block form digits phone number position 1 2 k second block form digits phone number position k1 k2 2k Pasha consider phone number good ith block do not start digit bi divisible ai represent integer to represent block length k integer let write sequence c1 c2ck then integer calculate result expression c110k1c210k2ckPasha ask calculate number good phone number length n give k ai bi as number big print modulo 1097