A - God Sequence Editorial /

Time Limit: 2 sec / Memory Limit: 1024 MB

配点: 200

問題文

以下の条件をすべて満たす、長さ A + B の数列 E = (E_1, E_2, \dots, E_{A+B}) を「神の数列」といいます。

  • E_1 + E_2 + \cdots + E_{A+B} = 0 である。
  • E_1, E_2, \dots, E_{A+B} の中に正の整数はちょうど A 個ある。
  • E_1, E_2, \dots, E_{A+B} の中に負の整数はちょうど B 個ある。
  • E_1, E_2, \dots, E_{A+B} はすべて相異なる。
  • すべての i (1 \leq i \leq A+B) について、-10^{9} \leq E_i \leq 10^9, E_i \neq 0 である。

「神の数列」を 1 つ構成してください。

なお、本問題の制約下では、「神の数列」が 1 つ以上存在することが証明できます。

制約

  • 1 \leq A \leq 1000
  • 1 \leq B \leq 1000
  • 入力はすべて整数

入力

入力は以下の形式で標準入力から与えられます。

A B

出力

数列の各要素を空白で区切って 1 行で出力してください。

神の数列が複数存在する場合は、どれを出力しても正解となります。

E_1 E_2 \cdots E_{A+B}

入力例 1

1 1

出力例 1

1001 -1001

数列 (1001, -1001) には正の整数が A=1 個、負の整数が B=1 個存在し、総和は 1001+(-1001)=0 です。

その他の問題文中の条件もすべて満たすため、この数列は「神の数列」です。


入力例 2

1 4

出力例 2

-8 -6 -9 120 -97

数列 (-8, -6, -9, 120, -97) には正の整数が A=1 個、負の整数が B=4 個存在し、総和は (-8)+(-6)+(-9)+120+(-97)=0 です。

その他の問題文中の条件もすべて満たすため、この数列は「神の数列」です。


入力例 3

7 5

出力例 3

323 -320 411 206 -259 298 -177 -564 167 392 -628 151

Score : 200 points

Problem Statement

A sequence of length A + B, E = (E_1, E_2, \dots, E_{A+B}), that satisfies all of the conditions below is said to be a god sequence.

  • E_1 + E_2 + \cdots + E_{A+B} = 0 holds.
  • There are exactly A positive integers among E_1, E_2, \dots, E_{A+B}.
  • There are exactly B negative integers among E_1, E_2, \dots, E_{A+B}.
  • E_1, E_2, \dots, E_{A+B} are all distinct.
  • -10^{9} \leq E_i \leq 10^9, E_i \neq 0 holds for every i (1 \leq i \leq A+B).

Construct one god sequence.

We can prove that at least one god sequence exists under Constraints of this problem.

Constraints

  • 1 \leq A \leq 1000
  • 1 \leq B \leq 1000
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

A B

Output

Print the elements of your sequence in one line, with space as separator.

If there are multiple god sequences, any of them will be accepted.

E_1 E_2 \cdots E_{A+B}

Sample Input 1

1 1

Sample Output 1

1001 -1001

A sequence (1001, -1001) contains A=1 positive integer and B=1 negative integer totaling 1001+(-1001)=0.

It also satisfies the other conditions and thus is a god sequence.


Sample Input 2

1 4

Sample Output 2

-8 -6 -9 120 -97

A sequence (-8, -6, -9, 120, -97) contains A=1 positive integer and B=4 negative integers totaling (-8)+(-6)+(-9)+120+(-97)=0.

It also satisfies the other conditions and thus is a god sequence.


Sample Input 3

7 5

Sample Output 3

323 -320 411 206 -259 298 -177 -564 167 392 -628 151