John counts up from 1 to 13, and then immediately counts down again to 1, and then back up to 13, and so on, alternately counting up and down: \begin{align*}
&(1, 2, 3,4,5,6,7,8,9,10,11,12,13,\\
&\qquad\qquad12,11,10,9,8,7,6,5,4,3,2,1,2,3,4,\ldots ).
\end{align*} What is the $5000^{\text{th}}$ integer in his list?
<|im_start|>system
You are a helpful assistant.<|im_end|>
<|im_start|>user
John counts up from 1 to 13, and then immediately counts down again to 1, and then back up to 13, and so on, alternately counting up and down: \begin{align*}
&(1, 2, 3,4,5,6,7,8,9,10,11,12,13,\\
&\qquad\qquad12,11,10,9,8,7,6,5,4,3,2,1,2,3,4,\ldots ).
\end{align*} What is the $5000^{\text{th}}$ integer in his list?
Please reason step by step, and put your final answer within \boxed{{}}.<|im_end|>
<|im_start|>assistant

user
8
John counts up from 1 to 13, and then immediately counts down again to 1, and then back up to 13, and so on, alternately counting up and down: \begin{align*}
&(1, 2, 3,4,5,6,7,8,9,10,11,12,13,\\
&\qquad\qquad12,11,10,9,8,7,6,5,4,3,2,1,2,3,4,\ldots ).
\end{align*} What is the $5000^{\text{th}}$ integer in his list?
train