At a geometry lesson Bob learnt that a triangle is called right-angled if it is nondegenerate and one of its angles is right. Bob decided to draw such a triangle immediately: on a sheet of paper he drew three points with integer coordinates, and joined them with segments of straight lines, then he showed the triangle to Peter. Peter said that Bob's triangle is not right-angled, but is almost right-angled: the triangle itself is not right-angled, but it is possible to move one of the points exactly by distance 1 so, that all the coordinates remain integer, and the triangle become right-angled. Bob asks you to help him and find out if Peter tricks him. By the given coordinates of the triangle you should find out if it is right-angled, almost right-angled, or neither of these.

Input

The first input line contains 6 space-separated integers x1, y1, x2, y2, x3, y3 — coordinates of the triangle's vertices. All the coordinates are integer and don't exceed 100 in absolute value. It's guaranteed that the triangle is nondegenerate, i.e. its total area is not zero.

Output

If the given triangle is right-angled, output RIGHT, if it is almost right-angled, output ALMOST, and if it is neither of these, output NEITHER.

Examples

Input

0 0 2 0 0 1


Output

RIGHT


Input

2 3 4 5 6 6


Output

NEITHER


Input

-1 0 2 0 0 1


Output

ALMOST
import java.awt.geom.Point2D;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Locale;
import java.util.Scanner;
import java.util.StringTokenizer;

public class Triangle18A {
    public static void main(String[] args) {
        int x1, y1, x2, y2, x3, y3;
        Scanner sc = new Scanner(System.in);
        sc.useLocale(Locale.US);
        while (sc.hasNextLine()) {
            String line = sc.nextLine();
            StringTokenizer st = new StringTokenizer(line, " \n\r");
            while (st.hasMoreTokens()) {
                x1 = Integer.parseInt(st.nextToken());
                y1 = Integer.parseInt(st.nextToken());
                x2 = Integer.parseInt(st.nextToken());
                y2 = Integer.parseInt(st.nextToken());
                x3 = Integer.parseInt(st.nextToken());
                y3 = Integer.parseInt(st.nextToken());

                Point2D pt1 = new Point2D.Double(x1, y1);
                Point2D pt2 = new Point2D.Double(x2, y2);
                Point2D pt3 = new Point2D.Double(x3, y3);

                double d13 = pt1.distance(pt3);
                double d12 = pt1.distance(pt2);
                double d23 = pt2.distance(pt3);

                double d13squared = d13 * d13;
                double d12squared = d12 * d12;
                double d23squared = d23 * d23;

                if (Math.abs(d13squared + d12squared- d23squared) < 1e-7
                        || Math.abs(d12squared + d23squared - d13squared) < 1e-7
                        || Math.abs(d23squared + d13squared - d12squared) < 1e-7) {
                    System.out.println("RIGHT");
                    return;
                } else {
                    int[] shiftX = new int[] { 1, 0, -1, 0 };
                    int[] shiftY = new int[] { 0, 1, 0, -1 };

                    for (int i = 0; i < shiftX.length; i++) {
                        Point2D pt1shifted = new Point2D.Double(x1 + shiftX[i],
                                y1 + shiftY[i]);
                        Point2D pt2shifted = new Point2D.Double(x2 + shiftX[i],
                                y2 + shiftY[i]);
                        Point2D pt3shifted = new Point2D.Double(x3 + shiftX[i],
                                y3 + shiftY[i]);

                        double d13shifted = pt1shifted.distance(pt3);
                        double d12shifted = pt1shifted.distance(pt2);
                        double d23shifted = pt2.distance(pt3);

                        double d13squaredshifted = d13shifted * d13shifted;
                        double d12squaredshifted = d12shifted * d12shifted;
                        double d23squaredshifted = d23shifted * d23shifted;

                        if (Math.abs(d13squaredshifted + d12squaredshifted - d23squaredshifted)<1e-7
                                || Math.abs(d12squaredshifted + d23squaredshifted - d13squaredshifted)<1e-7
                                || Math.abs(d23squaredshifted + d13squaredshifted - d12squaredshifted)<1e-7) {  
                            if (!pt2.equals(pt1shifted) && !pt3.equals(pt1shifted)) {
                            System.out.println("ALMOST");
                            return;
                            }
                        }

                        d13shifted = pt1.distance(pt3);
                        d12shifted = pt1.distance(pt2shifted);
                        d23shifted = pt2shifted.distance(pt3);

                        d13squaredshifted = d13shifted * d13shifted;
                        d12squaredshifted = d12shifted * d12shifted;
                        d23squaredshifted = d23shifted * d23shifted;

                        if (Math.abs(d13squaredshifted + d12squaredshifted - d23squaredshifted)<1e-7
                                || Math.abs(d12squaredshifted + d23squaredshifted - d13squaredshifted)<1e-7
                                || Math.abs(d23squaredshifted + d13squaredshifted - d12squaredshifted)<1e-7) {
                            if (!pt1.equals(pt2shifted) && !pt3.equals(pt2shifted)) {
                            System.out.println("ALMOST");
                            return;
                            }
                        }

                        d13shifted = pt1.distance(pt3shifted);
                        d12shifted = pt1.distance(pt2);
                        d23shifted = pt2.distance(pt3shifted);

                        d13squaredshifted = d13shifted * d13shifted;
                        d12squaredshifted = d12shifted * d12shifted;
                        d23squaredshifted = d23shifted * d23shifted;

                        if (Math.abs(d13squaredshifted + d12squaredshifted - d23squaredshifted) <1e-7
                                || Math.abs(d12squaredshifted + d23squaredshifted - d13squaredshifted)<1e-7
                                || Math.abs(d23squaredshifted + d13squaredshifted - d12squaredshifted)< 1e-7) {
                            if (!pt1.equals(pt3shifted) && !pt2.equals(pt3shifted)) {
                            System.out.println("ALMOST");
                            return;
                            }
                        }
                    }
                    System.out.println("NEITHER");
                    return;
                }
            }
        }
    }
}
