#include <bits/stdc++.h>
using namespace std;
int a, b, i, m, n, ia, ib, xa, xb, pos, res, res_a, res_b, aSize, bSize, score_a, score_b;
vector< int > aS, bS;
vector< pair< int, int > > aScore, bScore;
int main() {
scanf( "%d", &n );
for( i = 0; i < n; i++ ) {
scanf( "%d", &a );
aS.push_back( a );
}
scanf( "%d", &m );
for( i = 0; i < m; i++ ) {
scanf( "%d", &b );
bS.push_back( b );
}
sort( aS.begin(), aS.end() );
sort( bS.begin(), bS.end() );
aScore.push_back( make_pair( aS[0], 1 ) );
pos = 0;
for( i = 1; i < n; i++ ) {
if( aS[i] == aS[i - 1] ) {
aScore[pos].second++;
}
if( aS[i] != aS[i - 1] ) {
aScore.push_back( make_pair( aS[i], 1 ) );
pos++;
}
}
bScore.push_back( make_pair( bS[0], 1 ) );
pos = 0;
for( i = 1; i < m; i++ ) {
if( bS[i] == bS[i - 1] ) {
bScore[pos].second++;
}
if( bS[i] != bS[i - 1] ) {
bScore.push_back( make_pair( bS[i], 1 ) );
pos++;
}
}
aScore.push_back( make_pair( aS[n - 1] + 1, 0 ) );
bScore.push_back( make_pair( bS[m - 1] + 1, 0 ) );
aSize = aScore.size();
bSize = bScore.size();
/*
for( i = 0; i < aSize; i++ ) {
printf( "%d.%d", aScore[i].first, aScore[i].second );
}
printf( "\n" );
for( i = 0; i < bSize; i++ ) {
printf( "%d.%d", bScore[i].first, bScore[i].second );
}
printf( "\n" );
*/
ia = 0;
ib = 0;
xa = 0;
xb = 0;
res = -200000005;
while( true ) {
score_a = ( n - xa ) * 3 + xa * 2;
score_b = ( m - xb ) * 3 + xb * 2;
if( score_a - score_b > res ) {
res_a = score_a;
res_b = score_b;
res = score_a - score_b;
}
if( (ia == aSize - 1) && (ib < bSize - 1) ) {
ib++;
xb += bScore[ib - 1].second;
} else if( (ia < aSize - 1) && (ib == bSize - 1) ) {
ia++;
xa += aScore[ia - 1].second;
} else if( (ia == aSize - 1) && (ib == bSize - 1) ) {
break;
} else if( aScore[ia].first == bScore[ib].first ) {
ia++;
ib++;
xa += aScore[ia - 1].second;
xb += bScore[ib - 1].second;
} else if( aScore[ia + 1].first <= bScore[ib].first ) {
ia++;
xa += aScore[ia - 1].second;
} else if( bScore[ib + 1].first <= aScore[ia].first ) {
ib++;
xb += bScore[ib - 1].second;
}
//printf( "%d:%d, %d, %d, %d, %d\n", score_a, score_b, xa, xb, ia, ib );
}
printf( "%d:%d\n", res_a, res_b );
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IGEsIGIsIGksIG0sIG4sIGlhLCBpYiwgeGEsIHhiLCBwb3MsIHJlcywgcmVzX2EsIHJlc19iLCBhU2l6ZSwgYlNpemUsIHNjb3JlX2EsIHNjb3JlX2I7CnZlY3RvcjwgaW50ID4gYVMsIGJTOwp2ZWN0b3I8IHBhaXI8IGludCwgaW50ID4gPiBhU2NvcmUsIGJTY29yZTsKCmludCBtYWluKCkgewoJc2NhbmYoICIlZCIsICZuICk7Cglmb3IoIGkgPSAwOyBpIDwgbjsgaSsrICkgewoJCXNjYW5mKCAiJWQiLCAmYSApOwoJCWFTLnB1c2hfYmFjayggYSApOwoJfQoJc2NhbmYoICIlZCIsICZtICk7Cglmb3IoIGkgPSAwOyBpIDwgbTsgaSsrICkgewoJCXNjYW5mKCAiJWQiLCAmYiApOwoJCWJTLnB1c2hfYmFjayggYiApOwoJfQoJc29ydCggYVMuYmVnaW4oKSwgYVMuZW5kKCkgKTsKCXNvcnQoIGJTLmJlZ2luKCksIGJTLmVuZCgpICk7CglhU2NvcmUucHVzaF9iYWNrKCBtYWtlX3BhaXIoIGFTWzBdLCAxICkgKTsKCXBvcyA9IDA7Cglmb3IoIGkgPSAxOyBpIDwgbjsgaSsrICkgewoJCWlmKCBhU1tpXSA9PSBhU1tpIC0gMV0gKSB7CgkJCWFTY29yZVtwb3NdLnNlY29uZCsrOwoJCX0KCQlpZiggYVNbaV0gIT0gYVNbaSAtI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