Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/massiv-toq-indekslar-teskari

Odd-index elements in reverse

Easy 1000 ms 128 MB 21%
Share

A positive integer $n$ and an array of $n$ integers are given. Print all elements of the array with odd indices ($1, 3, 5, \dots$) in decreasing order of index.

Printing the array elements at odd indices in reverse order

Input

The first line contains a positive integer $n$. The second line contains $n$ integers separated by spaces.

Output

One line with the elements at odd indices separated by spaces, in decreasing order of index.

Note

$1 \le n \le 1000$
$-10^{9} \le a_{i} \le 10^{9}$

Examples

Input #1
6
10 20 30 40 50 60
Output #1
50 30 10
Input #2
5
1 2 3 4 5
Output #2
5 3 1

Sign in to submit a solution

Signing up is free and takes a minute.