AT_scpc2026_div3_f SQL

Description

#### 表示言語 / / As you know, SQL stands for "**S**orohue is a **Q**uery **L**over". $ Q $ queries are given. - $ x $ : If $ x < 0 $ , print the input of the $ |x| $ –th query; if $ x > 0 $ , print the output of the $ |x| $ –th query. ( $ 1 \le |x| \le Q $ ) After all queries are given, answer all queries in order.

Input Format

The input is given from Standard Input in the following format: > $ Q $ $ x_1 $ $ x_2 $ $ \dots $ $ x_Q $

Output Format

Output $ Q $ integers separated by a blank on a single line. The $ i $ –th integer is the answer to the $ i $ –th query. The answer to each query must be an integer whose absolute value is between $ 1 $ and $ Q $ , inclusive. If there are multiple valid answers, output any one of them. There always exists a way to satisfy the conditions and correctly answer all queries.

Explanation/Hint

### Sample Explanation 1 Query 1 outputs `-3`, which is the input for Query 2, so it is correct. Query 4 outputs `-3`, which is the answer to Query 1, so it is correct. Query 6 outputs `4`, which is the answer to Query 6, so it is correct. ### Constraints - $ 1 \le Q \le 500\,000 $ - $ 1 \le |x_i| \le Q $ - All input values are integers.