Let x=a1a2…an be an n-digit number, where a1,a2,…,an(a1=0) are the digits. The n numbers x1=x=a1a2...an,x2=ana1...an−1,x3=an−1ana1...an−2 ,
x4=an−2an−1ana1,...an−3,...,xn=a2a3...ana1
are said to be obtained from x by the cyclic permutation of digits. [For example, if n=5 and x=37001, then the numbers are x1=37001,x2=13700,x3=01370(=1370),x4=00137(=137),x5=70013.]
Find, with proof, (i) the smallest natural number n for which there exists an n-digit number x such that the n numbers obtained from x by the cyclic permutation of digits are all divisible by 1989; and (ii) the smallest natural number x with this property.