B - Consecutive Correct Answers Editorial /

Time Limit: 2 sec / Memory Limit: 1024 MiB

配点 : 233 点

問題文

高橋君は N 問のクイズに順番に答えました。 i 問目の結果は整数 A_i で表され、 A_i = 1 なら正解、 A_i = 0 なら間違いです。

このクイズでは、最初の問題から間違えずに正解し続けている間だけ得点がもらえます。一度間違えると、その問題以降はたとえ正解しても得点はもらえません。

各問題について、得点がもらえたなら o 、もらえなかったなら x として、 1 問目から順に並べた長さ N の文字列を出力してください。

制約

  • 1 \leq N \leq 100
  • A_i は 0 または 1
  • 入力はすべて整数

入力

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

N
A_1 A_2 \ldots A_N
  • 1 行目には、問題数 N が与えられる。
  • 2 行目には、各問題の結果 A_1, A_2, \ldots, A_N がスペース区切りで与えられる。

出力

長さ N の文字列を 1 行で出力せよ。


入力例 1

5
1 1 0 0 0

出力例 1

ooxxx

入力例 2

3
1 1 1

出力例 2

ooo

入力例 3

4
0 0 0 0

出力例 3

xxxx

入力例 4

6
1 0 0 0 0 0

出力例 4

oxxxxx

入力例 5

4
1 1 1 0

出力例 5

ooox

Score : 233 pts

Problem Statement

Takahashi answered N quiz questions in order. The result of the i-th question is represented by an integer A_i: A_i = 1 means he answered correctly, and A_i = 0 means he answered incorrectly.

In this quiz, points are awarded only while he keeps answering correctly without mistakes starting from the first question. Once he answers incorrectly, he receives no points for that question and any subsequent questions, even if he answers them correctly.

For each question, write o if a point was awarded and x otherwise. Print the resulting string of length N, listing the questions from the 1-st to the N-th in order.

Constraints

  • 1 \leq N \leq 100
  • A_i is 0 or 1
  • All input values are integers.

Input

The input is given from Standard Input in the following format:

N
A_1 A_2 \ldots A_N
  • The first line contains the number of questions N.
  • The second line contains the results A_1, A_2, \ldots, A_N separated by spaces.

Output

Print the string of length N on a single line.


Sample Input 1

5
1 1 0 0 0

Sample Output 1

ooxxx

Sample Input 2

3
1 1 1

Sample Output 2

ooo

Sample Input 3

4
0 0 0 0

Sample Output 3

xxxx

Sample Input 4

6
1 0 0 0 0 0

Sample Output 4

oxxxxx

Sample Input 5

4
1 1 1 0

Sample Output 5

ooox