unittest
{
	assert( [ "3", "4 7", "2 9", "6 2" ].parse.expand.solve == 8 );
	assert( [ "5", "1 10", "3 6", "5 2", "4 4", "2 8" ].parse.expand.solve == 7 );
	assert( [ "2", "1 1000000000", "1000000000 1" ].parse.expand.solve == 1000000001 );
}



import std.algorithm;
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 n = input.front.to!( long );
	auto abs = new long[ 2 ][ n ];
	foreach( ref ab; abs )
	{
		input.popFront;
		ab = input.front.split.to!( long[] );
	}
	return tuple( abs );
}

auto solve( long[ 2 ][] abs )
{
	abs.sort!( ( x, y ) => y[ 0 ] < x[ 0 ] );
	return abs.front[ 0 ] + abs.front[ 1 ];
}
