Hi everyone

I saw a question on Mathoverflow asking for some applications of pigeonhole principle, among the answers I saw a problem set which was proposed by Prof. Richard Stanley and in this problem set there was a question which I am interested on it, here it is: Consider these two sequences $a_1< a_2 < \cdots < a_n$ and $b_1 >b_2 > \cdots >b_n$ such that $$\{a_1,\cdots a_n,b_1\cdots b_n\}=\{1,2,\cdots 2n\}$$ show that $$\sum_i|a_i-b_i|=n^2$$

I have no idea how to do this. Perhaps someone can give a hint? I try to consider some cases but the answer was long and boring, I think there is a nice trick.