There might be a shorter way to duplicate the top two elements of the stack in Actually, but I'm not sure what that way is. Golfing suggestions welcome. Try it online!
'a'b,¬`2╟2αio`na
Ungolfing
'a'b Push "a" then "b" to the stack.
, Explicitly take input n.
¬ Push n-2.
`...`n Run the following function n-2 times.
2╟2α Push a list that repeats the top two elements of the stack twice.
i Flatten that list to the stack. Stack: b, a, b, a, prev_iterations
o Append b to the end of a. Stack: ab, b, a, prev_iterations
a Reverse the stack so that the strings will print in the correct order.
Implicit print all of the elements in the stack.
A different approach
This is also 16 bytes.
Try it online!
'a'b,¬`│ok╔Ri`na
Ungolfing
The main difference is the function in the middle, so I'll only ungolf that here.
`...`n Run the following function n-2 times.
│ Duplicate the stack.
o Append the last item to the end of the second-to-last item.
k╔ Uniquify the stack by wrapping the stack in a list and then calling uniquify().
Ri Reverse that list before returning everything to the stack
so that the last items are at TOS again.