unittest
{
	assert( [ "11 16", "11 17" ].parse.expand.solve == 0 );
	assert( [ "11 30", "12 1" ].parse.expand.solve == 1 );
}



import std.conv;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto md1 = input.front.split.to!( long[] );
	input.popFront;
	auto md2 = input.front.split.to!( long[] );
	return tuple( md1[ 0 ], md2[ 0 ] );
}

auto solve( long m1, long m2 )
{
	return ( m1 == m2 ) ? 0 : 1;
}
