#K56362. Generate Pattern from "CODE"

    ID: 30182 Type: Default 1000ms 256MiB

Generate Pattern from "CODE"

Generate Pattern from "CODE"

You are given two positive integers R and C representing the number of rows and columns respectively. Your task is to generate an R x C pattern where the cells are filled with characters from the string "CODE" in a repeating manner.

The filling procedure is as follows:

  • Consider an infinite string obtained by repeating "CODE".
  • The cell in the grid at position (i, j) (0-indexed) should be filled with the character at position \( (C \times i + j) \mod 4 \) of the string "CODE".

For example, if R = 3 and C = 5, the grid will be:

CODEC
ODECO
DECOD

Read the input from standard input and print the result to standard output.

inputFormat

The input consists of one line containing two integers R and C separated by a space.

outputFormat

Output the generated pattern, where each of the R rows is printed on a new line.

## sample
3 5
CODEC

ODECO DECOD

</p>