Let $n$ be a positive integer greater than or equal to $3$. Let $a,b$ be integers such that $ab$ is invertible modulo $n$ and $(ab)^{-1}\equiv 2\pmod n$. Given $a+b$ is invertible, what is the remainder when $(a+b)^{-1}(a^{-1}+b^{-1})$ is divided by $n$?
<|im_start|>system
You are a helpful assistant.<|im_end|>
<|im_start|>user
Let $n$ be a positive integer greater than or equal to $3$. Let $a,b$ be integers such that $ab$ is invertible modulo $n$ and $(ab)^{-1}\equiv 2\pmod n$. Given $a+b$ is invertible, what is the remainder when $(a+b)^{-1}(a^{-1}+b^{-1})$ is divided by $n$?
Please reason step by step, and put your final answer within \boxed{{}}.<|im_end|>
<|im_start|>assistant

user
2
Let $n$ be a positive integer greater than or equal to $3$. Let $a,b$ be integers such that $ab$ is invertible modulo $n$ and $(ab)^{-1}\equiv 2\pmod n$. Given $a+b$ is invertible, what is the remainder when $(a+b)^{-1}(a^{-1}+b^{-1})$ is divided by $n$?
train