Gerald is very particular to eight point sets. He thinks that any decent eight point set must consist of all pairwise intersections of three distinct integer vertical straight lines and three distinct integer horizontal straight lines, except for the average of these nine points. In other words, there must be three integers x 1, x 2, x 3 and three more integers y 1, y 2, y 3 , such that x 1 x 2 x 3 , y 1 y 2 y 3 and the eight point set consists of all points (x i , y j ) (1 ≤ i, j ≤ 3), except for point (x 2, y 2). You have a set of eight points. Find out if Gerald can use this set?
输入描述:
The input consists of eight lines, the i-th line contains two space-separated integers xi and yi (0 ≤ xi, yi ≤ 106). You do not have any other conditions for these points.
输出描述:
In a single line print word "respectable", if the given set of points corresponds to Gerald's decency rules, and "ugly" otherwise.
示例1
输入
0 0<br />0 1<br />0 2<br />1 0<br />1 2<br />2 0<br />2 1<br />2 2<br />0 0<br />1 0<br />2 0<br />3 0<br />4 0<br />5 0<br />6 0<br />7 0<br />1 1<br />1 2<br />1 3<br />2 1<br />2 2<br />2 3<br />3 1<br />3 2<br />
输出
respectable<br />ugly<br />ugly<br />
加载中...