#include <bits/stdc++.h>
using namespace std;
/***************************************************************************************************************************************/
typedef long long int LLI;
typedef unsigned long long int ULLI;
#define MP(X,Y)         make_pair(X,Y)
#define fill(a,v)       memset(a,v,sizeof(a))
#define DEBUG(x)        cout << #x << ": " << x << endl;
#define all(x)          (x).begin(),(x).end()
#define SORT(x)         sort(all(x))
#define VI              vector<int>
#define SI              set<int>
#define VS              vector<string>
#define PB              push_back
#define REV(a)          reverse(all(a))
#define BRPS(n,bit)     bitset<bit>(n)
#define LB(A, x)        (lower_bound(all(A), x) - A.begin())//exactly where it starts
#define UB(A, x)        (upper_bound(all(A), x) - A.begin())
#define UNQ(x)          SORT(x),(x).erase(unique(all(x)),x.end())
#define FOR(i,a,b)      for(int i=(int)(a);i<=(int)(b);i++)
#define foreach(e,x)    for(__typeof(x.begin()) e=x.begin();e!=x.end();++e)
#define DBG(v)          std::copy( v.begin(), v.end(), std::ostream_iterator < typeof( *v.begin() )> ( std::cout, " " ) )
#define INF             0x7FFFFFFF
#define INFL            0x7FFFFFFFFFFFFFFF

typedef pair<int, int>PII;
typedef pair<LLI, LLI>PLL;

template<class T> inline T BIGMOD(T n, T m, T mod)
{
    LLI ans = 1;
    LLI k = n;
    while(m)
    {
        if(m & 1)
        {
            ans *= k;
            if(ans>mod) ans %= mod;
        }
        k *= k;
        if(k>mod) k %= mod;
        m >>= 1;
    }
    return ans;
}
#define eps 1e-11
template<class T> string toString(T n)
{
    ostringstream ost;
    ost << n;
    ost.flush();
    return ost.str();
}
template<class T> string toBinary(T n)
{
    string ret="";
    while(n)
    {
        if(n%2==1)ret+='1';
        else ret+='0';
        n>>=1;
    }
    reverse(ret.begin(),ret.end());
    return ret;
}
void combination(int n,vector< vector<int> > &ret)
{
    ret.resize(n+1, vector<int>(n+1, 0));
    for(int i=1; i<=n; i++)
    {
        ret[i][0]=ret[i][i]=1;
        for(int j=1; j<i; j++)
        {
            ret[i][j]=ret[i-1][j]+ret[i-1][j-1];
        }
    }
}
int toInt(string s)
{
    int r = 0;
    istringstream sin(s);
    sin >> r;
    return r;
}
LLI toLInt(string s)
{
    LLI r = 0;
    istringstream sin(s);
    sin >> r;
    return r;
}
vector<string> parse(string temp)
{
    vector<string> ans;
    ans.clear();
    string s;
    istringstream iss(temp);
    while (iss >> s)ans.PB(s);
    return ans;
}
template<class T> inline T gcd(T a, T b)
{
    if (a < 0)return gcd(-a, b);
    if (b < 0)return gcd(a, -b);
    return (b == 0) ? a : gcd(b, a % b);
}
template<class T> inline T lcm(T a, T b)
{
    if (a < 0)return lcm(-a, b);
    if (b < 0)return lcm(a, -b);
    return a*(b / gcd(a, b));
}
template<class T> inline T power(T b, T p)
{
    if (p < 0)return -1;
    if (b <= 0)return -2;
    if (!p)return 1;
    return b*power(b, p - 1);
}

template<class T> inline int asd(T &ret)
{
    char r;
    bool start=false,neg=false;
    ret=0;
    bool isaNumber=false;
    while(true)
    {
        r=getchar();
        if(r==EOF)
        {
            return 0;
        }
        if((r-'0'<0 || r-'0'>9) && r!='-' && !start)
        {
            continue;
        }
        if((r-'0'<0 || r-'0'>9) && r!='-' && start)
        {
            break;
        }
        if(start)ret*=10;
        start=true;
        if(r=='-')neg=true;
        else ret+=r-'0';
    }
    if(neg)
        ret*=-1;
    return 1;
}

// Yet to Test
template<class T> inline int asd(T &ret1,T &ret2)
{
    asd(ret1);
    asd(ret2);
}
template<class T> inline int asd(T &ret1,T &ret2,T &ret3)
{
    asd(ret1,ret2);
    asd(ret3);
}
template<class T> inline int asd(T &ret1,T &ret2,T &ret3,T &ret4)
{
    asd(ret1,ret2);
    asd(ret3,ret4);
}

template<class T> inline void asdasd(T x,char y)
{
    // 0- print+newline, 1 - print ' ',2 - nothing;
    if (x < 0)
    {
        putchar('-');
        x = -x;
    }
    char buf[21], *p = buf;
    do
    {
        *p++ = '0' + x % 10;
        x /= 10;
    }
    while (x);
    do
    {
        putchar(*--p);
    }
    while (p > buf);
    if(y==0)putchar('\n');
    else if(y==1)putchar(' ');
}

/*vector IO*/
template < typename value_type >
istream & operator>> ( istream & in, vector < value_type > & a )
{
    typedef typename vector < value_type >::iterator iterator;
    if ( ! a.size( ) )
    {
        size_t n;
        asd(n);
        a.resize( n );
    }
    for ( iterator iter = a.begin(); iter != a.end(); ++ iter )
        asd(*iter);
    return in;
}

//vector1D OUT
template < typename value_type >
ostream & operator<< ( ostream & out, const vector <  value_type > & a )
{
    int sz=a.size();
    FOR(i,0,sz-1)asdasd(a[i],i!=sz);
    return out;
}

//vector2D OUT
template < typename value_type >
ostream & operator<< ( ostream & out, const vector < vector< value_type > > & a )
{
    int sza=a.size();
    int szb=a[0].size();
    FOR(i,0,sza-1)
    {
        FOR(j,0,szb-1)asdasd(a[i][j],j!=sza);
        puts("");
    }
    return out;
}
//set OUT
template < typename value_type >
ostream & operator<< ( ostream & out, const set <  value_type > & a )
{
    foreach(e,a)asdasd(*e,e!=a.end());
    return out;
}
//MAP OUT
template < typename key_type, typename value_type >
ostream & operator<< ( ostream & in, map < key_type, value_type > & a)
{
    foreach(e,a)
    {
        cout << (*e).first << " -> " << (*e).second << endl;
    }
    return in;
}
/*END OF STL IO*/
template < typename key_type, typename value_type >
istream & operator>> ( istream & in, pair < key_type, value_type > & p)
{
    in >> p.first >> p.second;
    return in;
}
template < typename key_type, typename value_type >
ostream & operator<< ( ostream & out, const pair < key_type, value_type > & p)
{
    out << "(" << p.first << ", " << p.second << ")";
    return out;
}
vector<int> inverseArray(int n, int m)
{
    vector<int> modI(n + 1,0);
    modI[1] = 1;
    for(int i = 2; i <= n; i++)
    {
        modI[i] = (-(m/i) * modI[m % i]) % m + m;
    }
    return modI;
}

pair<LLI, pair<LLI, LLI> > extendedEuclid(LLI a, LLI b)
{
    LLI x = 1, y = 0;
    LLI xLast = 0, yLast = 1;
    LLI q, r, m, n;
    while(a != 0)
    {
        q = b / a;
        r = b % a;
        m = xLast - q * x;
        n = yLast - q * y;
        xLast = x, yLast = y;
        x = m, y = n;
        b = a, a = r;
    }
    return make_pair(b, make_pair(xLast, yLast));
}

LLI modInverse(LLI a, LLI m)
{
    return (extendedEuclid(a,m).second.first + m) % m;
}

#define filein(x) freopen(x,"r",stdin)
#define fileout(x) freopen(x,"w",stdout)
#define fst first
#define snd second
//istringstream(temp) >> data >> value >> stamp;
//mod1 = 1000000007, mod2 = 1000000009;
//.016-.040-.900-2.48
/***************************************************************************************************************************************/

map<int,int>M;VI A,B;

bool comp(PII A,PII B)
{
    if(A.fst-A.snd==B.fst-B.snd)
    {
        return A.fst>B.fst;
    }
    return A.fst-A.snd > B.fst-B.snd;
}
int main()
{
    int n,m,a;
    asd(n);
    FOR(i,1,n)
    {
        asd(a);
        A.PB(a);
        M[a]=1;
    }
    asd(m);
    FOR(i,1,m)
    {
        asd(a);
        B.PB(a);
        M[a]=1;
    }
    int K=0;
    foreach(it,M)
    {
        (*it).second = ++K;
        //cout << *it << endl;
    }
    int Mxe=0;
    FOR(i,1,n)
    {
        A[i-1]=M[A[i-1]];
        Mxe=max(Mxe,A[i-1]);
    }
    FOR(i,1,m)
    {
        B[i-1]=M[B[i-1]];
        Mxe=max(Mxe,B[i-1]);
    }
    vector<PII>V;
    for(int d=0;d<=Mxe+1;d++)
    {
        int lba=lower_bound(all(A),d+1)-A.begin();
        int lbb=lower_bound(all(B),d+1)-B.begin();
        V.PB(MP( lba*2 + (n-lba)*3 , ( lbb*2 + (m-lbb)*3 ) ));
    }
    sort(all(V),comp);
    cout << V[0].first << ":" << V[0].snd << endl;

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
/***************************************************************************************************************************************/
typedef long long int LLI;
typedef unsigned long long int ULLI;
#define MP(X,Y)         make_pair(X,Y)
#define fill(a,v)       memset(a,v,sizeof(a))
#define DEBUG(x)        cout << #x << ": " << x << endl;
#define all(x)          (x).begin(),(x).end()
#define SORT(x)         sort(all(x))
#define VI              vector<int>
#define SI              set<int>
#define VS              vector<string>
#define PB              push_back
#define REV(a)          reverse(all(a))
#define BRPS(n,bit)     bitset<bit>(n)
#define LB(A, x)        (lower_bound(all(A), x) - A.begin())//exactly where it starts
#define UB(A, x)        (upper_bound(all(A), x) - A.begin())
#define UNQ(x)          SORT(x),(x).erase(unique(all(x)),x.end())
#define FOR(i,a,b)      for(int i=(int)(a);i<=(int)(b);i++)
#define foreach(e,x)    for(__typeof(x.begin()) e=x.begin();e!=x.end();++e)
#define DBG(v)          std::copy( v.begin(), v.end(), std::ostream_iterator < typeof( *v.begin() )> ( std::cout, " " ) )
#define INF             0x7FFFFFFF
#define INFL            0x7FFFFFFFFFFFFFFF

typedef pair<int, int>PII;
typedef pair<LLI, LLI>PLL;

template<class T> inline T BIGMOD(T n, T m, T mod)
{
    LLI ans = 1;
    LLI k = n;
    while(m)
    {
        if(m & 1)
        {
            ans *= k;
            if(ans>mod) ans %= mod;
        }
        k *= k;
        if(k>mod) k %= mod;
        m >>= 1;
    }
    return ans;
}
#define eps 1e-11
template<class T> string toString(T n)
{
    ostringstream ost;
    ost << n;
    ost.flush();
    return ost.str();
}
template<class T> string toBinary(T n)
{
    string ret="";
    while(n)
    {
        if(n%2==1)ret+='1';
        else ret+='0';
        n>>=1;
    }
    reverse(ret.begin(),ret.end());
    return ret;
}
void combination(int n,vector< vector<int> > &ret)
{
    ret.resize(n+1, vector<int>(n+1, 0));
    for(int i=1; i<=n; i++)
    {
        ret[i][0]=ret[i][i]=1;
        for(int j=1; j<i; j++)
        {
            ret[i][j]=ret[i-1][j]+ret[i-1][j-1];
        }
    }
}
int toInt(string s)
{
    int r = 0;
    istringstream sin(s);
    sin >> r;
    return r;
}
LLI toLInt(string s)
{
    LLI r = 0;
    istringstream sin(s);
    sin >> r;
    return r;
}
vector<string> parse(string temp)
{
    vector<string> ans;
    ans.clear();
    string s;
    istringstream iss(temp);
    while (iss >> s)ans.PB(s);
    return ans;
}
template<class T> inline T gcd(T a, T b)
{
    if (a < 0)return gcd(-a, b);
    if (b < 0)return gcd(a, -b);
    return (b == 0) ? a : gcd(b, a % b);
}
template<class T> inline T lcm(T a, T b)
{
    if (a < 0)return lcm(-a, b);
    if (b < 0)return lcm(a, -b);
    return a*(b / gcd(a, b));
}
template<class T> inline T power(T b, T p)
{
    if (p < 0)return -1;
    if (b <= 0)return -2;
    if (!p)return 1;
    return b*power(b, p - 1);
}

template<class T> inline int asd(T &ret)
{
    char r;
    bool start=false,neg=false;
    ret=0;
    bool isaNumber=false;
    while(true)
    {
        r=getchar();
        if(r==EOF)
        {
            return 0;
        }
        if((r-'0'<0 || r-'0'>9) && r!='-' && !start)
        {
            continue;
        }
        if((r-'0'<0 || r-'0'>9) && r!='-' && start)
        {
            break;
        }
        if(start)ret*=10;
        start=true;
        if(r=='-')neg=true;
        else ret+=r-'0';
    }
    if(neg)
        ret*=-1;
    return 1;
}

// Yet to Test
template<class T> inline int asd(T &ret1,T &ret2)
{
    asd(ret1);
    asd(ret2);
}
template<class T> inline int asd(T &ret1,T &ret2,T &ret3)
{
    asd(ret1,ret2);
    asd(ret3);
}
template<class T> inline int asd(T &ret1,T &ret2,T &ret3,T &ret4)
{
    asd(ret1,ret2);
    asd(ret3,ret4);
}

template<class T> inline void asdasd(T x,char y)
{
    // 0- print+newline, 1 - print ' ',2 - nothing;
    if (x < 0)
    {
        putchar('-');
        x = -x;
    }
    char buf[21], *p = buf;
    do
    {
        *p++ = '0' + x % 10;
        x /= 10;
    }
    while (x);
    do
    {
        putchar(*--p);
    }
    while (p > buf);
    if(y==0)putchar('\n');
    else if(y==1)putchar(' ');
}

/*vector IO*/
template < typename value_type >
istream & operator>> ( istream & in, vector < value_type > & a )
{
    typedef typename vector < value_type >::iterator iterator;
    if ( ! a.size( ) )
    {
        size_t n;
        asd(n);
        a.resize( n );
    }
    for ( iterator iter = a.begin(); iter != a.end(); ++ iter )
        asd(*iter);
    return in;
}

//vector1D OUT
template < typename value_type >
ostream & operator<< ( ostream & out, const vector <  value_type > & a )
{
    int sz=a.size();
    FOR(i,0,sz-1)asdasd(a[i],i!=sz);
    return out;
}

//vector2D OUT
template < typename value_type >
ostream & operator<< ( ostream & out, const vector < vector< value_type > > & a )
{
    int sza=a.size();
    int szb=a[0].size();
    FOR(i,0,sza-1)
    {
        FOR(j,0,szb-1)asdasd(a[i][j],j!=sza);
        puts("");
    }
    return out;
}
//set OUT
template < typename value_type >
ostream & operator<< ( ostream & out, const set <  value_type > & a )
{
    foreach(e,a)asdasd(*e,e!=a.end());
    return out;
}
//MAP OUT
template < typename key_type, typename value_type >
ostream & operator<< ( ostream & in, map < key_type, value_type > & a)
{
    foreach(e,a)
    {
        cout << (*e).first << " -> " << (*e).second << endl;
    }
    return in;
}
/*END OF STL IO*/
template < typename key_type, typename value_type >
istream & operator>> ( istream & in, pair < key_type, value_type > & p)
{
    in >> p.first >> p.second;
    return in;
}
template < typename key_type, typename value_type >
ostream & operator<< ( ostream & out, const pair < key_type, value_type > & p)
{
    out << "(" << p.first << ", " << p.second << ")";
    return out;
}
vector<int> inverseArray(int n, int m)
{
    vector<int> modI(n + 1,0);
    modI[1] = 1;
    for(int i = 2; i <= n; i++)
    {
        modI[i] = (-(m/i) * modI[m % i]) % m + m;
    }
    return modI;
}

pair<LLI, pair<LLI, LLI> > extendedEuclid(LLI a, LLI b)
{
    LLI x = 1, y = 0;
    LLI xLast = 0, yLast = 1;
    LLI q, r, m, n;
    while(a != 0)
    {
        q = b / a;
        r = b % a;
        m = xLast - q * x;
        n = yLast - q * y;
        xLast = x, yLast = y;
        x = m, y = n;
        b = a, a = r;
    }
    return make_pair(b, make_pair(xLast, yLast));
}

LLI modInverse(LLI a, LLI m)
{
    return (extendedEuclid(a,m).second.first + m) % m;
}

#define filein(x) freopen(x,"r",stdin)
#define fileout(x) freopen(x,"w",stdout)
#define fst first
#define snd second
//istringstream(temp) >> data >> value >> stamp;
//mod1 = 1000000007, mod2 = 1000000009;
//.016-.040-.900-2.48
/***************************************************************************************************************************************/

map<int,int>M;
VI A,B,D;

bool comp(PII A,PII B)
{
    if(A.fst-A.snd==B.fst-B.snd)
    {
        return A.fst>B.fst;
    }
    return A.fst-A.snd > B.fst-B.snd;
}
int main()
{
    int n,m,a;
    asd(n);
    FOR(i,1,n)
    {
        asd(a);
        A.PB(a);
        M[a]=1;
    }
    asd(m);
    FOR(i,1,m)
    {
        asd(a);
        B.PB(a);
        M[a]=1;
    }
    int K=0;
    foreach(it,M)
    {
        D.PB((*it).first);
        if(K==0)D.PB((*it).first-1);

        (*it).second = ++K;
        if(K==M.size())D.PB((*it).first+1);
        //cout << *it << endl;
    }
    SORT(D);
    int Mxe=0;
//    FOR(i,1,n)
//    {
//        A[i-1]=M[A[i-1]];
//        Mxe=max(Mxe,A[i-1]);
//    }
//    FOR(i,1,m)
//    {
//        B[i-1]=M[B[i-1]];
//        Mxe=max(Mxe,B[i-1]);
//    }
    vector<PII>V;
    for(int i=0;i<D.size();i++)
    {
        int d=D[i];
        int lba=lower_bound(all(A),d+1)-A.begin();
        int lbb=lower_bound(all(B),d+1)-B.begin();
        V.PB(MP( lba*2 + (n-lba)*3 , ( lbb*2 + (m-lbb)*3 ) ));
    }
    sort(all(V),comp);
    cout << V[0].first << ":" << V[0].snd << endl;

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
/***************************************************************************************************************************************/
typedef long long int LLI;
typedef unsigned long long int ULLI;
#define MP(X,Y)         make_pair(X,Y)
#define fill(a,v)       memset(a,v,sizeof(a))
#define DEBUG(x)        cout << #x << ": " << x << endl;
#define all(x)          (x).begin(),(x).end()
#define SORT(x)         sort(all(x))
#define VI              vector<int>
#define SI              set<int>
#define VS              vector<string>
#define PB              push_back
#define REV(a)          reverse(all(a))
#define BRPS(n,bit)     bitset<bit>(n)
#define LB(A, x)        (lower_bound(all(A), x) - A.begin())//exactly where it starts
#define UB(A, x)        (upper_bound(all(A), x) - A.begin())
#define UNQ(x)          SORT(x),(x).erase(unique(all(x)),x.end())
#define FOR(i,a,b)      for(int i=(int)(a);i<=(int)(b);i++)
#define foreach(e,x)    for(__typeof(x.begin()) e=x.begin();e!=x.end();++e)
#define DBG(v)          std::copy( v.begin(), v.end(), std::ostream_iterator < typeof( *v.begin() )> ( std::cout, " " ) )
#define INF             0x7FFFFFFF
#define INFL            0x7FFFFFFFFFFFFFFF

typedef pair<int, int>PII;
typedef pair<LLI, LLI>PLL;

template<class T> inline T BIGMOD(T n, T m, T mod)
{
    LLI ans = 1;
    LLI k = n;
    while(m)
    {
        if(m & 1)
        {
            ans *= k;
            if(ans>mod) ans %= mod;
        }
        k *= k;
        if(k>mod) k %= mod;
        m >>= 1;
    }
    return ans;
}
#define eps 1e-11
template<class T> string toString(T n)
{
    ostringstream ost;
    ost << n;
    ost.flush();
    return ost.str();
}
template<class T> string toBinary(T n)
{
    string ret="";
    while(n)
    {
        if(n%2==1)ret+='1';
        else ret+='0';
        n>>=1;
    }
    reverse(ret.begin(),ret.end());
    return ret;
}
void combination(int n,vector< vector<int> > &ret)
{
    ret.resize(n+1, vector<int>(n+1, 0));
    for(int i=1; i<=n; i++)
    {
        ret[i][0]=ret[i][i]=1;
        for(int j=1; j<i; j++)
        {
            ret[i][j]=ret[i-1][j]+ret[i-1][j-1];
        }
    }
}
int toInt(string s)
{
    int r = 0;
    istringstream sin(s);
    sin >> r;
    return r;
}
LLI toLInt(string s)
{
    LLI r = 0;
    istringstream sin(s);
    sin >> r;
    return r;
}
vector<string> parse(string temp)
{
    vector<string> ans;
    ans.clear();
    string s;
    istringstream iss(temp);
    while (iss >> s)ans.PB(s);
    return ans;
}
template<class T> inline T gcd(T a, T b)
{
    if (a < 0)return gcd(-a, b);
    if (b < 0)return gcd(a, -b);
    return (b == 0) ? a : gcd(b, a % b);
}
template<class T> inline T lcm(T a, T b)
{
    if (a < 0)return lcm(-a, b);
    if (b < 0)return lcm(a, -b);
    return a*(b / gcd(a, b));
}
template<class T> inline T power(T b, T p)
{
    if (p < 0)return -1;
    if (b <= 0)return -2;
    if (!p)return 1;
    return b*power(b, p - 1);
}

template<class T> inline int asd(T &ret)
{
    char r;
    bool start=false,neg=false;
    ret=0;
    bool isaNumber=false;
    while(true)
    {
        r=getchar();
        if(r==EOF)
        {
            return 0;
        }
        if((r-'0'<0 || r-'0'>9) && r!='-' && !start)
        {
            continue;
        }
        if((r-'0'<0 || r-'0'>9) && r!='-' && start)
        {
            break;
        }
        if(start)ret*=10;
        start=true;
        if(r=='-')neg=true;
        else ret+=r-'0';
    }
    if(neg)
        ret*=-1;
    return 1;
}

// Yet to Test
template<class T> inline int asd(T &ret1,T &ret2)
{
    asd(ret1);
    asd(ret2);
}
template<class T> inline int asd(T &ret1,T &ret2,T &ret3)
{
    asd(ret1,ret2);
    asd(ret3);
}
template<class T> inline int asd(T &ret1,T &ret2,T &ret3,T &ret4)
{
    asd(ret1,ret2);
    asd(ret3,ret4);
}

template<class T> inline void asdasd(T x,char y)
{
    // 0- print+newline, 1 - print ' ',2 - nothing;
    if (x < 0)
    {
        putchar('-');
        x = -x;
    }
    char buf[21], *p = buf;
    do
    {
        *p++ = '0' + x % 10;
        x /= 10;
    }
    while (x);
    do
    {
        putchar(*--p);
    }
    while (p > buf);
    if(y==0)putchar('\n');
    else if(y==1)putchar(' ');
}

/*vector IO*/
template < typename value_type >
istream & operator>> ( istream & in, vector < value_type > & a )
{
    typedef typename vector < value_type >::iterator iterator;
    if ( ! a.size( ) )
    {
        size_t n;
        asd(n);
        a.resize( n );
    }
    for ( iterator iter = a.begin(); iter != a.end(); ++ iter )
        asd(*iter);
    return in;
}

//vector1D OUT
template < typename value_type >
ostream & operator<< ( ostream & out, const vector <  value_type > & a )
{
    int sz=a.size();
    FOR(i,0,sz-1)asdasd(a[i],i!=sz);
    return out;
}

//vector2D OUT
template < typename value_type >
ostream & operator<< ( ostream & out, const vector < vector< value_type > > & a )
{
    int sza=a.size();
    int szb=a[0].size();
    FOR(i,0,sza-1)
    {
        FOR(j,0,szb-1)asdasd(a[i][j],j!=sza);
        puts("");
    }
    return out;
}
//set OUT
template < typename value_type >
ostream & operator<< ( ostream & out, const set <  value_type > & a )
{
    foreach(e,a)asdasd(*e,e!=a.end());
    return out;
}
//MAP OUT
template < typename key_type, typename value_type >
ostream & operator<< ( ostream & in, map < key_type, value_type > & a)
{
    foreach(e,a)
    {
        cout << (*e).first << " -> " << (*e).second << endl;
    }
    return in;
}
/*END OF STL IO*/
template < typename key_type, typename value_type >
istream & operator>> ( istream & in, pair < key_type, value_type > & p)
{
    in >> p.first >> p.second;
    return in;
}
template < typename key_type, typename value_type >
ostream & operator<< ( ostream & out, const pair < key_type, value_type > & p)
{
    out << "(" << p.first << ", " << p.second << ")";
    return out;
}
vector<int> inverseArray(int n, int m)
{
    vector<int> modI(n + 1,0);
    modI[1] = 1;
    for(int i = 2; i <= n; i++)
    {
        modI[i] = (-(m/i) * modI[m % i]) % m + m;
    }
    return modI;
}

pair<LLI, pair<LLI, LLI> > extendedEuclid(LLI a, LLI b)
{
    LLI x = 1, y = 0;
    LLI xLast = 0, yLast = 1;
    LLI q, r, m, n;
    while(a != 0)
    {
        q = b / a;
        r = b % a;
        m = xLast - q * x;
        n = yLast - q * y;
        xLast = x, yLast = y;
        x = m, y = n;
        b = a, a = r;
    }
    return make_pair(b, make_pair(xLast, yLast));
}

LLI modInverse(LLI a, LLI m)
{
    return (extendedEuclid(a,m).second.first + m) % m;
}

#define filein(x) freopen(x,"r",stdin)
#define fileout(x) freopen(x,"w",stdout)
#define fst first
#define snd second
//istringstream(temp) >> data >> value >> stamp;
//mod1 = 1000000007, mod2 = 1000000009;
//.016-.040-.900-2.48
/***************************************************************************************************************************************/

map<int,int>M;
VI A,B,D;

bool comp(PII A,PII B)
{
    if(A.fst-A.snd==B.fst-B.snd)
    {
        return A.fst>B.fst;
    }
    return A.fst-A.snd > B.fst-B.snd;
}
int main()
{
    int n,m,a;
    asd(n);
    FOR(i,1,n)
    {
        asd(a);
        A.PB(a);
        M[a]=1;
    }
    asd(m);
    FOR(i,1,m)
    {
        asd(a);
        B.PB(a);
        M[a]=1;
    }
    int K=0;
    foreach(it,M)
    {
        D.PB((*it).first);
        D.PB((*it).first-1);
        D.PB((*it).first+1);
    }
    SORT(D);
    UNQ(D);
    vector<PII>V;
    for(int i=0;i<D.size();i++)
    {
        int d=D[i];
        int lba=lower_bound(all(A),d+1)-A.begin();
        int lbb=lower_bound(all(B),d+1)-B.begin();
        V.PB(MP( lba*2 + (n-lba)*3 , ( lbb*2 + (m-lbb)*3 ) ));
    }
    sort(all(V),comp);
    cout << V[0].first << ":" << V[0].snd << endl;

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
/***************************************************************************************************************************************/
typedef long long int LLI;
typedef unsigned long long int ULLI;
#define MP(X,Y)         make_pair(X,Y)
#define fill(a,v)       memset(a,v,sizeof(a))
#define DEBUG(x)        cout << #x << ": " << x << endl;
#define all(x)          (x).begin(),(x).end()
#define SORT(x)         sort(all(x))
#define VI              vector<int>
#define SI              set<int>
#define VS              vector<string>
#define PB              push_back
#define REV(a)          reverse(all(a))
#define BRPS(n,bit)     bitset<bit>(n)
#define LB(A, x)        (lower_bound(all(A), x) - A.begin())//exactly where it starts
#define UB(A, x)        (upper_bound(all(A), x) - A.begin())
#define UNQ(x)          SORT(x),(x).erase(unique(all(x)),x.end())
#define FOR(i,a,b)      for(int i=(int)(a);i<=(int)(b);i++)
#define foreach(e,x)    for(__typeof(x.begin()) e=x.begin();e!=x.end();++e)
#define DBG(v)          std::copy( v.begin(), v.end(), std::ostream_iterator < typeof( *v.begin() )> ( std::cout, " " ) )
#define INF             0x7FFFFFFF
#define INFL            0x7FFFFFFFFFFFFFFF

typedef pair<int, int>PII;
typedef pair<LLI, LLI>PLL;

template<class T> inline T BIGMOD(T n, T m, T mod)
{
    LLI ans = 1;
    LLI k = n;
    while(m)
    {
        if(m & 1)
        {
            ans *= k;
            if(ans>mod) ans %= mod;
        }
        k *= k;
        if(k>mod) k %= mod;
        m >>= 1;
    }
    return ans;
}
#define eps 1e-11
template<class T> string toString(T n)
{
    ostringstream ost;
    ost << n;
    ost.flush();
    return ost.str();
}
template<class T> string toBinary(T n)
{
    string ret="";
    while(n)
    {
        if(n%2==1)ret+='1';
        else ret+='0';
        n>>=1;
    }
    reverse(ret.begin(),ret.end());
    return ret;
}
void combination(int n,vector< vector<int> > &ret)
{
    ret.resize(n+1, vector<int>(n+1, 0));
    for(int i=1; i<=n; i++)
    {
        ret[i][0]=ret[i][i]=1;
        for(int j=1; j<i; j++)
        {
            ret[i][j]=ret[i-1][j]+ret[i-1][j-1];
        }
    }
}
int toInt(string s)
{
    int r = 0;
    istringstream sin(s);
    sin >> r;
    return r;
}
LLI toLInt(string s)
{
    LLI r = 0;
    istringstream sin(s);
    sin >> r;
    return r;
}
vector<string> parse(string temp)
{
    vector<string> ans;
    ans.clear();
    string s;
    istringstream iss(temp);
    while (iss >> s)ans.PB(s);
    return ans;
}
template<class T> inline T gcd(T a, T b)
{
    if (a < 0)return gcd(-a, b);
    if (b < 0)return gcd(a, -b);
    return (b == 0) ? a : gcd(b, a % b);
}
template<class T> inline T lcm(T a, T b)
{
    if (a < 0)return lcm(-a, b);
    if (b < 0)return lcm(a, -b);
    return a*(b / gcd(a, b));
}
template<class T> inline T power(T b, T p)
{
    if (p < 0)return -1;
    if (b <= 0)return -2;
    if (!p)return 1;
    return b*power(b, p - 1);
}

template<class T> inline int asd(T &ret)
{
    char r;
    bool start=false,neg=false;
    ret=0;
    bool isaNumber=false;
    while(true)
    {
        r=getchar();
        if(r==EOF)
        {
            return 0;
        }
        if((r-'0'<0 || r-'0'>9) && r!='-' && !start)
        {
            continue;
        }
        if((r-'0'<0 || r-'0'>9) && r!='-' && start)
        {
            break;
        }
        if(start)ret*=10;
        start=true;
        if(r=='-')neg=true;
        else ret+=r-'0';
    }
    if(neg)
        ret*=-1;
    return 1;
}

// Yet to Test
template<class T> inline int asd(T &ret1,T &ret2)
{
    asd(ret1);
    asd(ret2);
}
template<class T> inline int asd(T &ret1,T &ret2,T &ret3)
{
    asd(ret1,ret2);
    asd(ret3);
}
template<class T> inline int asd(T &ret1,T &ret2,T &ret3,T &ret4)
{
    asd(ret1,ret2);
    asd(ret3,ret4);
}

template<class T> inline void asdasd(T x,char y)
{
    // 0- print+newline, 1 - print ' ',2 - nothing;
    if (x < 0)
    {
        putchar('-');
        x = -x;
    }
    char buf[21], *p = buf;
    do
    {
        *p++ = '0' + x % 10;
        x /= 10;
    }
    while (x);
    do
    {
        putchar(*--p);
    }
    while (p > buf);
    if(y==0)putchar('\n');
    else if(y==1)putchar(' ');
}

/*vector IO*/
template < typename value_type >
istream & operator>> ( istream & in, vector < value_type > & a )
{
    typedef typename vector < value_type >::iterator iterator;
    if ( ! a.size( ) )
    {
        size_t n;
        asd(n);
        a.resize( n );
    }
    for ( iterator iter = a.begin(); iter != a.end(); ++ iter )
        asd(*iter);
    return in;
}

//vector1D OUT
template < typename value_type >
ostream & operator<< ( ostream & out, const vector <  value_type > & a )
{
    int sz=a.size();
    FOR(i,0,sz-1)asdasd(a[i],i!=sz);
    return out;
}

//vector2D OUT
template < typename value_type >
ostream & operator<< ( ostream & out, const vector < vector< value_type > > & a )
{
    int sza=a.size();
    int szb=a[0].size();
    FOR(i,0,sza-1)
    {
        FOR(j,0,szb-1)asdasd(a[i][j],j!=sza);
        puts("");
    }
    return out;
}
//set OUT
template < typename value_type >
ostream & operator<< ( ostream & out, const set <  value_type > & a )
{
    foreach(e,a)asdasd(*e,e!=a.end());
    return out;
}
//MAP OUT
template < typename key_type, typename value_type >
ostream & operator<< ( ostream & in, map < key_type, value_type > & a)
{
    foreach(e,a)
    {
        cout << (*e).first << " -> " << (*e).second << endl;
    }
    return in;
}
/*END OF STL IO*/
template < typename key_type, typename value_type >
istream & operator>> ( istream & in, pair < key_type, value_type > & p)
{
    in >> p.first >> p.second;
    return in;
}
template < typename key_type, typename value_type >
ostream & operator<< ( ostream & out, const pair < key_type, value_type > & p)
{
    out << "(" << p.first << ", " << p.second << ")";
    return out;
}
vector<int> inverseArray(int n, int m)
{
    vector<int> modI(n + 1,0);
    modI[1] = 1;
    for(int i = 2; i <= n; i++)
    {
        modI[i] = (-(m/i) * modI[m % i]) % m + m;
    }
    return modI;
}

pair<LLI, pair<LLI, LLI> > extendedEuclid(LLI a, LLI b)
{
    LLI x = 1, y = 0;
    LLI xLast = 0, yLast = 1;
    LLI q, r, m, n;
    while(a != 0)
    {
        q = b / a;
        r = b % a;
        m = xLast - q * x;
        n = yLast - q * y;
        xLast = x, yLast = y;
        x = m, y = n;
        b = a, a = r;
    }
    return make_pair(b, make_pair(xLast, yLast));
}

LLI modInverse(LLI a, LLI m)
{
    return (extendedEuclid(a,m).second.first + m) % m;
}

#define filein(x) freopen(x,"r",stdin)
#define fileout(x) freopen(x,"w",stdout)
#define fst first
#define snd second
//istringstream(temp) >> data >> value >> stamp;
//mod1 = 1000000007, mod2 = 1000000009;
//.016-.040-.900-2.48
/***************************************************************************************************************************************/

map<int,int>M;
VI A,B,D;

bool comp(PII _A,PII _B)
{
    if(_A.fst-_A.snd==_B.fst-_B.snd)
    {
        return _A.fst>_B.fst;
    }
    return _A.fst-_A.snd > _B.fst-_B.snd;
}
int main()
{
    int n,m,a;
    asd(n);
    FOR(i,1,n)
    {
        asd(a);
        A.PB(a);
        M[a]=1;
    }
    asd(m);
    FOR(i,1,m)
    {
        asd(a);
        B.PB(a);
        M[a]=1;
    }
    int K=0;
    foreach(it,M)
    {
        D.PB((*it).first);
        D.PB((*it).first-1);
        D.PB((*it).first+1);
    }
    SORT(D);
    SORT(A);
    SORT(B);
    UNQ(D);
    vector<PII>V;
    for(int i=0;i<D.size();i++)
    {
        int d=D[i];
        int lba=upper_bound(all(A),d)-A.begin();
        int lbb=upper_bound(all(B),d)-B.begin();
        V.PB(MP( lba*2 + (n-lba)*3 , ( lbb*2 + (m-lbb)*3 ) ));
    }
    sort(all(V),comp);
    cout << V[0].first << ":" << V[0].snd << endl;

    return 0;
}


#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <unordered_set>
#include <unordered_map>
#include <map>
#include <fstream>
#include <cstring>

using namespace std;

typedef long long ll;

#define MAXN 1000001
#define MODN 1000000007

int fN, sN;
ll fT[MAXN], sT[MAXN];
ll fS, sS;
ll maxA = -MAXN * 3, minB = MAXN * 3;

int main()
{
    ios_base::sync_with_stdio(false);
    cin >> fN;
    for(int i = 0; i < fN; i++)
    {
        cin >> fT[i];
    }
    sort(fT, fT + fN);

    cin >> sN;
    for(int i = 0; i < sN; i++)
    {
        cin >> sT[i];
    }
    sort(sT, sT + sN);

    int sPos = 0;
    for(int i = 0; i <= fN + 1; i++)
    {
        if(i == 0)
        {
            fS = fN * 3;
            while(sPos < sN && sT[sPos] <= fT[0] - 1)
            {
                sPos++;
            }
            sS = sPos * 2 + (sN - sPos) * 3;
        }
        else if(i == fN + 1)
        {
            fS = fN * 2;
            sS = sN * 2;
        }
        else
        {
            fS = i * 2 + (fN - i) * 3;
            while(sPos < sN && sT[sPos] <= fT[i - 1])
            {
                sPos++;
            }
            sS = sPos * 2 + (sN - sPos) * 3;
        }

        if(fS - sS > (maxA - minB))
        {
            maxA = fS;
            minB = sS;
        }
        else if(fS - sS == maxA - minB)
        {
            if(fS < maxA)
            {
                maxA = fS;
                minB = sS;
            }
        }
    }

    cout << maxA << ":" << minB << endl;

    return 0;
}


#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <unordered_set>
#include <unordered_map>
#include <map>
#include <fstream>
#include <cstring>

using namespace std;

typedef long long ll;

#define MAXN 1000001
#define MODN 1000000007

int fN, sN;
ll fT[MAXN], sT[MAXN];
ll fS, sS;
ll maxA = -MAXN * 3, minB = MAXN * 3;

int main()
{
    ios_base::sync_with_stdio(false);
    cin >> fN;
    for(int i = 0; i < fN; i++)
    {
        cin >> fT[i];
    }
    sort(fT, fT + fN);

    cin >> sN;
    for(int i = 0; i < sN; i++)
    {
        cin >> sT[i];
    }
    sort(sT, sT + sN);

    int sPos = 0;
    for(int i = 0; i <= fN + 1; i++)
    {
        if(i == 0)
        {
            fS = fN * 3;
            while(sPos < sN && sT[sPos] <= fT[0] - 1)
            {
                sPos++;
            }
            sS = sPos * 2 + (sN - sPos) * 3;
        }
        else if(i == fN + 1)
        {
            fS = fN * 2;
            sS = sN * 2;
        }
        else
        {
	    	while(i + 1 <= fN && fT[i] == fT[i - 1])
	    	{
	    		i++;
	    	}
            fS = i * 2 + (fN - i) * 3;
            while(sPos < sN && sT[sPos] <= fT[i - 1])
            {
                sPos++;
            }
            sS = sPos * 2 + (sN - sPos) * 3;
        }

        if(fS - sS > (maxA - minB))
        {
            maxA = fS;
            minB = sS;
        }
        else if(fS - sS == maxA - minB)
        {
            if(fS > maxA)
            {
                maxA = fS;
                minB = sS;
            }
        }
    }

    cout << maxA << ":" << minB << endl;

    return 0;
}


#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <unordered_set>
#include <unordered_map>
#include <map>
#include <fstream>
#include <cstring>

using namespace std;

typedef long long ll;

#define MAXN 1000001
#define MODN 1000000007

int fN, sN;
ll fT[MAXN], sT[MAXN];
ll fS, sS;
ll maxA = -MAXN * 3, minB = MAXN * 3;

int main()
{
    ios_base::sync_with_stdio(false);
    cin >> fN;
    for(int i = 0; i < fN; i++)
    {
        cin >> fT[i];
    }
    sort(fT, fT + fN);

    cin >> sN;
    for(int i = 0; i < sN; i++)
    {
        cin >> sT[i];
    }
    sort(sT, sT + sN);

    int sPos = 0;
    for(int i = 0; i <= fN; i++)
    {

        if(i == fN)
        {
            fS = fN * 2;
            sS = sN * 2;
        }
        else
        {
            fS = i * 2 + (fN - i) * 3;
            while(sPos < sN && sT[sPos] < fT[i])
            {
                sPos++;
            }
            sS = sPos * 2 + (sN - sPos) * 3;

	    	while(i + 1 < fN && fT[i + 1] == fT[i])
	    	{
	    		i++;
	    	}
        }

        if(fS - sS > (maxA - minB))
        {
            maxA = fS;
            minB = sS;
        }
        else if(fS - sS == maxA - minB)
        {
            if(fS > maxA)
            {
                maxA = fS;
                minB = sS;
            }
        }
    }

    cout << maxA << ":" << minB << endl;

    return 0;
}


#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <unordered_set>
#include <unordered_map>
#include <map>
#include <fstream>
#include <cstring>

using namespace std;

typedef long long ll;

#define MAXN 1000001
#define MODN 1000000007

int fN, sN;
ll fT[MAXN], sT[MAXN];
ll fS, sS;
ll maxA = -MAXN * 3, minB = MAXN * 3;

int main()
{
    ios_base::sync_with_stdio(false);
    cin >> fN;
    for(int i = 0; i < fN; i++)
    {
        cin >> fT[i];
    }
    sort(fT, fT + fN);

    cin >> sN;
    for(int i = 0; i < sN; i++)
    {
        cin >> sT[i];
    }
    sort(sT, sT + sN);

    int sPos = 0;
    for(int i = 0; i <= fN + 1; i++)
    {
        if(i == 0)
        {
            fS = fN * 3;
            while(sPos < sN && sT[sPos] <= fT[0] - 1)
            {
                sPos++;
            }
            sS = sPos * 2 + (sN - sPos) * 3;
        }
        else if(i == fN + 1)
        {
            fS = fN * 2;
            sS = sN * 2;
        }
        else
        {
            fS = i * 2 + (fN - i) * 3;
            while(sPos < sN && sT[sPos] <= fT[i - 1])
            {
                sPos++;
            }
            sS = sPos * 2 + (sN - sPos) * 3;
        }

        if(fS - sS > (maxA - minB))
        {
            maxA = fS;
            minB = sS;
        }
        else if(fS - sS == maxA - minB)
        {
            if(fS > maxA)
            {
                maxA = fS;
                minB = sS;
            }
        }
    }

    cout << maxA << ":" << minB << endl;

    return 0;
}


#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <unordered_set>
#include <unordered_map>
#include <map>
#include <fstream>
#include <cstring>

using namespace std;

typedef long long ll;

#define MAXN 1000001
#define MODN 1000000007

int fN, sN;
ll fT[MAXN], sT[MAXN];
ll fS, sS;
ll maxA, minB;

int main()
{
    ios_base::sync_with_stdio(false);
    cin >> fN;
    for(int i = 0; i < fN; i++)
    {
        cin >> fT[i];
    }
    sort(fT, fT + fN);

    cin >> sN;
    for(int i = 0; i < sN; i++)
    {
        cin >> sT[i];
    }
    sort(sT, sT + sN);

    int sPos = 0;
    for(int i = 0; i <= fN; i++)
    {
        if(i == fN)
        {
            fS = fN * 2;
            sS = sN * 2;
        }
        else
        {
            fS = i * 2 + (fN - i) * 3;
            while(sPos < sN && sT[sPos] < fT[i])
            {
                sPos++;
            }
            sS = sPos * 2 + (sN - sPos) * 3;

        }

        if(fS - sS > (maxA - minB))
        {
            maxA = fS;
            minB = sS;
        }
        else if(fS - sS == maxA - minB)
        {
            if(fS < maxA)
            {
                maxA = fS;
                minB = sS;
            }
        }
    }

    cout << maxA << ":" << minB << endl;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll n,x,m,i;
pair<ll,ll> p[400007];
main()
{  // freopen("1.inp","r",stdin);
    //freopen("1.out","w",stdout);
    cin>>n;
    for (i=0;i<n;i++)
        cin>>x,p[i]=make_pair(x,1);
    cin>>m;
    for (i=0;i<m;i++)
        cin>>x,p[i+n]=make_pair(x,2);
        sort(p,p+n+m);
    ll s1=3*n,s2=3*m;
    ll res1=s1,res2=s2,dif=s1-s2;
    for (i=0;i<n+m;i++)
        if (p[i].second==1)
        {
            s1--;
        }
        else
            {s2--;
                if (dif<s1-s2)
            {
                res1=s1;
                res2=s2;
                dif=s1-s2;
            }}
        cout<<res1<<":"<<res2;
        }


#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll n,x,m,i;
pair<ll,ll> p[400007];
main()
{  // freopen("1.inp","r",stdin);
    //freopen("1.out","w",stdout);
    cin>>n;
    for (i=0;i<n;i++)
        cin>>x,p[i]=make_pair(x,1);
    cin>>m;
    for (i=0;i<m;i++)
        cin>>x,p[i+n]=make_pair(x,2);
        sort(p,p+n+m);
    ll s1=3*n,s2=3*m;
    ll res1=s1,res2=s2,dif=s1-s2;
    for (i=0;i<n+m;i++)
        if (p[i].second==1)
        {
            s1--;
        }
        else
            {s2--;
                if (dif<s1-s2)
            {
                res1=s1;
                res2=s2;
                dif=s1-s2;
            }}
        cout<<res1<<":"<<res2;


#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <map>
using namespace std;

vector<long long> a,b;
int main() {
    ios::sync_with_stdio(0);
    int n,m;
    cin>>n;
    long long tmp;
    for(int i=0;i<n;i++) {
        cin>>tmp;
        a.push_back(tmp);
    }
    cin>>m;
    for(int i=0;i<m;i++) {
        cin>>tmp;
        b.push_back(tmp);
    }
    long long d;
    sort(a.begin(),a.end());
    sort(b.begin(),b.end());
    long long low = 0,high = max(a[n-1],b[m-1])+1;
    long long sa = -1000000000000000,sb=-1;
    long long saa,sbb,saaa,sbbb;
    int idx;
    while(low<high-1){
    //    cout << low << " " << high << endl;
        long long mid = (low+high)>>1;
        idx = upper_bound(a.begin(),a.end(),low)-a.begin();
        saa = 2*(idx)+3*(n-idx);
        idx = upper_bound(b.begin(),b.end(),low)-b.begin();
        sbb = 2*(idx)+3*(m-idx);
    //    cout << saa << " " << sbb << " " << low << endl;
        if (saa-sbb>sa-sb){
            sa = saa;
            sb = sbb;
        }
        else if (saa-sbb==sa-sb && saa>sa){
            sa = saa;
            sb = sbb;
        }
        idx = upper_bound(a.begin(),a.end(),high)-a.begin();
        saaa = 2*(idx)+3*(n-idx);
        idx = upper_bound(b.begin(),b.end(),high)-b.begin();
        sbbb = 2*(idx)+3*(m-idx);
        if (saaa-sbbb>sa-sb){
            sa = saaa;
            sb = sbbb;
        }
        else if (saaa-sbbb==sa-sb && saaa>sa){
            sa = saaa;
            sb = sbbb;
        }
        if (saaa-sbbb>saa-sbb) low = mid;
        else if (saaa-sbbb<saa-sbb) high = mid;
        else if (saaa>saa) low = mid;
        else if (saaa<saa) high = mid;
      //      else low++;

    }
    idx = upper_bound(a.begin(),a.end(),low)-a.begin();
  //  cout << idx << endl;
        saa = 2*(idx)+3*(n-idx);
        idx = upper_bound(b.begin(),b.end(),low)-b.begin();
  //  cout << idx << endl;
        sbb = 2*(idx)+3*(m-idx);
        if (saa-sbb>sa-sb){
            sa = saa;
            sb = sbb;
        }
        else if (saa-sbb==sa-sb && saa>sa){
            sa = saa;
            sb = sbb;
        }
  //  cout << saa << " " << sbb << endl;
        idx = upper_bound(a.begin(),a.end(),high)-a.begin();
        saaa = 2*(idx)+3*(n-idx);
        idx = upper_bound(b.begin(),b.end(),high)-b.begin();
        sbbb = 2*(idx)+3*(m-idx);
        if (saaa-sbbb>sa-sb){
            sa = saaa;
            sb = sbbb;
        }
        else if (saaa-sbbb==sa-sb && saaa>sa){
            sa = saaa;
            sb = sbbb;
        }
    cout << sa << ":" << sb << endl;

    return 0;
}


#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <map>
using namespace std;

vector<long long> a,b;
int main() {
    ios::sync_with_stdio(0);
    int n,m;
    cin>>n;
    long long tmp;
    for(int i=0;i<n;i++) {
        cin>>tmp;
        a.push_back(tmp);
    }
    cin>>m;
    for(int i=0;i<m;i++) {
        cin>>tmp;
        b.push_back(tmp);
    }
    long long d;
    sort(a.begin(),a.end());
    sort(b.begin(),b.end());
    long long low = min(a[0],b[0]),high = max(a[n-1],b[m-1])+1;
    long long sa = -1000000000000000,sb=-1;
    long long saa,sbb,saaa,sbbb;
    int idx;
    while(low<high-1){
    //    cout << low << " " << high << endl;
        long long mid = (low+high)>>1;
        idx = upper_bound(a.begin(),a.end(),low)-a.begin();
        saa = 2*(idx)+3*(n-idx);
        idx = upper_bound(b.begin(),b.end(),low)-b.begin();
        sbb = 2*(idx)+3*(m-idx);
    //    cout << saa << " " << sbb << " " << low << endl;
        if (saa-sbb>sa-sb){
            sa = saa;
            sb = sbb;
        }
        else if (saa-sbb==sa-sb && saa>sa){
            sa = saa;
            sb = sbb;
        }
        idx = upper_bound(a.begin(),a.end(),high)-a.begin();
        saaa = 2*(idx)+3*(n-idx);
        idx = upper_bound(b.begin(),b.end(),high)-b.begin();
        sbbb = 2*(idx)+3*(m-idx);
        if (saaa-sbbb>sa-sb){
            sa = saaa;
            sb = sbbb;
        }
        else if (saaa-sbbb==sa-sb && saaa>sa){
            sa = saaa;
            sb = sbbb;
        }
        if (saaa-sbbb>saa-sbb) low = mid;
        else if (saaa-sbbb<saa-sbb) high = mid;
        else if (saaa>saa) low = mid;
        else if (saaa<saa) high = mid;
      //      else low++;

    }
    idx = upper_bound(a.begin(),a.end(),low)-a.begin();
  //  cout << idx << endl;
        saa = 2*(idx)+3*(n-idx);
        idx = upper_bound(b.begin(),b.end(),low)-b.begin();
  //  cout << idx << endl;
        sbb = 2*(idx)+3*(m-idx);
        if (saa-sbb>sa-sb){
            sa = saa;
            sb = sbb;
        }
        else if (saa-sbb==sa-sb && saa>sa){
            sa = saa;
            sb = sbb;
        }
  //  cout << saa << " " << sbb << endl;
        idx = upper_bound(a.begin(),a.end(),high)-a.begin();
        saaa = 2*(idx)+3*(n-idx);
        idx = upper_bound(b.begin(),b.end(),high)-b.begin();
        sbbb = 2*(idx)+3*(m-idx);
        if (saaa-sbbb>sa-sb){
            sa = saaa;
            sb = sbbb;
        }
        else if (saaa-sbbb==sa-sb && saaa>sa){
            sa = saaa;
            sb = sbbb;
        }
    cout << sa << ":" << sb << endl;

    return 0;
}


#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <map>
using namespace std;

vector<long long> a,b;
int main() {
    ios::sync_with_stdio(0);
    int n,m;
    cin>>n;
    long long tmp;
    for(int i=0;i<n;i++) {
        cin>>tmp;
        a.push_back(tmp);
    }
    cin>>m;
    for(int i=0;i<m;i++) {
        cin>>tmp;
        b.push_back(tmp);
    }
    long long d;
    sort(a.begin(),a.end());
    sort(b.begin(),b.end());
    long long low = min(a[0],b[0]);,high = max(a[n-1],b[m-1])+1;
    long long sa = -1000000000000000,sb=-1;
    long long saa,sbb,saaa,sbbb;
    int idx;
    while(low<high-1){
    //    cout << low << " " << high << endl;
        long long mid = (low+high)>>1;
        idx = upper_bound(a.begin(),a.end(),low)-a.begin();
        saa = 2*(idx)+3*(n-idx);
        idx = upper_bound(b.begin(),b.end(),low)-b.begin();
        sbb = 2*(idx)+3*(m-idx);
    //    cout << saa << " " << sbb << " " << low << endl;
        if (saa-sbb>sa-sb){
            sa = saa;
            sb = sbb;
        }
        else if (saa-sbb==sa-sb && saa>sa){
            sa = saa;
            sb = sbb;
        }
        idx = upper_bound(a.begin(),a.end(),high)-a.begin();
        saaa = 2*(idx)+3*(n-idx);
        idx = upper_bound(b.begin(),b.end(),high)-b.begin();
        sbbb = 2*(idx)+3*(m-idx);
        if (saaa-sbbb>sa-sb){
            sa = saaa;
            sb = sbbb;
        }
        else if (saaa-sbbb==sa-sb && saaa>sa){
            sa = saaa;
            sb = sbbb;
        }
        if (saaa-sbbb>saa-sbb) low = mid;
        else if (saaa-sbbb<saa-sbb) high = mid;
        else if (saaa>saa) low = mid;
        else if (saaa<saa) high = mid;
      //      else low++;

    }
    idx = upper_bound(a.begin(),a.end(),low)-a.begin();
  //  cout << idx << endl;
        saa = 2*(idx)+3*(n-idx);
        idx = upper_bound(b.begin(),b.end(),low)-b.begin();
  //  cout << idx << endl;
        sbb = 2*(idx)+3*(m-idx);
        if (saa-sbb>sa-sb){
            sa = saa;
            sb = sbb;
        }
        else if (saa-sbb==sa-sb && saa>sa){
            sa = saa;
            sb = sbb;
        }
  //  cout << saa << " " << sbb << endl;
        idx = upper_bound(a.begin(),a.end(),high)-a.begin();
        saaa = 2*(idx)+3*(n-idx);
        idx = upper_bound(b.begin(),b.end(),high)-b.begin();
        sbbb = 2*(idx)+3*(m-idx);
        if (saaa-sbbb>sa-sb){
            sa = saaa;
            sb = sbbb;
        }
        else if (saaa-sbbb==sa-sb && saaa>sa){
            sa = saaa;
            sb = sbbb;
        }
    cout << sa << ":" << sb << endl;

    return 0;
}


#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <map>
using namespace std;

vector<long long> a,b;
int main() {
    ios::sync_with_stdio(0);
    int n,m;
    cin>>n;
    long long tmp;
    for(int i=0;i<n;i++) {
        cin>>tmp;
        a.push_back(tmp);
    }
    cin>>m;
    for(int i=0;i<m;i++) {
        cin>>tmp;
        b.push_back(tmp);
    }
    long long d;
    sort(a.begin(),a.end());
    sort(b.begin(),b.end());
    long long low = 0,high = 2000000000;
    long long sa = -1000000000000000,sb=-1;
    long long saa,sbb,saaa,sbbb;
    int idx;
    while(low<high-1){
    //    cout << low << " " << high << endl;
        long long mid = (low+high)>>1;
        idx = upper_bound(a.begin(),a.end(),low)-a.begin();
        saa = 2*(idx)+3*(n-idx);
        idx = upper_bound(b.begin(),b.end(),low)-b.begin();
        sbb = 2*(idx)+3*(m-idx);
    //    cout << saa << " " << sbb << " " << low << endl;
        if (saa-sbb>sa-sb){
            sa = saa;
            sb = sbb;
        }
        else if (saa-sbb==sa-sb && saa>sa){
            sa = saa;
            sb = sbb;
        }
        idx = upper_bound(a.begin(),a.end(),high)-a.begin();
        saaa = 2*(idx)+3*(n-idx);
        idx = upper_bound(b.begin(),b.end(),high)-b.begin();
        sbbb = 2*(idx)+3*(m-idx);
        if (saaa-sbbb>sa-sb){
            sa = saaa;
            sb = sbbb;
        }
        else if (saaa-sbbb==sa-sb && saaa>sa){
            sa = saaa;
            sb = sbbb;
        }
        if (saaa-sbbb>saa-sbb) low = mid;
        else if (saaa-sbbb<saa-sbb) high = mid;
        else if (saaa>=saa) low = mid;
        else if (saaa<saa) high = mid;

    }
    idx = upper_bound(a.begin(),a.end(),low)-a.begin();
  //  cout << idx << endl;
        saa = 2*(idx)+3*(n-idx);
        idx = upper_bound(b.begin(),b.end(),low)-b.begin();
  //  cout << idx << endl;
        sbb = 2*(idx)+3*(m-idx);
        if (saa-sbb>sa-sb){
            sa = saa;
            sb = sbb;
        }
        else if (saa-sbb==sa-sb && saa>sa){
            sa = saa;
            sb = sbb;
        }
  //  cout << saa << " " << sbb << endl;
        idx = upper_bound(a.begin(),a.end(),high)-a.begin();
        saaa = 2*(idx)+3*(n-idx);
        idx = upper_bound(b.begin(),b.end(),high)-b.begin();
        sbbb = 2*(idx)+3*(m-idx);
        if (saaa-sbbb>sa-sb){
            sa = saaa;
            sb = sbbb;
        }
        else if (saaa-sbbb==sa-sb && saaa>sa){
            sa = saaa;
            sb = sbbb;
        }
    cout << sa << ":" << sb << endl;

    return 0;
}


#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <map>
using namespace std;

vector<long long> a,b;
int main() {
    ios::sync_with_stdio(0);
    int n,m;
    cin>>n;
    long long tmp;
    for(int i=0;i<n;i++) {
        cin>>tmp;
        a.push_back(tmp);
    }
    cin>>m;
    for(int i=0;i<m;i++) {
        cin>>tmp;
        b.push_back(tmp);
    }
    long long d;
    sort(a.begin(),a.end());
    sort(b.begin(),b.end());
    long long low = min(a[0],b[0])-1,high = max(a[n-1],b[m-1])+1;
    if (low<0) low=0;
    long long sa = -1000000000000000,sb=-1;
    long long saa,sbb,saaa,sbbb;
    int idx;
    while(low<high-1){
    //    cout << low << " " << high << endl;
        long long mid = (low+high)>>1;
        idx = upper_bound(a.begin(),a.end(),low)-a.begin();
        saa = 2*(idx)+3*(n-idx);
        idx = upper_bound(b.begin(),b.end(),low)-b.begin();
        sbb = 2*(idx)+3*(m-idx);
    //    cout << saa << " " << sbb << " " << low << endl;
        if (saa-sbb>sa-sb){
            sa = saa;
            sb = sbb;
        }
        else if (saa-sbb==sa-sb && saa>sa){
            sa = saa;
            sb = sbb;
        }
        idx = upper_bound(a.begin(),a.end(),high)-a.begin();
        saaa = 2*(idx)+3*(n-idx);
        idx = upper_bound(b.begin(),b.end(),high)-b.begin();
        sbbb = 2*(idx)+3*(m-idx);
        if (saaa-sbbb>sa-sb){
            sa = saaa;
            sb = sbbb;
        }
        else if (saaa-sbbb==sa-sb && saaa>sa){
            sa = saaa;
            sb = sbbb;
        }
        if (saaa-sbbb>saa-sbb) low = mid;
        else if (saaa-sbbb<saa-sbb) high = mid;
        else if (saaa>saa) low = mid;
        else if (saaa<saa) high = mid;
      //      else low++;

    }
    idx = upper_bound(a.begin(),a.end(),low)-a.begin();
  //  cout << idx << endl;
        saa = 2*(idx)+3*(n-idx);
        idx = upper_bound(b.begin(),b.end(),low)-b.begin();
  //  cout << idx << endl;
        sbb = 2*(idx)+3*(m-idx);
        if (saa-sbb>sa-sb){
            sa = saa;
            sb = sbb;
        }
        else if (saa-sbb==sa-sb && saa>sa){
            sa = saa;
            sb = sbb;
        }
  //  cout << saa << " " << sbb << endl;
        idx = upper_bound(a.begin(),a.end(),high)-a.begin();
        saaa = 2*(idx)+3*(n-idx);
        idx = upper_bound(b.begin(),b.end(),high)-b.begin();
        sbbb = 2*(idx)+3*(m-idx);
        if (saaa-sbbb>sa-sb){
            sa = saaa;
            sb = sbbb;
        }
        else if (saaa-sbbb==sa-sb && saaa>sa){
            sa = saaa;
            sb = sbbb;
        }
    cout << sa << ":" << sb << endl;

    return 0;
}


#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <map>
using namespace std;

vector<long long> a,b;
int main() {
    ios::sync_with_stdio(0);
    int n,m;
    cin>>n;
    long long tmp;
    for(int i=0;i<n;i++) {
        cin>>tmp;
        a.push_back(tmp);
    }
    cin>>m;
    for(int i=0;i<m;i++) {
        cin>>tmp;
        b.push_back(tmp);
    }
    long long d;
    sort(a.begin(),a.end());
    sort(b.begin(),b.end());
    long long low = 0,high = 2000000000;
    long long sa = -1,sb=-1;
    long long saa,sbb,saaa,sbbb;
    int idx;
    while(low<high-1){
        //cout << low << " " << high << endl;
        long long mid = (low+high)>>1;
        idx = upper_bound(a.begin(),a.end(),low)-a.begin();
        saa = 2*(idx)+3*(n-idx);
        idx = upper_bound(b.begin(),b.end(),low)-b.begin();
        sbb = 2*(idx)+3*(m-idx);
        if (saa-sbb>sa-sb){
            sa = saa;
            sb = sbb;
        }
        else if (saa-sbb==sa-sb && saa>sa){
            sa = saa;
            sb = sbb;
        }
        idx = upper_bound(a.begin(),a.end(),high)-a.begin();
        saaa = 2*(idx)+3*(n-idx);
        idx = upper_bound(b.begin(),b.end(),high)-b.begin();
        sbbb = 2*(idx)+3*(m-idx);
        if (saaa-sbbb>sa-sb){
            sa = saaa;
            sb = sbbb;
        }
        else if (saaa-sbbb==sa-sb && saaa>sa){
            sa = saaa;
            sb = sbbb;
        }
        if (saaa-sbbb>saa-sbb) low = mid;
        else if (saaa-sbbb<saa-sbb) high = mid;
        else if (saaa>saa) low = mid;
        else if (saaa<saa) high = mid;
    }
    idx = upper_bound(a.begin(),a.end(),low)-a.begin();
  //  cout << idx << endl;
        saa = 2*(idx)+3*(n-idx);
        idx = upper_bound(b.begin(),b.end(),low)-b.begin();
  //  cout << idx << endl;
        sbb = 2*(idx)+3*(m-idx);
        if (saa-sbb>sa-sb){
            sa = saa;
            sb = sbb;
        }
        else if (saa-sbb==sa-sb && saa>sa){
            sa = saa;
            sb = sbb;
        }
  //  cout << saa << " " << sbb << endl;
        idx = upper_bound(a.begin(),a.end(),high)-a.begin();
        saaa = 2*(idx)+3*(n-idx);
        idx = upper_bound(b.begin(),b.end(),high)-b.begin();
        sbbb = 2*(idx)+3*(m-idx);
        if (saaa-sbbb>sa-sb){
            sa = saaa;
            sb = sbbb;
        }
        else if (saaa-sbbb==sa-sb && saaa>sa){
            sa = saaa;
            sb = sbbb;
        }
    cout << sa << ":" << sb << endl;

    return 0;
}


#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <map>
#include <set>
using namespace std;

vector<long long> a,b;
int main() {
    ios::sync_with_stdio(0);
    int n,m;
    cin>>n;
    long long tmp;
    set<long long> ss;
    for(int i=0;i<n;i++) {
        cin>>tmp;
        a.push_back(tmp);
        ss.insert(tmp);
    }
    cin>>m;
    for(int i=0;i<m;i++) {
        cin>>tmp;
        b.push_back(tmp);
        ss.insert(tmp);
    }
    long long d;
    sort(a.begin(),a.end());
    sort(b.begin(),b.end());

    long long low = min(a[0],b[0])-1;
    if (low<0) low=0;
    long long sa = -1000000000000000,sb=-1;
    long long saa,sbb,saaa,sbbb;
    int idx;
    auto id = ss.begin();
    while(id!=ss.end()){
        low = *id-1;

        idx = upper_bound(a.begin(),a.end(),low)-a.begin();
        saa = 2*(idx)+3*(n-idx);
        idx = upper_bound(b.begin(),b.end(),low)-b.begin();
        sbb = 2*(idx)+3*(m-idx);
        if (saa-sbb>sa-sb){
            sa = saa;
            sb = sbb;
        }
        else if (saa-sbb==sa-sb && saa>sa){
            sa = saa;
            sb = sbb;
        }
        low = *id;
        idx = upper_bound(a.begin(),a.end(),low)-a.begin();
        saa = 2*(idx)+3*(n-idx);
        idx = upper_bound(b.begin(),b.end(),low)-b.begin();
        sbb = 2*(idx)+3*(m-idx);
        if (saa-sbb>sa-sb){
            sa = saa;
            sb = sbb;
        }
        else if (saa-sbb==sa-sb && saa>sa){
            sa = saa;
            sb = sbb;
        }
        low = *id+1;
        idx = upper_bound(a.begin(),a.end(),low)-a.begin();
        saa = 2*(idx)+3*(n-idx);
        idx = upper_bound(b.begin(),b.end(),low)-b.begin();
        sbb = 2*(idx)+3*(m-idx);
        if (saa-sbb>sa-sb){
            sa = saa;
            sb = sbb;
        }
        else if (saa-sbb==sa-sb && saa>sa){
            sa = saa;
            sb = sbb;
        }
        id++;
    }

    cout << sa << ":" << sb << endl;

    return 0;
}


#include <vector>
#include <list>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <limits>
#include <tuple>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <string>

using namespace std;

int main(){
	int n;
	cin >> n;
	vector<int> A, B;
	for(int i=0; i<n; i++){
		int x;
		cin >> x;
		A.push_back(x);
	}
	int m;
	cin >> m;
	for(int i=0; i<m; i++){
		int x;
		cin >> x;
		B.push_back(x);
	}
	sort(A.begin(), A.end(), greater<int>());
	sort(B.begin(), B.end(), greater<int>());
	int nb=0;
	int max_na=0;
	int max_nb=0;

	int max_dist=-1;
	for(int na=0; na<A.size(); na++){
		while(nb < B.size() && B[nb] > A[na]){
			nb++;
		}
		int dist=na-nb;
		if(dist >= max_dist){
			max_dist = dist;
			max_na = na;
			max_nb = nb;
		}
	}
	int na=max_na+1;
	nb=max_nb;
	int score_a = na*3+(n-na)*2;
	int score_b = nb*3+(m-nb)*2;
	cout << score_a <<":"<<score_b<<endl;
	return 0;
}


#include <vector>
#include <list>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <limits>
#include <tuple>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <string>

using namespace std;

int main(){
	int n;
	cin >> n;
	vector<int> A, B;
	for(int i=0; i<n; i++){
		int x;
		cin >> x;
		A.push_back(x);
	}
	int m;
	cin >> m;
	for(int i=0; i<m; i++){
		int x;
		cin >> x;
		B.push_back(x);
	}
	sort(A.begin(), A.end(), greater<int>());
	sort(B.begin(), B.end(), greater<int>());
	int nb=0;
	int max_na=0;
	int max_nb=0;

	int max_dist=-1;
	for(int na=1; na<=A.size(); na++){
		while(nb < B.size() && B[nb] >= A[na-1]){
			nb++;
		}
		int dist=na-nb;
		if(dist >= max_dist){
			max_dist = dist;
			max_na = na;
			max_nb = nb;
		}
	}
	int na=0;
	for(nb=0; nb<B.size(); nb++){
		while(na < A.size() && A[na] > B[nb]){
			na++;
		}
		int dist=na-nb;
		if(dist > max_dist ||  (dist == max_dist && na > max_na)){
			max_dist = dist;
			max_na = na;
			max_nb = nb;
		}
	}
	na=max_na;
	nb=max_nb;
	int score_a = na*3+(n-na)*2;
	int score_b = nb*3+(m-nb)*2;
	cout << score_a <<":"<<score_b<<endl;
	return 0;
}


#include <vector>
#include <list>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <limits>
#include <tuple>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <string>

using namespace std;

int main(){
	int n;
	cin >> n;
	vector<int> A, B;
	for(int i=0; i<n; i++){
		int x;
		cin >> x;
		A.push_back(x);
	}
	int m;
	cin >> m;
	for(int i=0; i<m; i++){
		int x;
		cin >> x;
		B.push_back(x);
	}
	sort(A.begin(), A.end(), greater<int>());
	sort(B.begin(), B.end(), greater<int>());
	int nb=0;
	int max_na=0;
	int max_nb=0;

	int max_dist=-1;
	for(int na=0; na<A.size(); na++){
		while(nb < B.size() && B[nb] >= A[na]){
			nb++;
		}
		int dist=na-nb;
		if(dist >= max_dist){
			max_dist = dist;
			max_na = na;
			max_nb = nb;
		}
	}
	int na=max_na+1;
	nb=max_nb;
	int score_a = na*3+(n-na)*2;
	int score_b = nb*3+(m-nb)*2;
	cout << score_a <<":"<<score_b<<endl;
	return 0;
}


#include <vector>
#include <list>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <limits>
#include <tuple>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <string>

using namespace std;

int main(){
	int n;
	cin >> n;
	vector<int> A, B;
	for(int i=0; i<n; i++){
		int x;
		cin >> x;
		A.push_back(x);
	}
	int m;
	cin >> m;
	for(int i=0; i<m; i++){
		int x;
		cin >> x;
		B.push_back(x);
	}
	sort(A.begin(), A.end(), greater<int>());
	sort(B.begin(), B.end(), greater<int>());
	int nb=0;
	int max_na=0;
	int max_nb=0;

	int max_dist=-1;
	for(int na=1; na<=A.size(); na++){
		while(nb < B.size() && B[nb] >= A[na-1]){
			nb++;
		}
		int dist=na-nb;
		if(dist >= max_dist){
			max_dist = dist;
			max_na = na;
			max_nb = nb;
		}
	}
	int na=0;
	for(nb=0; nb<B.size(); nb++){
		while(na < A.size() && A[na] >= B[nb]){
			na++;
		}
		int dist=na-nb;
		if(dist > max_dist ||  (dist == max_dist && na > max_na)){
			max_dist = dist;
			max_na = na;
			max_nb = nb;
		}
	}
	na=max_na;
	nb=max_nb;
	int score_a = na*3+(n-na)*2;
	int score_b = nb*3+(m-nb)*2;
	cout << score_a <<":"<<score_b<<endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F(i,a,b) for(ll i=a;i<=b;i++)
#define mp make_pair
#define pb push_back
#define X first
#define Y second
#define pi 3.14159265

double dist(double x1,double y1,double x2,double y2){
    return sqrt( (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1) ); }

ll gcd(ll a,ll b){
    if(b==0) return a; else return gcd(b,a%b); }

ll exp(ll a,ll b){
    if(b==0) return 1; else if(b&1) return a*exp(a,b/2); else { ll ans=exp(a,b/2); return ans*ans; } }

ll a1[400010],b1[400010];

void update(int idx,ll val,ll *a1){

      while( idx <= 400005 ){
        a1[idx]+=val;

        idx=idx+(idx&-idx);
    }

}

ll get(ll idx,ll *a1)
{
    ll sum=0;

    while(idx>0){

        sum+=a1[idx];
        idx-=(idx&-idx);

    }

    return sum;

}

int main(){
    cin.sync_with_stdio();
    cout.precision(9);

    ll n,m;
    ll a[200001],b[200001];

    vector<ll> c;
    cin>>n;

    F(i,0,n-1)
    {
        cin>>a[i];
        c.pb(a[i]);
    }

    cin>>m;

    F(i,0,m-1)
    {
        cin>>b[i];
        c.pb(b[i]);
    }

    sort(c.begin(),c.end());

    for(ll i=0;i<n;i++)
    {
        update(lower_bound(c.begin(),c.end(),a[i])-c.begin()+1,1,a1);

    }

    for(ll i=0;i<m;i++)
    {

        update(lower_bound(c.begin(),c.end(),b[i])-c.begin()+1,1,b1);

    }

    ll m2=0;

    ll ans1,ans2;

     F(i,0,400005)
    {
        ll temp=m2;
        ll a2=get(i,a1);
        ll b2=get(i,b1);

        m2=max(m2,a2*2 + (n-a2)*3 - b2*2 - (m-b2)*3);

        if(m2!=temp)
        {
            ans1=a2*2 + (n-a2)*3;
            ans2=b2*2 + (m-b2)*3;
        }

    }

    cout<<ans1<<":"<<ans2;

    return  0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F(i,a,b) for(ll i=a;i<=b;i++)
#define mp make_pair
#define pb push_back
#define X first
#define Y second
#define pi 3.14159265

double dist(double x1,double y1,double x2,double y2){
    return sqrt( (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1) ); }

ll gcd(ll a,ll b){
    if(b==0) return a; else return gcd(b,a%b); }

ll exp(ll a,ll b){
    if(b==0) return 1; else if(b&1) return a*exp(a,b/2); else { ll ans=exp(a,b/2); return ans*ans; } }

ll a1[400010],b1[400010];

void update(int idx,ll val,ll *a1){

      while( idx <= 400005 ){
        a1[idx]+=val;

        idx=idx+(idx&-idx);
    }

}

ll get(ll idx,ll *a1)
{
    ll sum=0;

    while(idx>0){

        sum+=a1[idx];
        idx-=(idx&-idx);

    }

    return sum;

}

int main(){
    cin.sync_with_stdio();
    cout.precision(9);

    ll n,m;
    ll a[200001],b[200001];

    vector<ll> c;
    cin>>n;

    F(i,0,n-1)
    {
        cin>>a[i];
        c.pb(a[i]);
    }

    cin>>m;

    F(i,0,m-1)
    {
        cin>>b[i];
        c.pb(b[i]);
    }

    sort(c.begin(),c.end());

    for(ll i=0;i<n;i++)
    {
        update(lower_bound(c.begin(),c.end(),a[i])-c.begin()+1,1,a1);

    }

    for(ll i=0;i<m;i++)
    {

        update(lower_bound(c.begin(),c.end(),b[i])-c.begin()+1,1,b1);

    }

    ll m2=0;

    ll ans1,ans2;

     F(i,0,400000)
    {
        ll temp=m2;
        ll a2=get(i,a1);
        ll b2=get(i,b1);

        if(i==0)
        m2=a2*2 + (n-a2)*3 - b2*2 - (m-b2)*3;

        m2=max(m2,a2*2 + (n-a2)*3 - b2*2 - (m-b2)*3);

        if( m2>temp || (m2==temp && (a2*2 + (n-a2)*3)>=ans1) )
        {
            ans1=a2*2 + (n-a2)*3;
            ans2=b2*2 + (m-b2)*3;
        }

    }

    cout<<ans1<<":"<<ans2;

    return  0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F(i,a,b) for(ll i=a;i<=b;i++)
#define mp make_pair
#define pb push_back
#define X first
#define Y second
#define pi 3.14159265

double dist(double x1,double y1,double x2,double y2){
    return sqrt( (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1) ); }

ll gcd(ll a,ll b){
    if(b==0) return a; else return gcd(b,a%b); }

ll exp(ll a,ll b){
    if(b==0) return 1; else if(b&1) return a*exp(a,b/2); else { ll ans=exp(a,b/2); return ans*ans; } }

ll a1[400010],b1[400010];

void update(int idx,ll val,ll *a1){

      while( idx <= 400005 ){
        a1[idx]+=val;

        idx=idx+(idx&-idx);
    }

}

ll get(ll idx,ll *a1)
{
    ll sum=0;

    while(idx>0){

        sum+=a1[idx];
        idx-=(idx&-idx);

    }

    return sum;

}

int main(){
    cin.sync_with_stdio();
    cout.precision(9);

    ll n,m;
    ll a[200001],b[200001];

    vector<ll> c;
    cin>>n;

    F(i,0,n-1)
    {
        cin>>a[i];
        c.pb(a[i]);
    }

    cin>>m;

    F(i,0,m-1)
    {
        cin>>b[i];
        c.pb(b[i]);
    }

    sort(c.begin(),c.end());

    for(ll i=0;i<n;i++)
    {
        update(lower_bound(c.begin(),c.end(),a[i])-c.begin()+1,1,a1);

    }

    for(ll i=0;i<m;i++)
    {

        update(lower_bound(c.begin(),c.end(),b[i])-c.begin()+1,1,b1);

    }

    ll m2=0;

    ll ans1,ans2;

     F(i,0,400000)
    {
        ll temp=m2;
        ll a2=get(i,a1);
        ll b2=get(i,b1);

        m2=max(m2,a2*2 + (n-a2)*3 - b2*2 - (m-b2)*3);

        if( m2>temp || (m2==temp && (a2*2 + (n-a2)*3)>=ans1) )
        {
            ans1=a2*2 + (n-a2)*3;
            ans2=b2*2 + (m-b2)*3;
        }

    }

    cout<<ans1<<":"<<ans2;

    return  0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F(i,a,b) for(ll i=a;i<=b;i++)
#define mp make_pair
#define pb push_back
#define X first
#define Y second
#define pi 3.14159265

double dist(double x1,double y1,double x2,double y2){
    return sqrt( (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1) ); }

ll gcd(ll a,ll b){
    if(b==0) return a; else return gcd(b,a%b); }

ll exp(ll a,ll b){
    if(b==0) return 1; else if(b&1) return a*exp(a,b/2); else { ll ans=exp(a,b/2); return ans*ans; } }

ll a1[400010],b1[400010];

void update(int idx,ll val,ll *a1){

      while( idx <= 400005 ){
        a1[idx]+=val;

        idx=idx+(idx&-idx);
    }

}

ll get(ll idx,ll *a1)
{
    ll sum=0;

    while(idx>0){

        sum+=a1[idx];
        idx-=(idx&-idx);

    }

    return sum;

}

int main(){
    cin.sync_with_stdio();
    cout.precision(9);

    ll n,m;
    ll a[200001],b[200001];

    vector<ll> c;
    cin>>n;

    F(i,0,n-1)
    {
        cin>>a[i];
        c.pb(a[i]);
    }

    cin>>m;

    F(i,0,m-1)
    {
        cin>>b[i];
        c.pb(b[i]);
    }

    sort(c.begin(),c.end());

    for(ll i=0;i<n;i++)
    {
        update(lower_bound(c.begin(),c.end(),a[i])-c.begin()+1,1,a1);

    }

    for(ll i=0;i<m;i++)
    {

        update(lower_bound(c.begin(),c.end(),b[i])-c.begin()+1,1,b1);

    }

    ll m2=0;

    ll ans1,ans2;

     F(i,0,400000)
    {
        ll temp=m2;
        ll a2=get(i,a1);
        ll b2=get(i,b1);

        m2=max(m2,a2*2 + (n-a2)*3 - b2*2 - (m-b2)*3);

        if( m2>=temp && (a2*2 + (n-a2)*3)>=ans1)
        {
            ans1=a2*2 + (n-a2)*3;
            ans2=b2*2 + (m-b2)*3;
        }

    }

    cout<<ans1<<":"<<ans2;

    return  0;
}


/* in the name of ALLAH, most gracious, most merciful */
#include<algorithm>
#include<sstream>
#include<iostream>
#include<iomanip>
#include<climits>
#include<cstring>
#include<cassert>
#include<utility>
#include<limits>
#include<cstdio>
#include<string>
#include<vector>
#include<bitset>
#include<stack>
#include<ctime>
#include<queue>
#include<cmath>
#include<map>
#include<set>
#define     mems(a,b)       memset(a,b,sizeof(a))
#define     IT              iterator
#define     mp              make_pair
#define     pii             pair<I,I>
#define     fs              first
#define     sc              second
#define     pb              push_back
#define     eps             1E-9
#define     all(a)          a.begin(),a.end()
#define     allr(a)         a.rbegin(),a.rend()
#define     MOD             (1000000007)
#define     llInf           (1LL<<62)
#define     iInf            (2123456789)
#define     min_e           *min_element
#define     max_e           *max_element
#define     lsOne(S)        ((S)&(-(S)))
#define     vhas(c,e)       (find(all(c),e) != c.end())
#define     o(i, start, n)          for(int i = start; i < n; i++)
#define     I3              (ll)1000
#define     I4              (ll)10000
#define     I5              (ll)100000
#define     I6              (ll)1000000
#define     I7              (ll)10000000
#define     I8              (ll)100000000
#define     I9              (ll)1000000000
#define     I10             (ll)10000000000
#define     I11             (ll)100000000000
#define     I12             (ll)1000000000000
#define     I13             (ll)10000000000000
#define     I14             (ll)100000000000000
#define     I15             (ll)1000000000000000
#define     I16             (ll)10000000000000000
#define     I17             (ll)100000000000000000
#define     I18             (ll)1000000000000000000
using namespace std;
typedef long long int ll;
typedef unsigned long long  ull;
typedef double dd;
typedef string str;
typedef char ch;
typedef int I;
inline void _(){ ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); }
void __(){
    #ifndef ONLINE_JUDGE
    cout << endl << "time elsaped : " << (double)clock() / CLOCKS_PER_SEC << " ms" << endl;
    #endif
}
inline void ___(char *i, char *j){ freopen(i, "r", stdin); freopen(j, "w", stdout); }

//input templates
template<class T1> bool tk(T1 &e1){if(cin>>e1)return true;return false;}
template<class T1,class T2> bool tk(T1 &e1,T2 &e2){if(cin>>e1>>e2)return true;return false;}
template<class T1,class T2,class T3> bool tk(T1 &e1,T2 &e2,T3 &e3){if(cin>>e1>>e2>>e3)return true;return false;}
template<class T1,class T2,class T3,class T4> bool tk(T1 &e1,T2 &e2,T3 &e3,T4 &e4){if(cin>>e1>>e2>>e3>>e4)return true;return false;}
template<class T1,class T2,class T3,class T4,class T5> bool tk(T1 &e1,T2 &e2,T3 &e3,T4 &e4,T5 &e5){if(cin>>e1>>e2>>e3>>e4>>e5)return true;return false;}
template<class T1,class T2,class T3,class T4,class T5, class T6> bool tk(T1 &e1,T2 &e2,T3 &e3,T4 &e4,T5 &e5,T6 &e6){if(cin>>e1>>e2>>e3>>e4>>e5>>e6)return true;return false;}

// output templates
template<class T1> void put(T1 e){cout<<e<<endl;}
template<class T1,class T2> void put(T1 e1,T2 e2){cout<<e1<<" "<<e2<<endl;}
template<class T1,class T2,class T3> void put(T1 e1,T2 e2,T3 e3){cout<<e1<<" "<<e2<<" "<<e3<<endl;}
template<class T1,class T2,class T3,class T4> void put(T1 e1,T2 e2,T3 e3,T4 e4){cout<<e1<<" "<<e2<<" "<<e3<<" "<<e4<<endl;}
template<class T1,class T2,class T3,class T4,class T5> void put(T1 e1,T2 e2,T3 e3,T4 e4,T5 e5){cout<<e1<<" "<<e2<<" "<<e3<<" "<<e4<<" "<<e5<<endl;}
template<class T1,class T2,class T3,class T4,class T5,class T6> void put(T1 e1,T2 e2,T3 e3,T4 e4,T5 e5,T6 e6){cout<<e1<<" "<<e2<<" "<<e3<<" "<<e4<<" "<<e5<<" "<<e6<<endl;}
template<class T1> void putVec(vector<T1>e1){for(I i=0; i<(e1).size(); i++)(!i?cout<<e1[i]:cout<<" "<<e1[i]);cout<<endl;}
template<class T1> void putArr(T1 arr[],I l){for(I i=0; i<l; i++)(!i?cout<<arr[i]:cout<<" "<<arr[i]);cout<<endl;}
// end of output

// bug templates
template<class T1> void bug(T1 e){
    #ifndef ONLINE_JUDGE
    cout<<e<<endl;
    #endif
}
template<class T1,class T2> void bug(T1 e1,T2 e2){
    #ifndef ONLINE_JUDGE
    cout<<e1<<" "<<e2<<endl;
    #endif
}
template<class T1,class T2,class T3> void bug(T1 e1,T2 e2,T3 e3){
    #ifndef ONLINE_JUDGE
    cout<<e1<<" "<<e2<<" "<<e3<<endl;
    #endif
}
template<class T1,class T2,class T3,class T4> void bug(T1 e1,T2 e2,T3 e3,T4 e4){
    #ifndef ONLINE_JUDGE
    cout<<e1<<" "<<e2<<" "<<e3<<" "<<e4<<endl;
    #endif
}
template<class T1,class T2,class T3,class T4,class T5> void bug(T1 e1,T2 e2,T3 e3,T4 e4,T5 e5){
    #ifndef ONLINE_JUDGE
    cout<<e1<<" "<<e2<<" "<<e3<<" "<<e4<<" "<<e5<<endl;
    #endif
}
template<class T1,class T2,class T3,class T4,class T5,class T6> void bug(T1 e1,T2 e2,T3 e3,T4 e4,T5 e5,T6 e6){
    #ifndef ONLINE_JUDGE
    cout<<e1<<" "<<e2<<" "<<e3<<" "<<e4<<" "<<e5<<" "<<e6<<endl;
    #endif
}
template<class T1> void bugVec(vector<T1>e1){
    #ifndef ONLINE_JUDGE
    for(I i=0; i<(e1).size(); i++)(!i?cout<<e1[i]:cout<<" "<<e1[i]);cout<<endl;
    #endif
}
template<class T1> void bugArr(T1 arr[],I l){
    #ifndef ONLINE_JUDGE
    for(I i=0; i<l; i++)(!i?cout<<arr[i]:cout<<" "<<arr[i]);cout<<endl;
    #endif
}
// end of bugs

//bit mask operation
template<typename T> inline bool isOn(T &mask,I pos){return ((mask)&(1<<pos));}
template<typename T> inline void setOff(T &mask,I pos){mask = ((mask)&(~(1<<pos)));}
template<typename T> inline void setOn(T &mask,I pos){mask = ((mask)(1<<pos));}
//end of bit mask operations

namespace gv{

};

long long absolute(long long a){
    if(a < 0) return -a;
    return a;
}

int main(){
    _();

    vector<pair<int, int > > ans(2);
    ans[1] = {2 * I9 + 1, 2 * I9 + 1};

    int n, m, c; vector<int > a, b;
    tk(n); o(i, 0, n) tk(c), a.push_back(c); sort(all(a));
    tk(m); o(i, 0, m) tk(c), b.push_back(c); sort(all(b));

    for(int i = 0; i < n; i++){

        for(int j = -1; j < 1; j++){

        int lo = max(a[i] + j, 0);

        int binaryLo = 0, binaryHi = a.size();
        while(binaryLo < binaryHi){
            int mid = binaryLo + (binaryHi - binaryLo) / 2;
            if(a[mid] < lo) binaryLo = mid + 1;
            else binaryHi = mid;
        }
        long long A = binaryLo * 2 + ((int)a.size() - binaryLo) * 3;

        binaryLo = 0, binaryHi = b.size();
        while(binaryLo < binaryHi){
            int mid = binaryLo + (binaryHi - binaryLo) / 2;
            if(b[mid] < lo) binaryLo = mid + 1;
            else binaryHi = mid;
        }
        long long B = binaryLo * 2 + ((int)b.size() - binaryLo) * 3;

        ans[1] = {-1 * A, B};
        sort(all(ans));
        }
    }

    for(int i = 0; i < n; i++){

        for(int j = -1; j < 1; j++){

        int lo = max(b[i] + j, 0);

        int binaryLo = 0, binaryHi = a.size();
        while(binaryLo < binaryHi){
            int mid = binaryLo + (binaryHi - binaryLo) / 2;
            if(a[mid] < lo) binaryLo = mid + 1;
            else binaryHi = mid;
        }
        long long A = binaryLo * 2 + ((int)a.size() - binaryLo) * 3;

        binaryLo = 0, binaryHi = b.size();
        while(binaryLo < binaryHi){
            int mid = binaryLo + (binaryHi - binaryLo) / 2;
            if(b[mid] < lo) binaryLo = mid + 1;
            else binaryHi = mid;
        }
        long long B = binaryLo * 2 + ((int)b.size() - binaryLo) * 3;

        ans[1] = {-1 * A, B};
        sort(all(ans));

        }
    }

    cout << (-1 * (ans[0].first)) << ":" << ans[0].second << endl;

    __();
}


/* in the name of ALLAH, most gracious, most merciful */
#include<algorithm>
#include<sstream>
#include<iostream>
#include<iomanip>
#include<climits>
#include<cstring>
#include<cassert>
#include<utility>
#include<limits>
#include<cstdio>
#include<string>
#include<vector>
#include<bitset>
#include<stack>
#include<ctime>
#include<queue>
#include<cmath>
#include<map>
#include<set>
#define     mems(a,b)       memset(a,b,sizeof(a))
#define     IT              iterator
#define     mp              make_pair
#define     pii             pair<I,I>
#define     fs              first
#define     sc              second
#define     pb              push_back
#define     eps             1E-9
#define     all(a)          a.begin(),a.end()
#define     allr(a)         a.rbegin(),a.rend()
#define     MOD             (1000000007)
#define     llInf           (1LL<<62)
#define     iInf            (2123456789)
#define     min_e           *min_element
#define     max_e           *max_element
#define     lsOne(S)        ((S)&(-(S)))
#define     vhas(c,e)       (find(all(c),e) != c.end())
#define     o(i, start, n)          for(int i = start; i < n; i++)
#define     I3              (ll)1000
#define     I4              (ll)10000
#define     I5              (ll)100000
#define     I6              (ll)1000000
#define     I7              (ll)10000000
#define     I8              (ll)100000000
#define     I9              (ll)1000000000
#define     I10             (ll)10000000000
#define     I11             (ll)100000000000
#define     I12             (ll)1000000000000
#define     I13             (ll)10000000000000
#define     I14             (ll)100000000000000
#define     I15             (ll)1000000000000000
#define     I16             (ll)10000000000000000
#define     I17             (ll)100000000000000000
#define     I18             (ll)1000000000000000000
using namespace std;
typedef long long int ll;
typedef unsigned long long  ull;
typedef double dd;
typedef string str;
typedef char ch;
typedef int I;
inline void _(){ ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); }
void __(){
    #ifndef ONLINE_JUDGE
    cout << endl << "time elsaped : " << (double)clock() / CLOCKS_PER_SEC << " ms" << endl;
    #endif
}
inline void ___(char *i, char *j){ freopen(i, "r", stdin); freopen(j, "w", stdout); }

//input templates
template<class T1> bool tk(T1 &e1){if(cin>>e1)return true;return false;}
template<class T1,class T2> bool tk(T1 &e1,T2 &e2){if(cin>>e1>>e2)return true;return false;}
template<class T1,class T2,class T3> bool tk(T1 &e1,T2 &e2,T3 &e3){if(cin>>e1>>e2>>e3)return true;return false;}
template<class T1,class T2,class T3,class T4> bool tk(T1 &e1,T2 &e2,T3 &e3,T4 &e4){if(cin>>e1>>e2>>e3>>e4)return true;return false;}
template<class T1,class T2,class T3,class T4,class T5> bool tk(T1 &e1,T2 &e2,T3 &e3,T4 &e4,T5 &e5){if(cin>>e1>>e2>>e3>>e4>>e5)return true;return false;}
template<class T1,class T2,class T3,class T4,class T5, class T6> bool tk(T1 &e1,T2 &e2,T3 &e3,T4 &e4,T5 &e5,T6 &e6){if(cin>>e1>>e2>>e3>>e4>>e5>>e6)return true;return false;}

// output templates
template<class T1> void put(T1 e){cout<<e<<endl;}
template<class T1,class T2> void put(T1 e1,T2 e2){cout<<e1<<" "<<e2<<endl;}
template<class T1,class T2,class T3> void put(T1 e1,T2 e2,T3 e3){cout<<e1<<" "<<e2<<" "<<e3<<endl;}
template<class T1,class T2,class T3,class T4> void put(T1 e1,T2 e2,T3 e3,T4 e4){cout<<e1<<" "<<e2<<" "<<e3<<" "<<e4<<endl;}
template<class T1,class T2,class T3,class T4,class T5> void put(T1 e1,T2 e2,T3 e3,T4 e4,T5 e5){cout<<e1<<" "<<e2<<" "<<e3<<" "<<e4<<" "<<e5<<endl;}
template<class T1,class T2,class T3,class T4,class T5,class T6> void put(T1 e1,T2 e2,T3 e3,T4 e4,T5 e5,T6 e6){cout<<e1<<" "<<e2<<" "<<e3<<" "<<e4<<" "<<e5<<" "<<e6<<endl;}
template<class T1> void putVec(vector<T1>e1){for(I i=0; i<(e1).size(); i++)(!i?cout<<e1[i]:cout<<" "<<e1[i]);cout<<endl;}
template<class T1> void putArr(T1 arr[],I l){for(I i=0; i<l; i++)(!i?cout<<arr[i]:cout<<" "<<arr[i]);cout<<endl;}
// end of output

// bug templates
template<class T1> void bug(T1 e){
    #ifndef ONLINE_JUDGE
    cout<<e<<endl;
    #endif
}
template<class T1,class T2> void bug(T1 e1,T2 e2){
    #ifndef ONLINE_JUDGE
    cout<<e1<<" "<<e2<<endl;
    #endif
}
template<class T1,class T2,class T3> void bug(T1 e1,T2 e2,T3 e3){
    #ifndef ONLINE_JUDGE
    cout<<e1<<" "<<e2<<" "<<e3<<endl;
    #endif
}
template<class T1,class T2,class T3,class T4> void bug(T1 e1,T2 e2,T3 e3,T4 e4){
    #ifndef ONLINE_JUDGE
    cout<<e1<<" "<<e2<<" "<<e3<<" "<<e4<<endl;
    #endif
}
template<class T1,class T2,class T3,class T4,class T5> void bug(T1 e1,T2 e2,T3 e3,T4 e4,T5 e5){
    #ifndef ONLINE_JUDGE
    cout<<e1<<" "<<e2<<" "<<e3<<" "<<e4<<" "<<e5<<endl;
    #endif
}
template<class T1,class T2,class T3,class T4,class T5,class T6> void bug(T1 e1,T2 e2,T3 e3,T4 e4,T5 e5,T6 e6){
    #ifndef ONLINE_JUDGE
    cout<<e1<<" "<<e2<<" "<<e3<<" "<<e4<<" "<<e5<<" "<<e6<<endl;
    #endif
}
template<class T1> void bugVec(vector<T1>e1){
    #ifndef ONLINE_JUDGE
    for(I i=0; i<(e1).size(); i++)(!i?cout<<e1[i]:cout<<" "<<e1[i]);cout<<endl;
    #endif
}
template<class T1> void bugArr(T1 arr[],I l){
    #ifndef ONLINE_JUDGE
    for(I i=0; i<l; i++)(!i?cout<<arr[i]:cout<<" "<<arr[i]);cout<<endl;
    #endif
}
// end of bugs

//bit mask operation
template<typename T> inline bool isOn(T &mask,I pos){return ((mask)&(1<<pos));}
template<typename T> inline void setOff(T &mask,I pos){mask = ((mask)&(~(1<<pos)));}
template<typename T> inline void setOn(T &mask,I pos){mask = ((mask)(1<<pos));}
//end of bit mask operations

namespace gv{

};

long long absolute(long long a){
    if(a < 0) return -a;
    return a;
}

int main(){
    _();

    vector<pair<int, pair<int, int > > > ans;

    int n, m, c; vector<int > a, b;
    tk(n); o(i, 0, n) tk(c), a.push_back(c); sort(all(a));
    tk(m); o(i, 0, m) tk(c), b.push_back(c); sort(all(b));

    long long lo = 0, hi = 12345678912345;

    while(hi - lo > 2){
        long long ft = lo + (hi - lo) / 3;
        long long tt = hi - (hi - lo) / 3;

        int binaryLo = 0, binaryHi = a.size() - 1;
        while(binaryLo < binaryHi){
            int mid = binaryLo + (binaryHi - binaryLo) / 2;
            if(a[mid] < ft) binaryLo = mid + 1;
            else binaryHi = mid;
        }
        long long A = binaryLo * 2 + ((int)a.size() - binaryLo) * 3;

        binaryLo = 0, binaryHi = b.size() - 1;
        while(binaryLo < binaryHi){
            int mid = binaryLo + (binaryHi - binaryLo) / 2;
            if(b[mid] < ft) binaryLo = mid + 1;
            else binaryHi = mid;
        }
        long long B = binaryLo * 2 + ((int)b.size() - binaryLo) * 3;

        binaryLo = 0, binaryHi = a.size() - 1;
        while(binaryLo < binaryHi){
            int mid = binaryLo + (binaryHi - binaryLo) / 2;
            if(a[mid] < tt) binaryLo = mid + 1;
            else binaryHi = mid;
        }
        long long AA = binaryLo * 2 + ((int)a.size() - binaryLo) * 3;

        binaryLo = 0, binaryHi = b.size() - 1;
        while(binaryLo < binaryHi){
            int mid = binaryLo + (binaryHi - binaryLo) / 2;
            if(b[mid] < tt) binaryLo = mid + 1;
            else binaryHi = mid;
        }
        long long BB = binaryLo * 2 + ((int)b.size() - binaryLo) * 3;

        if(AA - BB < A - B) lo = ft;
        else hi = tt;

    }

    int minn = lo - 10, maxx = lo + 10;
    for(lo = minn; lo <= maxx; lo++){

        int binaryLo = 0, binaryHi = a.size() - 1;
        while(binaryLo < binaryHi){
            int mid = binaryLo + (binaryHi - binaryLo) / 2;
            if(a[mid] < lo) binaryLo = mid + 1;
            else binaryHi = mid;
        }
        long long A = binaryLo * 2 + ((int)a.size() - binaryLo) * 3;

        binaryLo = 0, binaryHi = b.size() - 1;
        while(binaryLo < binaryHi){
            int mid = binaryLo + (binaryHi - binaryLo) / 2;
            if(b[mid] < lo) binaryLo = mid + 1;
            else binaryHi = mid;
        }
        long long B = binaryLo * 2 + ((int)b.size() - binaryLo) * 3;

        ans.push_back({A - B, {A, B}});

    }
    sort(all(ans), greater<pair<int, pair<int, int > > >());

    cout << ans[0].second.first << ":" << ans[0].second.second << endl;

    __();
}


/* in the name of ALLAH, most gracious, most merciful */
#include<algorithm>
#include<sstream>
#include<iostream>
#include<iomanip>
#include<climits>
#include<cstring>
#include<cassert>
#include<utility>
#include<limits>
#include<cstdio>
#include<string>
#include<vector>
#include<bitset>
#include<stack>
#include<ctime>
#include<queue>
#include<cmath>
#include<map>
#include<set>
#define     mems(a,b)       memset(a,b,sizeof(a))
#define     IT              iterator
#define     mp              make_pair
#define     pii             pair<I,I>
#define     fs              first
#define     sc              second
#define     pb              push_back
#define     eps             1E-9
#define     all(a)          a.begin(),a.end()
#define     allr(a)         a.rbegin(),a.rend()
#define     MOD             (1000000007)
#define     llInf           (1LL<<62)
#define     iInf            (2123456789)
#define     min_e           *min_element
#define     max_e           *max_element
#define     lsOne(S)        ((S)&(-(S)))
#define     vhas(c,e)       (find(all(c),e) != c.end())
#define     o(i, start, n)          for(int i = start; i < n; i++)
#define     I3              (ll)1000
#define     I4              (ll)10000
#define     I5              (ll)100000
#define     I6              (ll)1000000
#define     I7              (ll)10000000
#define     I8              (ll)100000000
#define     I9              (ll)1000000000
#define     I10             (ll)10000000000
#define     I11             (ll)100000000000
#define     I12             (ll)1000000000000
#define     I13             (ll)10000000000000
#define     I14             (ll)100000000000000
#define     I15             (ll)1000000000000000
#define     I16             (ll)10000000000000000
#define     I17             (ll)100000000000000000
#define     I18             (ll)1000000000000000000
using namespace std;
typedef long long int ll;
typedef unsigned long long  ull;
typedef double dd;
typedef string str;
typedef char ch;
typedef int I;
inline void _(){ ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); }
void __(){
    #ifndef ONLINE_JUDGE
    cout << endl << "time elsaped : " << (double)clock() / CLOCKS_PER_SEC << " ms" << endl;
    #endif
}
inline void ___(char *i, char *j){ freopen(i, "r", stdin); freopen(j, "w", stdout); }

//input templates
template<class T1> bool tk(T1 &e1){if(cin>>e1)return true;return false;}
template<class T1,class T2> bool tk(T1 &e1,T2 &e2){if(cin>>e1>>e2)return true;return false;}
template<class T1,class T2,class T3> bool tk(T1 &e1,T2 &e2,T3 &e3){if(cin>>e1>>e2>>e3)return true;return false;}
template<class T1,class T2,class T3,class T4> bool tk(T1 &e1,T2 &e2,T3 &e3,T4 &e4){if(cin>>e1>>e2>>e3>>e4)return true;return false;}
template<class T1,class T2,class T3,class T4,class T5> bool tk(T1 &e1,T2 &e2,T3 &e3,T4 &e4,T5 &e5){if(cin>>e1>>e2>>e3>>e4>>e5)return true;return false;}
template<class T1,class T2,class T3,class T4,class T5, class T6> bool tk(T1 &e1,T2 &e2,T3 &e3,T4 &e4,T5 &e5,T6 &e6){if(cin>>e1>>e2>>e3>>e4>>e5>>e6)return true;return false;}

// output templates
template<class T1> void put(T1 e){cout<<e<<endl;}
template<class T1,class T2> void put(T1 e1,T2 e2){cout<<e1<<" "<<e2<<endl;}
template<class T1,class T2,class T3> void put(T1 e1,T2 e2,T3 e3){cout<<e1<<" "<<e2<<" "<<e3<<endl;}
template<class T1,class T2,class T3,class T4> void put(T1 e1,T2 e2,T3 e3,T4 e4){cout<<e1<<" "<<e2<<" "<<e3<<" "<<e4<<endl;}
template<class T1,class T2,class T3,class T4,class T5> void put(T1 e1,T2 e2,T3 e3,T4 e4,T5 e5){cout<<e1<<" "<<e2<<" "<<e3<<" "<<e4<<" "<<e5<<endl;}
template<class T1,class T2,class T3,class T4,class T5,class T6> void put(T1 e1,T2 e2,T3 e3,T4 e4,T5 e5,T6 e6){cout<<e1<<" "<<e2<<" "<<e3<<" "<<e4<<" "<<e5<<" "<<e6<<endl;}
template<class T1> void putVec(vector<T1>e1){for(I i=0; i<(e1).size(); i++)(!i?cout<<e1[i]:cout<<" "<<e1[i]);cout<<endl;}
template<class T1> void putArr(T1 arr[],I l){for(I i=0; i<l; i++)(!i?cout<<arr[i]:cout<<" "<<arr[i]);cout<<endl;}
// end of output

// bug templates
template<class T1> void bug(T1 e){
    #ifndef ONLINE_JUDGE
    cout<<e<<endl;
    #endif
}
template<class T1,class T2> void bug(T1 e1,T2 e2){
    #ifndef ONLINE_JUDGE
    cout<<e1<<" "<<e2<<endl;
    #endif
}
template<class T1,class T2,class T3> void bug(T1 e1,T2 e2,T3 e3){
    #ifndef ONLINE_JUDGE
    cout<<e1<<" "<<e2<<" "<<e3<<endl;
    #endif
}
template<class T1,class T2,class T3,class T4> void bug(T1 e1,T2 e2,T3 e3,T4 e4){
    #ifndef ONLINE_JUDGE
    cout<<e1<<" "<<e2<<" "<<e3<<" "<<e4<<endl;
    #endif
}
template<class T1,class T2,class T3,class T4,class T5> void bug(T1 e1,T2 e2,T3 e3,T4 e4,T5 e5){
    #ifndef ONLINE_JUDGE
    cout<<e1<<" "<<e2<<" "<<e3<<" "<<e4<<" "<<e5<<endl;
    #endif
}
template<class T1,class T2,class T3,class T4,class T5,class T6> void bug(T1 e1,T2 e2,T3 e3,T4 e4,T5 e5,T6 e6){
    #ifndef ONLINE_JUDGE
    cout<<e1<<" "<<e2<<" "<<e3<<" "<<e4<<" "<<e5<<" "<<e6<<endl;
    #endif
}
template<class T1> void bugVec(vector<T1>e1){
    #ifndef ONLINE_JUDGE
    for(I i=0; i<(e1).size(); i++)(!i?cout<<e1[i]:cout<<" "<<e1[i]);cout<<endl;
    #endif
}
template<class T1> void bugArr(T1 arr[],I l){
    #ifndef ONLINE_JUDGE
    for(I i=0; i<l; i++)(!i?cout<<arr[i]:cout<<" "<<arr[i]);cout<<endl;
    #endif
}
// end of bugs

//bit mask operation
template<typename T> inline bool isOn(T &mask,I pos){return ((mask)&(1<<pos));}
template<typename T> inline void setOff(T &mask,I pos){mask = ((mask)&(~(1<<pos)));}
template<typename T> inline void setOn(T &mask,I pos){mask = ((mask)(1<<pos));}
//end of bit mask operations

namespace gv{

};

long long absolute(long long a){
    if(a < 0) return -a;
    return a;
}

int main(){
    _();

    vector<pair<int, int > > ans;

    int n, m, c; vector<int > a, b;
    tk(n); o(i, 0, n) tk(c), a.push_back(c); sort(all(a));
    tk(m); o(i, 0, m) tk(c), b.push_back(c); sort(all(b));

    long long lo = 0, hi = 12345678912345;

    while(hi - lo > 2){
        long long ft = lo + (hi - lo) / 3;
        long long tt = hi - (hi - lo) / 3;

        int binaryLo = 0, binaryHi = a.size();
        while(binaryLo < binaryHi){
            int mid = binaryLo + (binaryHi - binaryLo) / 2;
            if(a[mid] < ft) binaryLo = mid + 1;
            else binaryHi = mid;
        }
        long long A = binaryLo * 2 + ((int)a.size() - binaryLo) * 3;

        binaryLo = 0, binaryHi = b.size();
        while(binaryLo < binaryHi){
            int mid = binaryLo + (binaryHi - binaryLo) / 2;
            if(b[mid] < ft) binaryLo = mid + 1;
            else binaryHi = mid;
        }
        long long B = binaryLo * 2 + ((int)b.size() - binaryLo) * 3;

        binaryLo = 0, binaryHi = a.size();
        while(binaryLo < binaryHi){
            int mid = binaryLo + (binaryHi - binaryLo) / 2;
            if(a[mid] < tt) binaryLo = mid + 1;
            else binaryHi = mid;
        }
        long long AA = binaryLo * 2 + ((int)a.size() - binaryLo) * 3;

        binaryLo = 0, binaryHi = b.size();
        while(binaryLo < binaryHi){
            int mid = binaryLo + (binaryHi - binaryLo) / 2;
            if(b[mid] < tt) binaryLo = mid + 1;
            else binaryHi = mid;
        }
        long long BB = binaryLo * 2 + ((int)b.size() - binaryLo) * 3;

        if(AA - BB < A - B) lo = ft;
        else hi = tt;

    }

    int minn = max((int)lo - 10, 0), maxx = lo + 10;
    for(lo = minn; lo <= maxx; lo++){

        int binaryLo = 0, binaryHi = a.size();
        while(binaryLo < binaryHi){
            int mid = binaryLo + (binaryHi - binaryLo) / 2;
            if(a[mid] < lo) binaryLo = mid + 1;
            else binaryHi = mid;
        }
        long long A = binaryLo * 2 + ((int)a.size() - binaryLo) * 3;

        binaryLo = 0, binaryHi = b.size();
        while(binaryLo < binaryHi){
            int mid = binaryLo + (binaryHi - binaryLo) / 2;
            if(b[mid] < lo) binaryLo = mid + 1;
            else binaryHi = mid;
        }
        long long B = binaryLo * 2 + ((int)b.size() - binaryLo) * 3;

        ans.push_back({-1 * A, B});

    }
    sort(all(ans));

    cout << (-1 * (ans[0].first)) << ":" << ans[0].second << endl;

    __();
}