# 2018 Innopolice First Stage, December 1

# Innoforest

Trees in Innopolis are exceptional, if you water an innotree (Innopolis Tree), it will grow by number of litres you have watered it. In other words if you water innotree of height **h** by **x** litres of water then it will have new height of **h** + **x**.

Innoforest (Innopolis Forest) is a **n** * **m** grid, each cell of the grid contains one innotree. Irrigation system in innoforest contains **n** + **m** canals: one for each row and column. The irrigation system in one operation can water all trees along one of canals by the same amount of water.

The mayor of Innopolis wants to transform the innoforest by performing some operations on the irrigation system. For each tree in innoforest you know its current height and the desired height. Your task is to find the sequence of operations that transforms the innoforest to the desired shape.

#### Input

First line contains two numbers **n** and **m** (**1** ≤ **n**, **m** ≤ **1000**) - the size of innoforest.

Then **n** lines follow, each line contains **m** numbers `a`

(_{i,j}**1** ≤ `a`

≤ _{i,j}`10`

), current heights of the trees in innoforest.^{9}

Then **n** more lines follow, each line contains **m** numbers `b`

(_{i,j}**1** ≤ `b`

≤ _{i,j}`10`

), desired heights of the trees.^{9}

#### Output

The first line should contain the number of operations **k** (**0** ≤ **k** ≤ `10`

), then ^{6}**k** lines contain the description of operations.

- "
**R r x**" The system will water the**r**-th row by**x**litres (**1**≤**r**≤**n**,**1**≤**x**≤`10`

).^{9} - "
**C c x**" The system will water the**c**-th column by**x**litres (**1**≤**c**≤**m**,**1**≤**x**≤`10`

).^{9}

If it is impossible to transform the innoforest to the desired shape, output only one integer **-1**.

Notice that it is not required to minimize the number of operations, only make sure that it does not exceed `10`

.^{6}

1 1 4 9

1 R 1 5

3 3 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1

-1

3 3 1 2 3 4 5 6 7 8 9 2 4 4 5 7 7 7 9 9

3 R 1 1 R 2 1 C 2 1