How to define an automata for zig zag concatenation?
let $Q=Q_A\times Q_B\times \{1,2\}$ (1 means A, 2 means B)

also define $F=F_A\times F_B\times \{2\}$  (we end with B)

and $q_0=(q_A,q_B,1)$ (we start with A)

with the delta function: $\delta ((q_1,q_2, i),\sigma)= 
      \begin{cases} 
      (\delta(q_1,\sigma),q_2,2) &amp;i=1 \\
      (q_1, \delta(q_2,\sigma),1) &amp;i=2 
   \end{cases}$

The idea is to encode both A and B together, with some "index" telling us if we need to check A or B