Define $f(x)=\frac{1+x}{1-x}$ and $g(x)=\frac{-2}{x+1}$. Find the value of \[g(f(g(f(\dotsb g(f(12)) \dotsb ))))\]where the function $f$ is applied 8 times, and the function $g$ is applied 8 times, alternating between the two.
<|im_start|>system
You are a helpful assistant.<|im_end|>
<|im_start|>user
Define $f(x)=\frac{1+x}{1-x}$ and $g(x)=\frac{-2}{x+1}$. Find the value of \[g(f(g(f(\dotsb g(f(12)) \dotsb ))))\]where the function $f$ is applied 8 times, and the function $g$ is applied 8 times, alternating between the two.
Please reason step by step, and put your final answer within \boxed{{}}.<|im_end|>
<|im_start|>assistant

user
4
Define $f(x)=\frac{1+x}{1-x}$ and $g(x)=\frac{-2}{x+1}$. Find the value of \[g(f(g(f(\dotsb g(f(12)) \dotsb ))))\]where the function $f$ is applied 8 times, and the function $g$ is applied 8 times, alternating between the two.
train