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.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

/**
 * Nome: Lisandra Nayara Carvalho Diniz
 * Matrícula: 2012054980
 * Problema: #3 - TRIANGLE - Triangle
 * Solução: Lê os pontos do triângulo ((x1, y1), (x2, y2), (x3, y3)), calcula os valores dos lados (utilizando a fórmula (xa - xb)² + (ya - yb)²) e 
 * ordenando os mesmo de forma crescente. Com os pontos e lados calculados, verifica qual o tipo do triângulo: 
 * 		- imprime RIGHT caso o maior lado seja a soma dos outros 2 lados;
 * 		- imprime ALMOST caso quando se retirar 1 de algum dos pontos e recalcula-se os lados do triângulo verifica-se que o mesmo passou a 
 * 			ser do tipo "RIGHT";
 * 		- imprime NEITHER caso nenhum dos casos acima seja atendido.
 */
public class Triangle {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		
		String entrada = reader.readLine();
		String[] split = entrada.split(" ");
		
		Integer[] pontos = obterPontos(split); 
		Double[] lados = obterLados(pontos);
		
		if(isRight(lados)) {
			System.out.println("RIGHT");
		} else if(isAlmost(pontos)) {
			System.out.println("ALMOST");
		} else {
			System.out.println("NEITHER");
		}
	}

	private static Integer[] obterPontos(String[] split) {
		Integer x1 = Integer.parseInt(split[0]);
		Integer y1 = Integer.parseInt(split[1]);
		Integer x2 = Integer.parseInt(split[2]);
		Integer y2 = Integer.parseInt(split[3]);
		Integer x3 = Integer.parseInt(split[4]);
		Integer y3 = Integer.parseInt(split[5]);
		
		return new Integer[] {x1, y1, x2, y2, x3, y3};
	}
	
	private static Double[] obterLados(Integer[] pontos) {
		Double[] lados = new Double[3];
		lados[0] = Math.pow((pontos[4]-pontos[2]), 2) + Math.pow((pontos[5]-pontos[3]), 2);
		lados[1] = Math.pow((pontos[4]-pontos[0]), 2) + Math.pow((pontos[5]-pontos[1]), 2);
		lados[2] = Math.pow((pontos[2]-pontos[0]), 2) + Math.pow((pontos[3]-pontos[1]), 2);
		Arrays.sort(lados);
		return lados;
	}

	private static boolean isRight(Double[] lados) {
		return lados[0] > 0.0 && lados[2] == (lados[0] + lados[1]);
	}

	private static boolean isAlmost(Integer[] pontos) {
		for(int i = 0; i < pontos.length; i++) {
			// adicionando 1 ao valor do ponto original
			pontos[i] += 1;
			if(isRight(obterLados(pontos))) {
				return true;
			}
			
			// removendo 1 do valor do ponto original
			pontos[i] -= 2;
			if(isRight(obterLados(pontos))) {
				return true;
			}
			
			// voltando o ponto para o valor original
			pontos[i] += 1;
		}
		
		return false;
	}
}
