The integral formula for the solutions of the quantum Knizhnik-Zamolodchikov equation associated with $U_q(\hat{sl}_n)$ for |q|=1