問題一覧 > 通常問題

No.1764 Square

レベル : / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 224
作問者 : first_vil / テスター : harurun ygussany
お気に入りにしたユーザー ProblemId : 7051 / 自分の提出
問題文最終更新日: 2021-11-26 14:45:54
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 325 (順位表) の他の問題:

Problem Statement

There are $4$ queues initialized as follows. Each of them contains uppercase English letters.

$\mathrm{queue}\ 0 = ($A,E$)$
$\mathrm{queue}\ 1 = ($B$)$
$\mathrm{queue}\ 2 = ($C$)$
$\mathrm{queue}\ 3 = ($D$)$

Output the state of each queue after performing the following operation $K$ times on these queues.

  • In the $i+1\ (0 \le i \lt K)$-th operation, remove the front element of queue $(i\ \mathrm{mod}\ 4)$ and append it to the back of queue $((i+1)\ \mathrm{mod}\ 4)$.

Input

$K$
  • $K$ is an integer between $1$ and $100$, inclusive.

Output

Output $4$ lines. On the $i+1\ (0 \le i \lt 4)$-th line, output the elements of queue $i$ after all operations, in order from the front, without separating them with spaces, and end with a newline (see the samples for details).

Sample

Sample 1
Input
1
Output
E
BA
C
D

In the $1$-st operation, the front element A of queue $0$ is removed and appended to the back of queue $1$. Therefore, the output is as shown.

Sample 2
Input
4
Output
ED
A
B
C
Sample 3
Input
100
Output
AE
B
C
D

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。