read a b c i j&&(for((;i<180||c-(d=j++?d*b%863:b);c=$c${a:i++:1}%863)){ :;};echo $j;. *)