S001-AC.cc 619 Bytes
#include <iostream>

using namespace std;

int main()
{
	int a,b,c,d,x,y;

	cin >> a;
	cin >> b;
	cin >> c;
	cin >> d;

	if(a == c && b == d)
	{
		cout << "= , [" << a << "," << b << "]"  << endl;
		return 0;
	}
	else if(a<=d)
	{
		if(b>=c)
		{
			if(a<=c && b>=d)
			{
				cout << "2 , ";
			}
			else if(a>=c && b<=d)
			{
				cout << "1 , ";
			}
			else
			{
				cout << "? , ";
			}

			if(a<c)
			{
				x = c;
			}
			else
			{
				x = a;
			}
			if(d<b)
			{
				y = d;
			}
			else
			{
				y = b;
			}
			cout << "[" << x << "," << y << "]" << endl;
			return 0;
		}
	}
	cout << "? , []" << endl;
	return 0;
}