Let $X$ and $Y$ be compact metric spaces. Let $$ F= \Bigl\{\sum_{i=1}^n A_i f_i(x) g_i(y): f_i\in C(X,\mathbb{R}),g_i\in C(Y,\mathbb{R}), 1\le i\le n \Bigr\}. $$ Prove that $F$ is dense in $C(X\times Y,\mathbb{R})$.
Please, I can't figure it out.
I will be thankful for any help.