Instead of 666, let's write K. A number formed with K ones is
(10^K-1)/9, so A=3.(10^K-1)/9 and B=6.(10^K-1)/9, and then AB=
(2/9).(10^K-1)².

(10^K-1)²= 10^2K-2.10^K+1= 999...98000...01, a number with (K-1) nines, an eight, (K-1) zeroes, and a one.

Dividing
by 9 produces 111...10888...89, which multiplied by 2 gives
222...21777...78: (K-1) twos, a one, (K-1) sevens, and an eight.