When a positive integer N is written in base 9, it is a two-digit number. When 6N is written in base 7, it is a three-digit number obtained from the two-digit number by writing digit 4 to its right. Find the decimal representations of all such numbers N.