A nine-digit natural number , written in the decimal system, is obtained from the number by moving its last digit to the first place. It is known that the number is coprime with 18 and . Find the largest and smallest among the numbers that satisfy these conditions. (Two natural numbers are called coprime if they have no common divisors other than one).