unittest
{
	assert( [ "1222" ].parse.expand.solve == "1+2+2+2=7" );
	assert( [ "0290" ].parse.expand.solve == "0-2+9+0=7" );
//	assert( [ "3242" ].parse.expand.solve == "3+2+4-2=7" );
	assert( [ "3242" ].parse.expand.solve == "3-2+4+2=7" );		// 別解
}



import std.algorithm;
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 cs = input.front.strip.to!( dchar[] );
	return tuple( cs );
}

auto solve( dchar[] cs )
{
	auto ns = cs.map!( ( a ) => ( a - '0' ) );
	
	foreach( ops; genOps( 3 ) )
	{
		auto s = [ cs[ 0 ] ];
		auto t = ns[ 0 ];
		
		foreach( op, c, n; lockstep( ops, cs[ 1 .. $ ], ns[ 1 .. $ ] ) )
		{
			s ~= [ op, c ];
			switch( op )
			{
				case '+': t += n; break;
				case '-': t -= n; break;
				default : assert( false );
			}
		}
		
		if( t == 7 ) return s ~ "=7";
	}
	
	assert( false );
}

auto genOps( long n )
{
	dchar[][] opss = [ [ '+' ], [ '-' ] ];
	
	foreach( i; 0 .. n - 1 )
	{
		foreach( k; 0 .. opss.length )
		{
			opss ~= opss[ k ].dup;
			opss[ k ] ~= '+';
			opss[ $ - 1 ] ~= '-';
		}
	}
	
	return opss;
}
