unittest
{
//	assert( [ "4 1" ].parse.expand.solve == "2 3" );
	assert( [ "4 1" ].parse.expand.solve == "1 4" );
//	assert( [ "7 3" ].parse.expand.solve == "1 6\n2 5\n3 4" );
	assert( [ "7 3" ].parse.expand.solve == "1 7\n2 6\n3 5" );
}



import std.conv;
import std.format;
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 nm = input.front.split.to!( long[] );
	return tuple( nm[ 0 ], nm[ 1 ] );
}

auto solve( long n, long m )
{
	auto anss = new string[ m ];
	foreach( i, ref ans; anss )
	{
		auto a = i + 1;
		auto b = n - i;
		ans = format( "%s %s", a, b );
	}
	return anss.join( "\n" );
}
