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



import std.conv;
import std.range;
import std.stdio;

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

auto solve( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto n = input.front.to!( long );
	input.popFront;
	auto as = input.front.split.to!( long[] );
	
	auto anss = new long[ n ];
	anss[ 0 ] = as[ 0 ];
	foreach( aa; as[ 1 .. $ ].chunks( 2 ) )
	{
		anss[ 0 ] += -aa[ 0 ] + aa[ 1 ];
	}
	foreach( i, a; as[ 0 .. $ - 1 ] )
	{
		anss[ i + 1 ] = a * 2 - anss[ i ];
	}
	return anss.to!( string[] ).join( " " );
}
