Complex analysis - Prove a holomorphic function has at least one high-order pole

I feel very confused about the following problem. Much appreciate if someone can help me.

Let f(z) be holomorphic everywhere on the complex plane apart from n points $$a_1$$, $$a_2$$, ... $$a_n$$ (with each $$a_i\neq 0$$), where it has simple holes. Consider another function $$g(z)$$ which is holomorphic everywhere on the complex plane except at the same n points $$a_1$$, ... $$a_n$$, where it has isolated singularities. Assume that $$f(0)\neq g(0)$$ and $${\rm Res}_{z=a_i}\{f(z)\} = {\rm Res}_{z=a_i}\{g(z)\}$$ for all $$i$$. And $$\lim_{z\rightarrow \infty} f(z) = \lim_{z\rightarrow \infty} g(z)$$ and the limit exists. Prove that at least one of the singularities of $$g(z)$$ is a pole of order greater than 1, or an essential singularity.

Clearly, $$h(z)=f(z)-\sum_{k=1}^n \frac{r_k}{z-a_k}$$ has the same limit at infinity with $$f$$, and it is equal to $$c=\lim_{z\to\infty} f(z).$$ Hence $$h$$ is bounded and entire and hence constant. Thus $$f(z)=c+\sum_{k=1}^n \frac{r_k}{z-a_k}.$$ If all the singularities of $$g$$ were poles of first order, then $$g$$ would have the same expression and be identical to $$f$$. But they are not identical.
$$f-g$$ is analytic on $$\Bbb{C}$$ minus finitely many points where it has zero residues, also $$f-g$$ is continuous at $$\infty$$ thus it is bounded for $$|z|> r$$.
If all those points are removable singularities then $$f-g$$ is entire and bounded thus it is constant, and $$f(\infty)-g(\infty)=0$$ means $$f=g$$,
otherwise $$f-g$$ has at least one pole of order $$\ge 2$$ or an essential singularity.