. He wants to play a game with SHB.Recall that the median of three numbers is the second largest one of them.
JSB has an integer sequence a_1, a_2, dots, a_n a 1 ,a 2 ,…,a n . He wants to play a game with SHB. For each 1 le i le n-2 1≤i≤n−2, JSB calculates the median of {a_i, a_{i+1}, a_{i+2}} {a i ,a i+1 ,a i+2 }, denoted by b_i b i . SHB is given the sequence b_1, b_2, dots, b_{n-2} b 1 ,b 2 ,…,b n−2 . Can you help him restore the sequence a a? Recall that the median of three numbers is the second largest one of them.