unittest
{
	assert( [ "5 4 2" ].parse.expand.solve == "5 3" );
	assert( [ "3 3 3" ].parse.expand.solve == "1 3" );
	assert( [ "314159265 358979323 84" ].parse.expand.solve == "448759046 224379523" );
}



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 abk = input.front.split.to!( long[] );
	return tuple( abk[ 0 ], abk[ 1 ], abk[ 2 ] );
}

auto solve( long a, long b, long k )
{
	foreach( i; 0 .. k )
	{
		if( i % 2 == 0 )
		{
			// 高橋君のターン
			a -= ( a % 2 == 1 );
			b += a / 2;
			a /= 2;
		}
		else
		{
			// 青木君のターン
			b -= ( b % 2 == 1 );
			a += b / 2;
			b /= 2;
		}
	}
	return format( "%s %s", a, b );
}
