program yukicoder_2614 use, intrinsic :: iso_fortran_env implicit none integer(int32) :: t integer(int32) :: i read(input_unit, *) t do i = 1, t call solve() end do contains impure subroutine solve() integer(int32) :: n character, allocatable :: ans(:) integer(int32) :: i read(input_unit, *) n allocate(ans(3 * n)) ans(1:6) = ["A", "B", "A", "C", "B", "C"] do i = 3, n ans(3 * (i - 1) + 1) = "A" ans(3 * (i - 1) + 2) = "B" ans(3 * (i - 1) + 3) = "C" end do write(output_unit, '(*(a1))') ans(:) end subroutine solve end program yukicoder_2614