unittest
{
	assert( [ "3 4", "1 1", "2 2", "3 3" ].parse.expand.solve == 3 );
	assert( [
		"10 500000",
		"1 100000",
		"1 100000",
		"1 100000",
		"1 100000",
		"1 100000",
		"100000 100000",
		"100000 100000",
		"100000 100000",
		"100000 100000",
		"100000 100000"
	].parse.expand.solve == 1 );
}



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

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

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto nk = input.front.split.to!( long[] );
	auto abs = new long[ 2 ][ nk[ 0 ] ];
	foreach( ref ab; abs )
	{
		input.popFront;
		ab = input.front.split.to!( long[] );
	}
	return tuple( nk[ 1 ], abs );
}

auto solve( long k, long[ 2 ][] abs )
{
	abs.sort();
	
	auto i = 0L;
	foreach( ab; abs )
	{
		i += ab[ 1 ];
		if( k <= i ) return ab[ 0 ];
	}
	
	assert( false );
}
