public static void Main()
a = double.Parse(Console.ReadLine());
b = double.Parse(Console.ReadLine());
c = double.Parse(Console.ReadLine());
d = double.Parse(Console.ReadLine());
bool statement = ((a <= c) && (c <= d) && (d <= b)) || ((c <= a) && (a <= b) && (b <= d));
Console.WriteLine(statement);