RECP27 - MATAA

no tags 

in English

A natural numbers N and then a sequence with N×N natural numbers with the components of a square matrix, row by row.

You must display "UPPER" if the numbers in the upper right triangle (not including the main diagonal) sums more than the numbers in the lower left triangle (under and not including the main diagonal). If the numbers in the lower left triangle sums more you must display "LOWER", and if their sums are equal you must display "EQUAL".

Input

Natural number + sequence of natural numbers.

Output

String

Example

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

Output:
LOWER

en Español

Se ingresa un número natural N (3 <= N <= 10) y a continuación una secuencia de N×N números naturales correspondientes a los elementos de una matriz, ingresada por filas y de izquierda a derecha. Informar:

  • Ud. debe mostrar "UPPER" si los números en el triángulo superior derecho (sin incluir la diagonal principal) suman más que los números en el triángulo inferior izquierdo (sin incluir la diagonal principal). Si los números en el triángulo inferior izquierdo suman más, Ud. debe mostrar "LOWER", y si las sumas son iguales Ud. debe mostrar "EQUAL". En todos los casos complete la salida con un salto de línea.  

Entrada

Número natural + Matriz de números naturales.

Salida

String.

Ejemplo

Input:
5
1 1 1 1 1
2 2 2 2 2
3 3 3 3 3 
4 4 4 4 4
5 5 5 5 5

Output:
LOWER

hide comments
nadstratosfer: 2018-12-20 15:27:17

Statement is correct, first example is wrong; answer to both sample cases is LOWER.

-UUU
L-UU
LL-U
LLL-

farhan764: 2016-03-04 11:32:51

ur problem statement is very confusing ...so can u explain it and look into example 1.....i thinks it's wrong.............


Added by:Coach UTN FRSF
Date:2016-03-02
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:MAWK BC C NCSHARP CSHARP C++ 4.3.2 CPP CPP14 C99 COFFEE DART FORTH JULIA KTLN OCT PROLOG PYPY3 R RACKET SQLITE SWIFT UNLAMBDA