unittest
{
	assert( [ "3", "2 2 4" ].parse.expand.solve == "4 0 4" );
	assert( [ "5", "3 8 7 5 5" ].parse.expand.solve == "2 4 12 2 8" );
	assert( [ "3", "1000000000 1000000000 0" ].parse.expand.solve == "0 2000000000 0" );
}



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 ) )
{
	input.popFront;
	auto as = input.front.split.to!( long[] );
	return tuple( as );
}

auto solve( long[] as )
{
	// 最初の山の降雨量を計算
	auto anss = new long[ as.length ];
	anss[ 0 ] = as[ 0 ];
	for( auto i = 1L; i < as.length; i += 2 )
	{
		anss[ 0 ] = anss[ 0 ] - as[ i ] + as[ i + 1 ];
	}
	
	// 最後から2番目までの山の降雨量を計算
	anss[ $ - 1 ] = as[ $ - 1 ] * 2 - anss[ 0 ];
	for( auto i = as.length.signed - 2; 0 < i; i-- )
	{
		anss[ i ] = as[ i ] * 2 - anss[ i + 1 ];
	}
	
	return anss.to!( string[] ).join( " " );
}
