SCPC11D - Egypt

no tags 

A long time ago, the Egyptians figured out that a triangle with sides of length 3, 4, and 5 had a right angle as its largest angle. You must determine if other triangles have a similar property.

Input

Input represents several test cases, followed by a line containing 0 0 0. Each test case has three positive integers, less than 30,000, denoting the lengths of the sides of a triangle.

Output

For each test case, a line containing "right" if the triangle is a right triangle, and a line containing "wrong" if the triangle is not a right triangle.

Example

Input:
6 8 10
25 52 60
6 8 10 25 52 60 5 12 13 0 0 0
5 12 13
0 0 0
Output: right wrong right

hide comments
(Tjandra Satria Gunawan)(曾毅昆): 2013-08-21 01:10:51

@Shekhar: Thanks for the "hint", my silly mistake :-P

Francky: 2013-04-11 22:30:06

This was tutorial some times ago. I don't know how it came in classical. Back to tutorial.

shashank: 2013-03-03 11:26:52

One of the most easiest problem in spoj
you should know about pythogores theorem in maths...

Bhagwat: 2013-02-11 14:58:17

Very easy problem...:)

Philipp Heeg: 2012-12-22 16:22:33

Use String.trim() in Java to correct the Input.

£ukasz Zatorski: 2012-11-11 17:09:14

There are additional whitespace characters at the end of some lines (mostly TAB or something similar). Please keep some standards of input - people can try to submit results in various languages, and this can cause some hard to understand WAs.

No_words: 2012-11-04 12:23:49

why NZEC in java ??? Same logic gives AC in python !
whats wrong ???

Last edit: 2012-11-04 12:37:41
DEVANSH PARASHAR: 2012-09-26 19:34:35

sort the input

a b : 2012-08-04 00:15:47

what if a triangle is not possible...caused me a wrong answers

Mostafa 36a2: 2012-07-09 01:59:31

Look Men ... I Really Love SPOJ
18 WA
for a small little tiny wrong
:)

Last edit: 2012-07-09 02:01:08

Added by:Ali Arous
Date:2011-10-18
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64
Resource:Syrian Collegiate Programming Contest 2011