unittest
{
	assert( [ "1 2 2 2 1", "2 4", "5 1", "3" ].parse.expand.solve == 12 );
	assert( [ "2 2 2 2 2", "8 6", "9 1", "2 1" ].parse.expand.solve == 25 );
	assert( [ "2 2 4 4 4", "11 12 13 14", "21 22 23 24", "1 2 3 4" ].parse.expand.solve == 74 );
}



import std.algorithm;
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 ) )
{
	auto xyabc = input.front.split.to!( long[] );
	input.popFront;
	auto ps = input.front.split.to!( long[] );
	input.popFront;
	auto qs = input.front.split.to!( long[] );
	input.popFront;
	auto rs = input.front.split.to!( long[] );
	return tuple( xyabc[ 0 ], xyabc[ 1 ], ps, qs, rs );
}

auto solve( long x, long y, long[] ps, long[] qs, long[] rs )
{
	ps.sort!( ( a, b ) => b < a );
	ps = ps.take( x );
	qs.sort!( ( a, b ) => b < a );
	qs = qs.take( y );
	rs.sort!( ( a, b ) => b < a );
	
	auto pt = ps.take( x ).sum;
	auto qt = qs.take( y ).sum;
	foreach( r; rs )
	{
		if( ps.empty || ( !qs.empty && qs.back < ps.back ) )
		{
			if( r <= qs.back ) break;
			qt += r - qs.back;
			qs.popBack;
		}
		else
		{
			if( r <= ps.back ) break;
			pt += r - ps.back;
			ps.popBack;
		}
	}
	return pt + qt;
}
