Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/matritsa-shaxmat-taxtasi

Chessboard

Easy 1000 ms 128 MB 21%
Share

Two positive integers $n$ and $m$ are given. Fill an $n \times m$ matrix in a chessboard pattern ($0$ and $1$ alternate, $0$ in the top-left corner) and print it.

A matrix filled in a chessboard pattern

Input

One line with two positive integers: $n$ and $m$.

Output

$n$ lines with $m$ space-separated numbers ($0$ or $1$) each.

Note

$1 \le n, m \le 200$

Examples

Input #1
2 3
Output #1
0 1 0
1 0 1
Input #2
1 1
Output #2
0

Sign in to submit a solution

Signing up is free and takes a minute.