import java.util.*;
 
class Main{
	public static void main (String[] args) throws java.lang.Exception{
		Scanner scan = new Scanner(System.in);
		double Ua, Ub, numerator_a, numerator_b, denominator;
		double x1 = scan.nextDouble();
		double y1 = scan.nextDouble();
		double x2 = scan.nextDouble();
		double y2 = scan.nextDouble();
		double x3 = scan.nextDouble();
		double y3 = scan.nextDouble();
		double x4 = scan.nextDouble();
		double y4 = scan.nextDouble();
 
		denominator=(y4-y3)*(x1-x2)-(x4-x3)*(y1-y2);
		if (denominator == 0){
			if ( (x1*y2-x2*y1)*(x4-x3) - (x3*y4-x4*y3)*(x2-x1) == 0 && (x1*y2-x2*y1)*(y4-y3) - (x3*y4-x4*y3)*(y2-y1) == 0)	System.out.print("Отрезки пересекаются");
			else System.out.print("Отрезки не пересекаются");
		}
		else{
		numerator_a=(x4-x2)*(y4-y3)-(x4-x3)*(y4-y2);
		numerator_b=(x1-x2)*(y4-y2)-(x4-x2)*(y1-y2);
		Ua=numerator_a/denominator;
		Ub=numerator_b/denominator;
		if (Ua >=0 && Ua <=1 && Ub >=0 && Ub <=1)	System.out.print("Отрезки пересекаются");
		else	System.out.print("Отрезки не пересекаются");
		}
	}
}