QOJ.ac

QOJ

時間限制: 2 s 記憶體限制: 1024 MB 總分: 100 可 Hack ✓

#17949. Triangular Chocolate Packaging (Bitter)

统计

At Coco's chocolate shop, they are planning to sell a special Valentine's Day product consisting of chocolates shaped like three regular hexagons joined together in a triangle. Coco wants to pack these chocolates into a triangular frame made of $\frac{N(N+1)}{2}$ regular hexagons of the same size, filling it completely. To make it look more attractive, she decided to wrap the chocolates pointing upward in red and the chocolates pointing downward in blue. Once the product is packaged, one can only see whether each hexagon is red or blue from the outside, but cannot tell which cells belong to the same piece.

Coco, a math expert, proved that the frame can be filled with chocolates only when the remainder of $N$ divided by $12$ is $0$, $2$, $9$, or $11$, but she is struggling with how to actually arrange the chocolates. Help Coco pack the chocolates.

Input

The first line contains the side length $N$ of the triangular frame. $(2 \le N \le 5\,001)$. The remainder of $N$ divided by $12$ is one of $0$, $2$, $9$, or $11$.

Output

Output the arrangement of red and blue hexagons over $N$ lines without spaces. Red is represented by R and blue by B. The $i$-th line should contain the characters corresponding to the $i$ hexagons in that row, in order from left to right. ($1 \le i \le N$)

Examples

Input 1

2

Output 1

R
RR

Input 2

9

Output 2

R
RR
RBB
RRBR
RBBRR
RRBBBR
BBBBBRR
RBRBRBBR
RRRRRRBRR

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.