#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define ll long long
#define ull unsigned long long
#define all(a)       (a).begin(),(a).end()
#define rep(i,a,n)   for(ll i=a ; i<n ; i++)
#define repn(n)   for(ll i=0 ; i<n ; i++)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define MAXN   1000001
#define f first
#define sec second

ull mod = 1e9+7;
ull ncr( ll n,  ll k)
{
    ull res = 1;

    // Since C(n, k) = C(n, n-k)
    if ( k > n - k )
        k = n - k;

    // Calculate value of
    // [n * (n-1) *---* (n-k+1)] / [k * (k-1) *----* 1]
    for (ll i = 0; i < k; ++i)
    {
        res *= (n - i);
        res /= (i + 1);
        res = res;
    }

    return res;
}
bool prime(ull num)
{
    bool flag=true;
    for(ull i = 2; i*i <= num ; i++)
    {
        if(num % i == 0)
        {
            flag = false;
            break;
        }
    }
    return flag;
}
ll ipow(ll base, ll exp)
{
    ll result = 1;
    for (;;)
    {
        if (exp & 1)
        {
            result *= base;
            result = result%mod;
        }
        exp >>= 1;
        if (!exp)
            break;
        base *= base;
        base = base%mod;
    }

    return result%mod;
}
ll abs(ll a,ll b)
{
    if((a-b)>0)
        return (a-b);
    else
        return (b-a);
}
ll MOD =  998244353;
ll add(ll a, ll b)
{
    a += b;
    if (a >= MOD)
        a -= MOD;
    if (a < 0)
        a += MOD;
    return a;
}
ll gcd(ll a, ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}

ll der(ll k)
{
    ll res=0;
    ll fact=1;
    for(ll i=2; i<=k; i++)
        fact *= i;
    ll s=1;
    ll j=1;
    for(ll i=2; i<=k; i++)
    {
        j = j*i;
        ll first = (fact/j)*s;
        res += first;
        s = s*-1;
    }
    return res;
}

////////////////////////////////////////////////////////////////////////////////////////////
vector<int> v[1000];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n,k;cin>>n>>k;
    int a,b,c,d;cin>>a>>b>>c>>d;
    if(k<n+1)
    {
        cout<<"-1";
        return 0;
    }
    int node;
    if(n==4){
        cout<<"-1";
        return 0;
    }
    for(int i=1;i<=n;i++){
        if(i==a||i==b||i==c||i==d)
        {
            continue;
        }
        node = i;
        break;
    }
    cout<<node<<endl;
    if(n==5){
        cout<<a<<" "<<c<<" "<<node<<" "<<d<<" "<<b<<endl;
        cout<<c<<" "<<a<<" "<<node<<" "<<b<<" "<<d<<endl;
        return 0;
    }
    int n1 = node,n2;
    for(int i=1;i<=n;i++){
        if(i==a||i==b||i==c||i==d||i==node)
        {
            continue;
        }
        v[n1].pb(i);
        n1=i;
    }
//    v[a].pb(c);
//    v[c].pb(a);
//    v[a].pb(node);
//    v[c].pb(node);
//    v[d].pb(b);
//    v[b].pb(d);
//    v[n1].pb(b);
//    v[n1].pb(d);

    cout<<a<<" "<<c<<" ";
    bool visit[n+1];
    visit[a]=true;
    visit[b]=true;
   n2 = node;
    while(node!=n1){
        cout<<node<<" ";
        visit[node]=true;
        node = v[node][0];

    }
    cout<<n1<<" ";
    cout<<d<<" "<<b;
    cout<<endl;
    cout<<c<<" "<<a<<" ";
    while(n1!=n2){
       cout<<n2<<" ";
       n2 = v[n2][0];
    }
    cout<<n1<<" ";
   cout<<b<<" "<<d;
}


#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define ll long long
#define ull unsigned long long
#define all(a)       (a).begin(),(a).end()
#define rep(i,a,n)   for(ll i=a ; i<n ; i++)
#define repn(n)   for(ll i=0 ; i<n ; i++)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define MAXN   1000001
#define f first
#define sec second

ull mod = 1e9+7;
ull ncr( ll n,  ll k)
{
    ull res = 1;

    // Since C(n, k) = C(n, n-k)
    if ( k > n - k )
        k = n - k;

    // Calculate value of
    // [n * (n-1) *---* (n-k+1)] / [k * (k-1) *----* 1]
    for (ll i = 0; i < k; ++i)
    {
        res *= (n - i);
        res /= (i + 1);
        res = res;
    }

    return res;
}
bool prime(ull num)
{
    bool flag=true;
    for(ull i = 2; i*i <= num ; i++)
    {
        if(num % i == 0)
        {
            flag = false;
            break;
        }
    }
    return flag;
}
ll ipow(ll base, ll exp)
{
    ll result = 1;
    for (;;)
    {
        if (exp & 1)
        {
            result *= base;
            result = result%mod;
        }
        exp >>= 1;
        if (!exp)
            break;
        base *= base;
        base = base%mod;
    }

    return result%mod;
}
ll abs(ll a,ll b)
{
    if((a-b)>0)
        return (a-b);
    else
        return (b-a);
}
ll MOD =  998244353;
ll add(ll a, ll b)
{
    a += b;
    if (a >= MOD)
        a -= MOD;
    if (a < 0)
        a += MOD;
    return a;
}
ll gcd(ll a, ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}

ll der(ll k)
{
    ll res=0;
    ll fact=1;
    for(ll i=2; i<=k; i++)
        fact *= i;
    ll s=1;
    ll j=1;
    for(ll i=2; i<=k; i++)
    {
        j = j*i;
        ll first = (fact/j)*s;
        res += first;
        s = s*-1;
    }
    return res;
}

////////////////////////////////////////////////////////////////////////////////////////////

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,k;cin>>n>>k;
    int a,b,c,d;cin>>a>>b>>c>>d;
    if(k<n){
        cout<<"-1";
        return 0;
    }
    int v[n];
    v[0]=d;
    v[1]=c;
    v[2]=b;
    v[3]=a;
    int beg=4;
    for(int i=1;i<=n;i++){

        if(i==a||i==b||i==c||i==d)
            continue;
        v[beg]=i;
    beg++;
    }
    int st=3;
    for(int i=0;i<n;i++)
    {
        cout<<v[st]<<" ";
        st = (st+1)%n;
    }
    cout<<endl;
    st = 1;
    for(int i=0;i<n;i++)
    {
        cout<<v[st]<<" ";
        st = (st+1)%n;
    }

}


#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define ll long long
#define ull unsigned long long
#define all(a)       (a).begin(),(a).end()
#define rep(i,a,n)   for(ll i=a ; i<n ; i++)
#define repn(n)   for(ll i=0 ; i<n ; i++)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define MAXN   1000001
#define f first
#define sec second

ull mod = 1e9+7;
ull ncr( ll n,  ll k)
{
    ull res = 1;

    // Since C(n, k) = C(n, n-k)
    if ( k > n - k )
        k = n - k;

    // Calculate value of
    // [n * (n-1) *---* (n-k+1)] / [k * (k-1) *----* 1]
    for (ll i = 0; i < k; ++i)
    {
        res *= (n - i);
        res /= (i + 1);
        res = res;
    }

    return res;
}
bool prime(ull num)
{
    bool flag=true;
    for(ull i = 2; i*i <= num ; i++)
    {
        if(num % i == 0)
        {
            flag = false;
            break;
        }
    }
    return flag;
}
ll ipow(ll base, ll exp)
{
    ll result = 1;
    for (;;)
    {
        if (exp & 1)
        {
            result *= base;
            result = result%mod;
        }
        exp >>= 1;
        if (!exp)
            break;
        base *= base;
        base = base%mod;
    }

    return result%mod;
}
ll abs(ll a,ll b)
{
    if((a-b)>0)
        return (a-b);
    else
        return (b-a);
}
ll MOD =  998244353;
ll add(ll a, ll b)
{
    a += b;
    if (a >= MOD)
        a -= MOD;
    if (a < 0)
        a += MOD;
    return a;
}
ll gcd(ll a, ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}

ll der(ll k)
{
    ll res=0;
    ll fact=1;
    for(ll i=2; i<=k; i++)
        fact *= i;
    ll s=1;
    ll j=1;
    for(ll i=2; i<=k; i++)
    {
        j = j*i;
        ll first = (fact/j)*s;
        res += first;
        s = s*-1;
    }
    return res;
}

////////////////////////////////////////////////////////////////////////////////////////////
vector<int> v[1000];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n,k;cin>>n>>k;
    int a,b,c,d;cin>>a>>b>>c>>d;
    if(k<n+1)
    {
        cout<<"-1";
        return 0;
    }
    int node;
    for(int i=1;i<=n;i++){
        if(i==a||i==b||i==c||i==d)
        {
            continue;
        }
        node = i;
        break;
    }
    if(n==5){
        cout<<a<<" "<<c<<" "<<node<<" "<<d<<" "<<b<<endl;
        cout<<c<<" "<<a<<" "<<node<<" "<<v<<" "<<d<<endl;
        return 0;
    }
    int n1 = node,n2;
    for(int i=1;i<=n;i++){
        if(i==a||i==b||i==c||i==d||i==node)
        {
            continue;
        }
        v[n1].pb(i);
        n1=i;
    }
//    v[a].pb(c);
//    v[c].pb(a);
//    v[a].pb(node);
//    v[c].pb(node);
//    v[d].pb(b);
//    v[b].pb(d);
//    v[n1].pb(b);
//    v[n1].pb(d);

    cout<<a<<" "<<c<<" ";
    bool visit[n+1];
    visit[a]=true;
    visit[b]=true;
   n2 = node;
    while(node!=n1){
        cout<<node<<" ";
        visit[node]=true;
        node = v[node][0];

    }
    cout<<n1<<" ";
    cout<<d<<" "<<b;
    cout<<endl;
    cout<<c<<" "<<a<<" ";
    while(n1!=n2){
       cout<<n2<<" ";
       n2 = v[n2][0];
    }
    cout<<n1<<" ";
   cout<<b<<" "<<d;
}


#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define ll long long
#define ull unsigned long long
#define all(a)       (a).begin(),(a).end()
#define rep(i,a,n)   for(ll i=a ; i<n ; i++)
#define repn(n)   for(ll i=0 ; i<n ; i++)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define MAXN   1000001
#define f first
#define sec second

ull mod = 1e9+7;
ull ncr( ll n,  ll k)
{
    ull res = 1;

    // Since C(n, k) = C(n, n-k)
    if ( k > n - k )
        k = n - k;

    // Calculate value of
    // [n * (n-1) *---* (n-k+1)] / [k * (k-1) *----* 1]
    for (ll i = 0; i < k; ++i)
    {
        res *= (n - i);
        res /= (i + 1);
        res = res;
    }

    return res;
}
bool prime(ull num)
{
    bool flag=true;
    for(ull i = 2; i*i <= num ; i++)
    {
        if(num % i == 0)
        {
            flag = false;
            break;
        }
    }
    return flag;
}
ll ipow(ll base, ll exp)
{
    ll result = 1;
    for (;;)
    {
        if (exp & 1)
        {
            result *= base;
            result = result%mod;
        }
        exp >>= 1;
        if (!exp)
            break;
        base *= base;
        base = base%mod;
    }

    return result%mod;
}
ll abs(ll a,ll b)
{
    if((a-b)>0)
        return (a-b);
    else
        return (b-a);
}
ll MOD =  998244353;
ll add(ll a, ll b)
{
    a += b;
    if (a >= MOD)
        a -= MOD;
    if (a < 0)
        a += MOD;
    return a;
}
ll gcd(ll a, ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}

ll der(ll k)
{
    ll res=0;
    ll fact=1;
    for(ll i=2; i<=k; i++)
        fact *= i;
    ll s=1;
    ll j=1;
    for(ll i=2; i<=k; i++)
    {
        j = j*i;
        ll first = (fact/j)*s;
        res += first;
        s = s*-1;
    }
    return res;
}

////////////////////////////////////////////////////////////////////////////////////////////
vector<int> v[1000];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n,k;cin>>n>>k;
    int a,b,c,d;cin>>a>>b>>c>>d;
    if(k<n+1)
    {
        cout<<"-1";
        return 0;
    }
    int node;
    if(n==4){
        cout<<"-1";
        return 0;
    }
    for(int i=1;i<=n;i++){
        if(i==a||i==b||i==c||i==d)
        {
            continue;
        }
        node = i;
        break;
    }

    if(n==5){
        cout<<a<<" "<<c<<" "<<node<<" "<<d<<" "<<b<<endl;
        cout<<c<<" "<<a<<" "<<node<<" "<<b<<" "<<d<<endl;
        return 0;
    }
    int n1 = node,n2;
    for(int i=1;i<=n;i++){
        if(i==a||i==b||i==c||i==d||i==node)
        {
            continue;
        }
        v[n1].pb(i);
        n1=i;
    }
//    v[a].pb(c);
//    v[c].pb(a);
//    v[a].pb(node);
//    v[c].pb(node);
//    v[d].pb(b);
//    v[b].pb(d);
//    v[n1].pb(b);
//    v[n1].pb(d);

    cout<<a<<" "<<c<<" ";
    bool visit[n+1];
    visit[a]=true;
    visit[b]=true;
   n2 = node;
    while(node!=n1){
        cout<<node<<" ";
        visit[node]=true;
        node = v[node][0];

    }
    cout<<n1<<" ";
    cout<<d<<" "<<b;
    cout<<endl;
    cout<<c<<" "<<a<<" ";
    while(n1!=n2){
       cout<<n2<<" ";
       n2 = v[n2][0];
    }
    cout<<n1<<" ";
   cout<<b<<" "<<d;
}


#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define ll long long
#define ull unsigned long long
#define all(a)       (a).begin(),(a).end()
#define rep(i,a,n)   for(ll i=a ; i<n ; i++)
#define repn(n)   for(ll i=0 ; i<n ; i++)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define MAXN   1000001
#define f first
#define sec second

ull mod = 1e9+7;
ull ncr( ll n,  ll k)
{#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define ll long long
#define ull unsigned long long
#define all(a)       (a).begin(),(a).end()
#define rep(i,a,n)   for(ll i=a ; i<n ; i++)
#define repn(n)   for(ll i=0 ; i<n ; i++)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define MAXN   1000001
#define f first
#define sec second

ull mod = 1e9+7;
ull ncr( ll n,  ll k)
{
    ull res = 1;

    // Since C(n, k) = C(n, n-k)
    if ( k > n - k )
        k = n - k;

    // Calculate value of
    // [n * (n-1) *---* (n-k+1)] / [k * (k-1) *----* 1]
    for (ll i = 0; i < k; ++i)
    {
        res *= (n - i);
        res /= (i + 1);
        res = res;
    }

    return res;
}
bool prime(ull num)
{
    bool flag=true;
    for(ull i = 2; i*i <= num ; i++)
    {
        if(num % i == 0)
        {
            flag = false;
            break;
        }
    }
    return flag;
}
ll ipow(ll base, ll exp)
{
    ll result = 1;
    for (;;)
    {
        if (exp & 1)
        {
            result *= base;
            result = result%mod;
        }
        exp >>= 1;
        if (!exp)
            break;
        base *= base;
        base = base%mod;
    }

    return result%mod;
}
ll abs(ll a,ll b)
{
    if((a-b)>0)
        return (a-b);
    else
        return (b-a);
}
ll MOD =  998244353;
ll add(ll a, ll b)
{
    a += b;
    if (a >= MOD)
        a -= MOD;
    if (a < 0)
        a += MOD;
    return a;
}
ll gcd(ll a, ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}

ll der(ll k)
{
    ll res=0;
    ll fact=1;
    for(ll i=2; i<=k; i++)
        fact *= i;
    ll s=1;
    ll j=1;
    for(ll i=2; i<=k; i++)
    {
        j = j*i;
        ll first = (fact/j)*s;
        res += first;
        s = s*-1;
    }
    return res;
}

////////////////////////////////////////////////////////////////////////////////////////////
vector<int> v[1000];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n,k;cin>>n>>k;
    int a,b,c,d;cin>>a>>b>>c>>d;
    if(k<n+1)
    {
        cout<<"-1";
        return 0;
    }
    int node;
    if(n==4){
        cout<<"-1";
        return 0;
    }
    for(int i=1;i<=n;i++){
        if(i==a||i==b||i==c||i==d)
        {
            continue;
        }
        node = i;
        break;
    }
    cout<<node<<endl;
    if(n==5){
        cout<<a<<" "<<c<<" "<<node<<" "<<d<<" "<<b<<endl;
        cout<<c<<" "<<a<<" "<<node<<" "<<b<<" "<<d<<endl;
        return 0;
    }
    int n1 = node,n2;
    for(int i=1;i<=n;i++){
        if(i==a||i==b||i==c||i==d||i==node)
        {
            continue;
        }
        v[n1].pb(i);
        n1=i;
    }
//    v[a].pb(c);
//    v[c].pb(a);
//    v[a].pb(node);
//    v[c].pb(node);
//    v[d].pb(b);
//    v[b].pb(d);
//    v[n1].pb(b);
//    v[n1].pb(d);

    cout<<a<<" "<<c<<" ";
    bool visit[n+1];
    visit[a]=true;
    visit[b]=true;
   n2 = node;
    while(node!=n1){
        cout<<node<<" ";
        visit[node]=true;
        node = v[node][0];

    }
    cout<<n1<<" ";
    cout<<d<<" "<<b;
    cout<<endl;
    cout<<c<<" "<<a<<" ";
    while(n1!=n2){
       cout<<n2<<" ";
       n2 = v[n2][0];
    }
    cout<<n1<<" ";
   cout<<b<<" "<<d;
}

    ull res = 1;

    // Since C(n, k) = C(n, n-k)
    if ( k > n - k )
        k = n - k;

    // Calculate value of
    // [n * (n-1) *---* (n-k+1)] / [k * (k-1) *----* 1]
    for (ll i = 0; i < k; ++i)
    {
        res *= (n - i);
        res /= (i + 1);
        res = res;
    }

    return res;
}
bool prime(ull num)
{
    bool flag=true;
    for(ull i = 2; i*i <= num ; i++)
    {
        if(num % i == 0)
        {
            flag = false;
            break;
        }
    }
    return flag;
}
ll ipow(ll base, ll exp)
{
    ll result = 1;
    for (;;)
    {
        if (exp & 1)
        {
            result *= base;
            result = result%mod;
        }
        exp >>= 1;
        if (!exp)
            break;
        base *= base;
        base = base%mod;
    }

    return result%mod;
}
ll abs(ll a,ll b)
{
    if((a-b)>0)
        return (a-b);
    else
        return (b-a);
}
ll MOD =  998244353;
ll add(ll a, ll b)
{
    a += b;
    if (a >= MOD)
        a -= MOD;
    if (a < 0)
        a += MOD;
    return a;
}
ll gcd(ll a, ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}

ll der(ll k)
{
    ll res=0;
    ll fact=1;
    for(ll i=2; i<=k; i++)
        fact *= i;
    ll s=1;
    ll j=1;
    for(ll i=2; i<=k; i++)
    {
        j = j*i;
        ll first = (fact/j)*s;
        res += first;
        s = s*-1;
    }
    return res;
}

////////////////////////////////////////////////////////////////////////////////////////////
vector<int> v[1000];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n,k;cin>>n>>k;
    int a,b,c,d;cin>>a>>b>>c>>d;
    if(k<n+1)
    {
        cout<<"-1";
        return 0;
    }
    int node;
    for(int i=1;i<=n;i++){
        if(i==a||i==b||i==c||i==d)
        {
            continue;
        }
        node = i;
        break;
    }
    if(n==5){
        cout<<a<<" "<<c<<" "<<node<<" "<<d<<" "<<b<<endl;
        cout<<c<<" "<<a<<" "<<node<<" "<<b<<" "<<d<<endl;
        return 0;
    }
    int n1 = node,n2;
    for(int i=1;i<=n;i++){
        if(i==a||i==b||i==c||i==d||i==node)
        {
            continue;
        }
        v[n1].pb(i);
        n1=i;
    }
//    v[a].pb(c);
//    v[c].pb(a);
//    v[a].pb(node);
//    v[c].pb(node);
//    v[d].pb(b);
//    v[b].pb(d);
//    v[n1].pb(b);
//    v[n1].pb(d);

    cout<<a<<" "<<c<<" ";
    bool visit[n+1];
    visit[a]=true;
    visit[b]=true;
   n2 = node;
    while(node!=n1){
        cout<<node<<" ";
        visit[node]=true;
        node = v[node][0];

    }
    cout<<n1<<" ";
    cout<<d<<" "<<b;
    cout<<endl;
    cout<<c<<" "<<a<<" ";
    while(n1!=n2){
       cout<<n2<<" ";
       n2 = v[n2][0];
    }
    cout<<n1<<" ";
   cout<<b<<" "<<d;
}


#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define ll long long
#define ull unsigned long long
#define all(a)       (a).begin(),(a).end()
#define rep(i,a,n)   for(ll i=a ; i<n ; i++)
#define repn(n)   for(ll i=0 ; i<n ; i++)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define MAXN   1000001
#define f first
#define sec second

ull mod = 1e9+7;
ull ncr( ll n,  ll k)
{
    ull res = 1;

    // Since C(n, k) = C(n, n-k)
    if ( k > n - k )
        k = n - k;

    // Calculate value of
    // [n * (n-1) *---* (n-k+1)] / [k * (k-1) *----* 1]
    for (ll i = 0; i < k; ++i)
    {
        res *= (n - i);
        res /= (i + 1);
        res = res;
    }

    return res;
}
bool prime(ull num)
{
    bool flag=true;
    for(ull i = 2; i*i <= num ; i++)
    {
        if(num % i == 0)
        {
            flag = false;
            break;
        }
    }
    return flag;
}
ll ipow(ll base, ll exp)
{
    ll result = 1;
    for (;;)
    {
        if (exp & 1)
        {
            result *= base;
            result = result%mod;
        }
        exp >>= 1;
        if (!exp)
            break;
        base *= base;
        base = base%mod;
    }

    return result%mod;
}
ll abs(ll a,ll b)
{
    if((a-b)>0)
        return (a-b);
    else
        return (b-a);
}
ll MOD =  998244353;
ll add(ll a, ll b)
{
    a += b;
    if (a >= MOD)
        a -= MOD;
    if (a < 0)
        a += MOD;
    return a;
}
ll gcd(ll a, ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}

ll der(ll k)
{
    ll res=0;
    ll fact=1;
    for(ll i=2; i<=k; i++)
        fact *= i;
    ll s=1;
    ll j=1;
    for(ll i=2; i<=k; i++)
    {
        j = j*i;
        ll first = (fact/j)*s;
        res += first;
        s = s*-1;
    }
    return res;
}

////////////////////////////////////////////////////////////////////////////////////////////
vector<int> v[1000];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n,k;cin>>n>>k;
    int a,b,c,d;cin>>a>>b>>c>>d;
    if(k<n+1)
    {
        cout<<"-1";
        return 0;
    }
    int node;
    for(int i=1;i<=n;i++){
        if(i==a||i==b||i==c||i==d)
        {
            continue;
        }
        node = i;
        break;
    }
    if(n==5){
        cout<<a<<" "<<c<<" "<<node<<" "<<d<<" "<<b<<endl;
        cout<<c<<" "<<a<<" "<<node<<" "<<b<<" "<<d<<endl;
        return 0;
    }
    int n1 = node,n2;
    for(int i=1;i<=n;i++){
        if(i==a||i==b||i==c||i==d||i==node)
        {
            continue;
        }
        v[n1].pb(i);
        n1=i;
    }
//    v[a].pb(c);
//    v[c].pb(a);
//    v[a].pb(node);
//    v[c].pb(node);
//    v[d].pb(b);
//    v[b].pb(d);
//    v[n1].pb(b);
//    v[n1].pb(d);

    cout<<a<<" "<<c<<" ";
    bool visit[n+1];
    visit[a]=true;
    visit[b]=true;
   n2 = node;
    while(node!=n1){
        cout<<node<<" ";
        visit[node]=true;
        node = v[node][0];

    }
    cout<<n1<<" ";
    cout<<d<<" "<<b;
    cout<<endl;
    cout<<c<<" "<<a<<" ";
    while(n1!=n2){
       cout<<n2<<" ";
       n2 = v[n2][0];
    }
    cout<<n1<<" ";
   cout<<b<<" "<<d;
}


#include<bits/stdc++.h>
using namespace std;
int n,a,b,c,d,m;
bool valid(int x){return (x!=a && x!=b && x!=d && x!=c?true:false);}
int main(){
	cin>>n>>m;
	cin>>a>>b>>c>>d;
	if(m<n+1 || n==4){cout<<-1;return 0;}
	cout<<a<<" "<<c<<" ";
	for(int i=1;i<=n;i++)
		if(valid(i))cout<<i<<" ";
	cout<<d<<" "<<b<<endl;
	cout<<c<<" "<<a<<" ";
	for(int i=1;i<=n;i++)
		if(valid(i))cout<<i<<" ";
	cout<<b<<" "<<d;
}


#include<bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(false); cin.tie(nullptr); cout.precision(10); cout << fixed;
#define endl "\n"
#define big long long
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<end

template<class T> bool sin(T &a, T b){return a > b ? (a = b, true) : false;}
template<class T> bool sax(T &a, T b){return a < b ? (a = b, true) : false;}

int main()
{
	IOS;
	#ifdef LOCAL
	freopen("input.txt","rt",stdin);
	#endif

	int n,k,a,b,c,d;
	cin >> n >> k >> a >> b >> c >> d;
	if(k <= n or n <= 4)
		return cout << -1,0;
	vector<int> ans(n);
	for(int i = 0; i < n; i++)
		ans[i] = i+1;
	auto it = find(ans.begin(),ans.end(),a);
	int ind = it-ans.begin();
	swap(ans[0],ans[ind]);
	it = find(ans.begin(),ans.end(),b);
	ind = it-ans.begin();
	swap(ans[n-2],ans[ind]);
	it = find(ans.begin(),ans.end(),c);
	ind = it-ans.begin();
	swap(ans[1],ans[ind]);
	it = find(ans.begin(),ans.end(),d);
	ind = it-ans.begin();
	swap(ans[n-1],ans[ind]);
	for(int i = 0; i < n; i++)
	{
		if(i == n-2)
		{
			cout << ans[n-1] <<" "<<ans[n-2]<<endl;
			break;
		}
	 	cout << ans[i] <<" ";
	}
	swap(ans[0],ans[1]);
	for(int i = 0; i < n; i++)
		cout << ans[i] <<" ";
	cout << endl;
	#ifdef LOCAL
	cerr << "Time elapsed : " << 1.0*clock()/CLOCKS_PER_SEC << " s.\n";
	#endif
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(false); cin.tie(nullptr); cout.precision(10); cout << fixed;
#define endl "\n"
#define big long long
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<end

template<class T> bool sin(T &a, T b){return a > b ? (a = b, true) : false;}
template<class T> bool sax(T &a, T b){return a < b ? (a = b, true) : false;}

int main()
{
	IOS;
	#ifdef LOCAL
	freopen("input.txt","rt",stdin);
	#endif

	int n,k,a,b,c,d;
	cin >> n >> k >> a >> b >> c >> d;
	if(k < n+1)
		return cout << -1,0;
	vector<int> ans(n);
	for(int i = 0; i < n; i++)
		ans[i] = i+1;
	auto it = find(ans.begin(),ans.end(),a);
	int ind = it-ans.begin();
	swap(ans[0],ans[ind]);
	it = find(ans.begin(),ans.end(),b);
	ind = it-ans.begin();
	swap(ans[n-2],ans[ind]);
	it = find(ans.begin(),ans.end(),c);
	ind = it-ans.begin();
	swap(ans[1],ans[ind]);
	it = find(ans.begin(),ans.end(),d);
	ind = it-ans.begin();
	swap(ans[n-1],ans[ind]);
	for(int i = 0; i < n; i++)
	{
		if(i == n-2)
		{
			cout << ans[n-1] <<" "<<ans[n-2]<<endl;
			break;
		}
	 	cout << ans[i] <<" ";
	}
	swap(ans[0],ans[1]);
	for(int i = 0; i < n; i++)
		cout << ans[i] <<" ";
	cout << endl;
	#ifdef LOCAL
	cerr << "Time elapsed : " << 1.0*clock()/CLOCKS_PER_SEC << " s.\n";
	#endif
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(false); cin.tie(nullptr); cout.precision(10); cout << fixed;
#define endl "\n"
#define big long long
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<end

template<class T> bool sin(T &a, T b){return a > b ? (a = b, true) : false;}
template<class T> bool sax(T &a, T b){return a < b ? (a = b, true) : false;}

int main()
{
	IOS;
	#ifdef LOCAL
	freopen("input.txt","rt",stdin);
	#endif

	int n,k,a,b,c,d;
	cin >> n >> k >> a >> b >> c >> d;
	if(k <= n+1)
		return cout << -1,0;
	vector<int> ans(n);
	for(int i = 0; i < n; i++)
		ans[i] = i+1;
	auto it = find(ans.begin(),ans.end(),a);
	int ind = it-ans.begin();
	swap(ans[0],ans[ind]);
	it = find(ans.begin(),ans.end(),b);
	ind = it-ans.begin();
	swap(ans[n-2],ans[ind]);
	it = find(ans.begin(),ans.end(),c);
	ind = it-ans.begin();
	swap(ans[1],ans[ind]);
	it = find(ans.begin(),ans.end(),d);
	ind = it-ans.begin();
	swap(ans[n-1],ans[ind]);
	for(int i = 0; i < n; i++)
	{
		if(i == n-2)
		{
			cout << ans[n-1] <<" "<<ans[n-2]<<endl;
			break;
		}
	 	cout << ans[i] <<" ";
	}
	swap(ans[0],ans[1]);
	for(int i = 0; i < n; i++)
		cout << ans[i] <<" ";
	cout << endl;
	#ifdef LOCAL
	cerr << "Time elapsed : " << 1.0*clock()/CLOCKS_PER_SEC << " s.\n";
	#endif
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(false); cin.tie(nullptr); cout.precision(10); cout << fixed;
#define endl "\n"
#define big long long
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<end

template<class T> bool sin(T &a, T b){return a > b ? (a = b, true) : false;}
template<class T> bool sax(T &a, T b){return a < b ? (a = b, true) : false;}

int main()
{
	IOS;
	#ifdef LOCAL
	freopen("input.txt","rt",stdin);
	#endif

	int n,k,a,b,c,d;
	cin >> n >> k >> a >> b >> c >> d;
	if(k <= n or n <= 4)
		return cout << -1,0;
	if(k <= n+1)
		return cout << -1,0;
	vector<int> ans(n);
	for(int i = 0; i < n; i++)
		ans[i] = i+1;
	auto it = find(ans.begin(),ans.end(),a);
	int ind = it-ans.begin();
	swap(ans[0],ans[ind]);
	it = find(ans.begin(),ans.end(),b);
	ind = it-ans.begin();
	swap(ans[n-2],ans[ind]);
	it = find(ans.begin(),ans.end(),c);
	ind = it-ans.begin();
	swap(ans[1],ans[ind]);
	it = find(ans.begin(),ans.end(),d);
	ind = it-ans.begin();
	swap(ans[n-1],ans[ind]);
	for(int i = 0; i < n; i++)
	{
		if(i == n-2)
		{
			cout << ans[n-1] <<" "<<ans[n-2]<<endl;
			break;
		}
	 	cout << ans[i] <<" ";
	}
	swap(ans[0],ans[1]);
	for(int i = 0; i < n; i++)
		cout << ans[i] <<" ";
	cout << endl;
	#ifdef LOCAL
	cerr << "Time elapsed : " << 1.0*clock()/CLOCKS_PER_SEC << " s.\n";
	#endif
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

vector<long long>adj[2000];

int main(){

long long i,n,a,b,c,j,k,prev,d,p1,p2;

cin>>n>>k;
cin>>a>>b>>c>>d;

if((k<(n+1))||(n==4)){
cout<<-1<<endl;
return 0;}

adj[a].push_back(c);
adj[c].push_back(a);

adj[d].push_back(b);
adj[b].push_back(d);

k=c;

for(i=1;i<=n;i++)
if((i!=a)&&(i!=b)&&(i!=c)&&(i!=d)){
adj[k].push_back(i);
adj[i].push_back(k);
k=i;}

adj[k].push_back(d);
adj[d].push_back(k);

k=a;

while(k!=b){
cout<<k<<" ";

if(adj[k].size()==1){
prev=k;
k=adj[k][0];}

else{

if(adj[k][0]!=prev){
prev=k;
k=adj[k][0];}

else{
prev=k;
k=adj[k][1];}}}

cout<<b<<endl;

if(adj[c][0]==a)
p1=adj[c][1];

else
p1=adj[c][0];

if(adj[d][0]==b)
p2=adj[d][1];

else
p2=adj[d][0];

cout<<c<<" "<<a<<" ";

k=p1;
prev=c;

while(k!=p2){
cout<<k<<" ";

if(adj[k].size()==1){
prev=k;
k=adj[k][0];}

else{

if(adj[k][0]!=prev){
prev=k;
k=adj[k][0];}

else{
prev=k;
k=adj[k][1];}}}

cout<<p2<<" ";
cout<<b<<" "<<d<<endl;

return 0;}


#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <cmath>
#include <tuple>
#include <cstdio>
#include <bitset>
#include <sstream>
#include <iterator>
#include <numeric>
#include <map>
#include <cstring>
#include <set>
#include <functional>
#include <iomanip>

using namespace std;

#define DEBUG_ //!!提出時にコメントアウト!!
#ifdef DEBUG_
	#define dump(x)  cerr << #x << " = " << (x) << endl;
#else
	#define dump(x)  ;
#endif

#define equals(a,b) (fabs((a)-(b)) < EPS)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define SZ(x) ((int)(x).size())
#define pb push_back
#define eb emplace_back

//#define int long long

typedef long long LL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;

template <typename T>
std::string printVector(const std::vector<T> &data)
{
    std::stringstream ss;
    std::ostream_iterator<T> out_it(ss, ", ");
    ss << "[";
    std::copy(data.begin(), data.end() - 1, out_it);
    ss << data.back() << "]";
    return ss.str();
}

template <typename T>
void print_array(const T &ary, int size){
    REP(i,size){
        cout << ary[i] << " ";
    }
    cout << endl;
}

const int MOD = 1e9+7;
const LL LINF = 1001002003004005006ll;
const int INF = 1001001001;
const double EPS = (1e-10);

signed main(int argc, char const *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << setprecision(12);

    int N,K; cin >> N >> K;
    int A,B,C,D; cin >> A >> B >> C >> D;
    if(N == 4 || K < N+1){
        cout << -1 << endl;
        return 0;
    }
    VI used(N+1);
    used[A] = used[B] = used[C] = used[D] = 1;
    cout << A << " " << C;
    FOR(i,1,N+1){
        if(used[i]) continue;
        cout << " " << i;
    }
    cout <<" " <<  D << " " << B;
    cout << endl;

    cout << C << " " << A;
    FOR(i,1,N+1){
        if(used[i]) continue;
        cout << " " << i;
    }
    cout <<" "<< B << " " << D;
    cout << endl;

}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;

template <typename K, typename V = __gnu_pbds::null_type>
using tree = __gnu_pbds::tree<K, V, less<K>, __gnu_pbds::rb_tree_tag, __gnu_pbds::tree_order_statistics_node_update>;
using llong = long long;
auto sz = [](const auto& c) { return int(c.size());};

mt19937 rng((size_t) make_shared<char>().get());

int main() {
#ifdef VSE
    freopen("input.txt", "r", stdin);
    rng.seed(0);
#endif
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

    int n, k;
    cin >> n >> k;
    int a, b, c, d;
    cin >> a >> b >> c >> d;

    if (n < 5 || k < n + 1) {
        cout << -1;
        return 0;
    }

    cout << a << " " << c;
    for (int i = 1; i <= n; i++) {
        if (i != a && i != b && i != c && i != d) {
            cout << " " << i;
        }
    }

    cout << " " << d << " " << b << "\n";
    cout << c << " " << a;
    for (int i = 1; i <= n; i++) {
        if (i != a && i != b && i != c && i != d) {
            cout << " " << i;
        }
    }
    cout << " " << b << " " << d << "\n";

    return 0;
}//kubpdc


#include <bits/stdc++.h>
#define li long int
#define lli long long int
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define si size()
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define lb lower_bound
#define ub upper_bound
#define pll pair < long long, long long >
#define pii pair < int, int>
#define vi vector < int >
#define vvi vector < vector < int > >
#define vlli vector < lli >
#define vvlli vector < vector < lli > >

lli mod=1e9+7;

using namespace std;

int main()
{
    fastio;
	int i,n,k,a,b,c,d;
	cin>>n>>k>>a>>b>>c>>d;
	if(n==4 || k<n+1)	{	cout<<"-1";	exit(0);	}
	vi pt;
	set<int> s;
	set< int> :: iterator it;
	for(i=1;i<=n;i++)	s.insert(i);
	s.erase(a);	s.erase(b);	s.erase(c);	s.erase(d);
	cout<<a<<" "<<c<<" ";	pt.pb(a);	pt.pb(c);
	it=s.begin();	cout<<(*it)<<" ";	pt.pb(*it);	s.erase(*it);
	cout<<d<<" ";	pt.pb(d);
	for(it=s.begin(); it!=s.end(); ++it)
	{
		cout<<(*it)<<" ";
		pt.pb(*it);
	}
	cout<<b<<"\n";	pt.pb(b);
	cout<<c<<" "<<a<<" ";
	cout<<pt[2]<<" ";
	for(i=pt.size()-1; i>=3;i--)	cout<<pt[i]<<" ";
}


#include<bits/stdc++.h>
using namespace std;
#define int long long
#define ld long double
#define pb push_back
#define pa pair<int,int>
#define v1d vector<int>
#define v2d vector<vector<int>>
#define M 1000000007
#define mp make_pair
#define x first
#define y second
#define ump map<int,int>
#define endl "\n"
#define v1s vector<string>
#define S(v) sort(v.begin(),v.end())
#define mxpq priority_queue <int>
#define mnpq priority_queue<int,vector<int>,greater<int>>
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

int32_t main(){

    int n,k;cin>>n>>k;

    if( n <= 4  || k <= n){

        cout<<-1<<endl;
        return  0;
    }

    int a,b,c,d;
    cin>>a>>b>>c>>d;

    cout<<a<<" "<<c<<" ";
    for(int i = 1 ; i <= n  ;i++){

        if(i==a || i==b || i==c || i==d){
            continue;
        }

        cout<<i<<" ";
    }

    cout<<d<<" "<<b<<endl;

    cout<<c<<" "<<a<<" ";
    for(int i = 1 ; i <= n  ;i++){

        if(i==a || i==b || i==c || i==d){
            continue;
        }

        cout<<i<<" ";
    }

    cout<<b<<" "<<d<<endl;

}


    #include <bits/stdc++.h>
    #include <cstdio>
    #include <cstring>
    #include <cmath>
    #include <cstring>
    #include <chrono>
    #include <complex>
    #define endl "\n"
    #define int long long int
    #define vi vector<int>
    #define vll vector<ll>
    #define vvi vector < vi >
    #define pii pair<int,int>
    #define pll pair<long long, long long>
    #define mod 1000000007
    #define inf 1000000000000000001;
    #define all(c) c.begin(),c.end()
    #define mp(x,y) make_pair(x,y)
    #define mem(a,val) memset(a,val,sizeof(a))
    #define eb emplace_back
    #define f first
    #define s second

    using namespace std;
int power(int base, int exp)
{
    if (exp == 0)
       return 1;
    else if (exp == 1)
       return base;
    else
    {
        int calc;
       if (exp % 2 == 0)
       {
         calc = power(base, exp/2);
         calc =(calc* calc)%mod;
       }
       else
       {
         calc = (base*power(base, exp-1))%mod;
       }
       return calc%mod;
    }
}
    int32_t main()
    {
        std::ios::sync_with_stdio(false);
        int n,m;
        cin>>n>>m;
        int a,b,c,d;
        cin>>a>>b>>c>>d;
        if(n>=m || n<=4)
            cout<<-1<<endl;
        else{
            cout<<a<<" "<<c<<" ";
            for(int i=1;i<=n;i++)
            {

                if(i!=a && i!=b && i!=c && i!=d)
                    cout<<i<<" ";
            }
            cout<<b<<" "<<d<<endl;
            cout<<c<<" "<<a<<" ";
            for(int i=1;i<=n;i++)
            {

                if(i!=c && i!=d && i!=a && i!=b)
                    cout<<i<<" ";
            }
            cout<<b<<" "<<d<<endl;
        }
        return 0;
    }


    #include <bits/stdc++.h>
    #include <cstdio>
    #include <cstring>
    #include <cmath>
    #include <cstring>
    #include <chrono>
    #include <complex>
    #define endl "\n"
    #define int long long int
    #define vi vector<int>
    #define vll vector<ll>
    #define vvi vector < vi >
    #define pii pair<int,int>
    #define pll pair<long long, long long>
    #define mod 1000000007
    #define inf 1000000000000000001;
    #define all(c) c.begin(),c.end()
    #define mp(x,y) make_pair(x,y)
    #define mem(a,val) memset(a,val,sizeof(a))
    #define eb emplace_back
    #define f first
    #define s second

    using namespace std;
int power(int base, int exp)
{
    if (exp == 0)
       return 1;
    else if (exp == 1)
       return base;
    else
    {
        int calc;
       if (exp % 2 == 0)
       {
         calc = power(base, exp/2);
         calc =(calc* calc)%mod;
       }
       else
       {
         calc = (base*power(base, exp-1))%mod;
       }
       return calc%mod;
    }
}
    int32_t main()
    {
        std::ios::sync_with_stdio(false);
        int n,m;
        cin>>n>>m;
        int a,b,c,d;
        cin>>a>>b>>c>>d;
        if(n>=m || n<=4)
            cout<<-1<<endl;
        else{
            cout<<a<<" ";
            for(int i=1;i<=n;i++)
            {

                if(i!=a && i!=b)
                    cout<<i<<" ";
            }
            cout<<b<<endl;
            cout<<c<<" ";
            for(int i=1;i<=n;i++)
            {

                if(i!=c && i!=d)
                    cout<<i<<" ";
            }
            cout<<d<<endl;
        }
        return 0;
    }


    #include <bits/stdc++.h>
    #include <cstdio>
    #include <cstring>
    #include <cmath>
    #include <cstring>
    #include <chrono>
    #include <complex>
    #define endl "\n"
    #define int long long int
    #define vi vector<int>
    #define vll vector<ll>
    #define vvi vector < vi >
    #define pii pair<int,int>
    #define pll pair<long long, long long>
    #define mod 1000000007
    #define inf 1000000000000000001;
    #define all(c) c.begin(),c.end()
    #define mp(x,y) make_pair(x,y)
    #define mem(a,val) memset(a,val,sizeof(a))
    #define eb emplace_back
    #define f first
    #define s second

    using namespace std;
int power(int base, int exp)
{
    if (exp == 0)
       return 1;
    else if (exp == 1)
       return base;
    else
    {
        int calc;
       if (exp % 2 == 0)
       {
         calc = power(base, exp/2);
         calc =(calc* calc)%mod;
       }
       else
       {
         calc = (base*power(base, exp-1))%mod;
       }
       return calc%mod;
    }
}
    int32_t main()
    {
        std::ios::sync_with_stdio(false);
        int n,m;
        cin>>n>>m;
        int a,b,c,d;
        cin>>a>>b>>c>>d;
        if(n>=m || n<=4)
            cout<<-1<<endl;
        else{
            cout<<a<<" "<<c<<" ";
            for(int i=1;i<=n;i++)
            {

                if(i!=a && i!=b && i!=c && i!=d)
                    cout<<i<<" ";
            }
            cout<<d<<" "<<b<<endl;
            cout<<c<<" "<<a<<" ";
            for(int i=1;i<=n;i++)
            {

                if(i!=c && i!=d && i!=a && i!=b)
                    cout<<i<<" ";
            }
            cout<<b<<" "<<d<<endl;
        }
        return 0;
    }


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;

template <typename K, typename V = __gnu_pbds::null_type>
using tree = __gnu_pbds::tree<K, V, less<K>, __gnu_pbds::rb_tree_tag, __gnu_pbds::tree_order_statistics_node_update>;
using llong = long long;
auto sz = [](const auto& c) { return int(c.size());};

mt19937 rng((size_t) make_shared<char>().get());

int main() {
#ifdef VSE
    freopen("input.txt", "r", stdin);
    rng.seed(0);
#endif
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

    int n, k;
    cin >> n >> k;
    int a, b, c, d;
    cin >> a >> b >> c >> d;

    if (n < 5 || k < n + 1) {
        cout << -1;
        return 0;
    }

    cout << a << " " << c;
    for (int i = 1; i <= n; i++) {
        if (i != a && i != b && i != c && i != d) {
            cout << " " << i;
        }
    }

    cout << " " << d << " " << b << "\n";
    cout << c << " " << a;
    for (int i = 1; i <= n; i++) {
        if (i != a && i != b && i != c && i != d) {
            cout << " " << i;
        }
    }
    cout << " " << b << " " << d << "\n";

    return 0;
}


// Daritys Morgho ban Rovegrie
// Math = ♥
// Sometimes it is people that no one imagines anything of who do things that no one can imagine
// After all this time? Always

#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>		// uncomment before submission
//#include <ext/pb_ds/tree_policy.hpp>			// uncomment before submission
//using namespace __gnu_pbds;					// uncomment before submission
using namespace std;
//<---------------------------------------------------Template----------------------------------------------------------->
#define int long long
#define ll long long
#define ld long double
const int INF = 1e18 + 7;
const int MAX = 1e5 + 7;
const int MOD = 1e9 + 7;
typedef pair<ll, ll> ii;
typedef vector<ll> vi;                  // Vector of long long
typedef vector<vi> vvi;                 // Vector of vi
typedef vector<ii> vii;                 // Vector of pairs
typedef vector<vii> vvii;               // Vector of Vector of pairs
typedef vector<bool> vb;                // Vector of bool
#define pq priority_queue               // Max heap (To convert to min heap, use negative sign before every value)
#define ff first                        // For pairs
#define ss second                       // For pairs
#define pb push_back                    // Push back to vector
#define mp make_pair                    // Makes pairs to be stored as pair
#define endl "\n"                       // Changes endl to \n
#define all(c) (c).begin(), (c).end()   // Mainly used by me in sorting
#define range(c, r) (c).begin(), (c).begin() + (r)                // Mainly used in sorting
#define present(c, x) ((c).find(x) != (c).end())                  // for sets, maps, multi-maps
#define cpresent(c, x) (find(all(c),x) != (c).end())              // for vectors
#define testcases(T) int (T); cin>>(T); while((T)--)              // inputing testcases
#define run(x, c) for((x)=(c).begin(); (x)!=(c).end(); (x)++)     // Mainly used by me for range based loops
// ordered_set adds two new functions to set - (set).find_by_order([kth element based on zero indexing]) and order_of_key()
// order_of_key returns number of elements less that parameter. If element exists, that order is its index
#define ordered_set tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update>
//<----------------------------------------------------------------------------------------------------------------------->

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n, k, a, b, c, d;
    cin >> n >> k >> a >> b >> c >> d;

    if (abs(k - n) == 0 || k - n == 1 || n == 4)
    {
        cout << -1 << endl;
        return 0;
    }

    vi v;
    v.pb(a), v.pb(d);
    for (int i = 1; i <= n; i++)
    {
        if (i == a || i == b || i == c || i == d) continue;
        v.pb(i);
    }

    v.pb(c), v.pb(b);
    for (int i = 0; i < n; i++) cout << v[i] << " ";
    cout << endl;

    vi check;
    for (int i = n - 2; i <= n; i++) check.pb(v[i]);
    for (int i = n - 3; i > 1; i--) check.pb(v[i]);
    for (int i = 0; i < 2; i++) check.pb(v[i]);

    for (auto i: check) cout << i << " ";
    cout << endl;
    return 0;
}


// Daritys Morgho ban Rovegrie
// Math = ♥
// Sometimes it is people that no one imagines anything of who do things that no one can imagine
// After all this time? Always

#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>		// uncomment before submission
//#include <ext/pb_ds/tree_policy.hpp>			// uncomment before submission
//using namespace __gnu_pbds;					// uncomment before submission
using namespace std;
//<---------------------------------------------------Template----------------------------------------------------------->
#define int long long
#define ll long long
#define ld long double
const int INF = 1e18 + 7;
const int MAX = 1e5 + 7;
const int MOD = 1e9 + 7;
typedef pair<ll, ll> ii;
typedef vector<ll> vi;                  // Vector of long long
typedef vector<vi> vvi;                 // Vector of vi
typedef vector<ii> vii;                 // Vector of pairs
typedef vector<vii> vvii;               // Vector of Vector of pairs
typedef vector<bool> vb;                // Vector of bool
#define pq priority_queue               // Max heap (To convert to min heap, use negative sign before every value)
#define ff first                        // For pairs
#define ss second                       // For pairs
#define pb push_back                    // Push back to vector
#define mp make_pair                    // Makes pairs to be stored as pair
#define endl "\n"                       // Changes endl to \n
#define all(c) (c).begin(), (c).end()   // Mainly used by me in sorting
#define range(c, r) (c).begin(), (c).begin() + (r)                // Mainly used in sorting
#define present(c, x) ((c).find(x) != (c).end())                  // for sets, maps, multi-maps
#define cpresent(c, x) (find(all(c),x) != (c).end())              // for vectors
#define testcases(T) int (T); cin>>(T); while((T)--)              // inputing testcases
#define run(x, c) for((x)=(c).begin(); (x)!=(c).end(); (x)++)     // Mainly used by me for range based loops
// ordered_set adds two new functions to set - (set).find_by_order([kth element based on zero indexing]) and order_of_key()
// order_of_key returns number of elements less that parameter. If element exists, that order is its index
#define ordered_set tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update>
//<----------------------------------------------------------------------------------------------------------------------->

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n, k, a, b, c, d;
    cin >> n >> k >> a >> b >> c >> d;

    if (k == n || n == 4 || k == n - 1)
    {
        cout << -1 << endl;
        return 0;
    }

    vi v;
    v.pb(a), v.pb(d);
    for (int i = 1; i <= n; i++)
    {
        if (i == a || i == b || i == c || i == d) continue;
        v.pb(i);
    }

    v.pb(c), v.pb(b);
    for (int i = 0; i < n; i++) cout << v[i] << " ";
    cout << endl;

    vi check;
    for (int i = n - 2; i < n; i++) check.pb(v[i]);
    for (int i = n - 3; i > 1; i--) check.pb(v[i]);
    for (int i = 0; i < 2; i++) check.pb(v[i]);

    for (auto i: check) cout << i << " ";
    cout << endl;
    return 0;
}


// Daritys Morgho ban Rovegrie
// Math = ♥
// Sometimes it is people that no one imagines anything of who do things that no one can imagine
// After all this time? Always

#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>		// uncomment before submission
//#include <ext/pb_ds/tree_policy.hpp>			// uncomment before submission
//using namespace __gnu_pbds;					// uncomment before submission
using namespace std;
//<---------------------------------------------------Template----------------------------------------------------------->
#define int long long
#define ll long long
#define ld long double
const int INF = 1e18 + 7;
const int MAX = 1e5 + 7;
const int MOD = 1e9 + 7;
typedef pair<ll, ll> ii;
typedef vector<ll> vi;                  // Vector of long long
typedef vector<vi> vvi;                 // Vector of vi
typedef vector<ii> vii;                 // Vector of pairs
typedef vector<vii> vvii;               // Vector of Vector of pairs
typedef vector<bool> vb;                // Vector of bool
#define pq priority_queue               // Max heap (To convert to min heap, use negative sign before every value)
#define ff first                        // For pairs
#define ss second                       // For pairs
#define pb push_back                    // Push back to vector
#define mp make_pair                    // Makes pairs to be stored as pair
#define endl "\n"                       // Changes endl to \n
#define all(c) (c).begin(), (c).end()   // Mainly used by me in sorting
#define range(c, r) (c).begin(), (c).begin() + (r)                // Mainly used in sorting
#define present(c, x) ((c).find(x) != (c).end())                  // for sets, maps, multi-maps
#define cpresent(c, x) (find(all(c),x) != (c).end())              // for vectors
#define testcases(T) int (T); cin>>(T); while((T)--)              // inputing testcases
#define run(x, c) for((x)=(c).begin(); (x)!=(c).end(); (x)++)     // Mainly used by me for range based loops
// ordered_set adds two new functions to set - (set).find_by_order([kth element based on zero indexing]) and order_of_key()
// order_of_key returns number of elements less that parameter. If element exists, that order is its index
#define ordered_set tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update>
//<----------------------------------------------------------------------------------------------------------------------->

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n, k, a, b, c, d;
    cin >> n >> k >> a >> b >> c >> d;

    if (k == n || n == 4)
    {
        cout << -1 << endl;
        return 0;
    }

    vi v;
    v.pb(a), v.pb(d);
    for (int i = 1; i <= n; i++)
    {
        if (i == a || i == b || i == c || i == d) continue;
        v.pb(i);
    }

    v.pb(c), v.pb(b);
    for (int i = 0; i < n; i++) cout << v[i] << " ";
    cout << endl;

    vi vv;
    for (int i = n - 2; i < n; i++) vv.pb(v[i]);
    for (int i = n - 3; i > 1; i--) vv.pb(v[i]);
    for (int i = 0; i < 2; i++) vv.pb(v[i]);

    for (auto i: vv) cout << i << " ";
    cout << endl;
    return 0;
}


// Daritys Morgho ban Rovegrie
// Math = ♥
// Sometimes it is people that no one imagines anything of who do things that no one can imagine
// After all this time? Always

#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>		// uncomment before submission
//#include <ext/pb_ds/tree_policy.hpp>			// uncomment before submission
//using namespace __gnu_pbds;					// uncomment before submission
using namespace std;
//<---------------------------------------------------Template----------------------------------------------------------->
#define int long long
#define ll long long
#define ld long double
const int INF = 1e18 + 7;
const int MAX = 1e5 + 7;
const int MOD = 1e9 + 7;
typedef pair<ll, ll> ii;
typedef vector<ll> vi;                  // Vector of long long
typedef vector<vi> vvi;                 // Vector of vi
typedef vector<ii> vii;                 // Vector of pairs
typedef vector<vii> vvii;               // Vector of Vector of pairs
typedef vector<bool> vb;                // Vector of bool
#define pq priority_queue               // Max heap (To convert to min heap, use negative sign before every value)
#define ff first                        // For pairs
#define ss second                       // For pairs
#define pb push_back                    // Push back to vector
#define mp make_pair                    // Makes pairs to be stored as pair
#define endl "\n"                       // Changes endl to \n
#define all(c) (c).begin(), (c).end()   // Mainly used by me in sorting
#define range(c, r) (c).begin(), (c).begin() + (r)                // Mainly used in sorting
#define present(c, x) ((c).find(x) != (c).end())                  // for sets, maps, multi-maps
#define cpresent(c, x) (find(all(c),x) != (c).end())              // for vectors
#define testcases(T) int (T); cin>>(T); while((T)--)              // inputing testcases
#define run(x, c) for((x)=(c).begin(); (x)!=(c).end(); (x)++)     // Mainly used by me for range based loops
// ordered_set adds two new functions to set - (set).find_by_order([kth element based on zero indexing]) and order_of_key()
// order_of_key returns number of elements less that parameter. If element exists, that order is its index
#define ordered_set tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update>
//<----------------------------------------------------------------------------------------------------------------------->

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n, k, a, b, c, d;
    cin >> n >> k >> a >> b >> c >> d;

    if (k == n || n == 4)
    {
        cout << -1 << endl;
        return 0;
    }

    vi v;
    v.pb(a), v.pb(d);
    for (int i = 1; i <= n; i++)
        if (i != a && i != b && i != c && i != d)
            v.pb(i);

    v.pb(c), v.pb(b);
    for (int i = 0; i < n; i++) cout << v[i] << " ";
    cout << endl;

    vi vv;
    for (int i = n - 2; i < n; i++) vv.pb(v[i]);
    for (int i = n - 3; i > 1; i--) vv.pb(v[i]);
    for (int i = 0; i < 2; i++) vv.pb(v[i]);

    for (auto i: vv) cout << i << " ";
    cout << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main(){
    // freopen("input.txt", "r", stdin);
    int tc;
    cin >> tc;
    vector<int>v(tc);
    for( auto &x: v )
        cin >> x;
    int best = 1;
    sort( v.begin(), v.end() );
    for( int target = 1; target <= 200000; target++ ){
        unordered_set<int>s;
        int curr = 0;
        int low = 0, high = v.size()-1;
        while( low < high ){
            if( v[low] + v[high] == target ){
                curr++;
                low++;
                high--;
            }
            else if( v[low] + v[high] < target )
                low++;
            else
                high--;
        }
        best = max( best, curr);
    }
    cout << best << endl;

}


#include <bits/stdc++.h>

#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define sz(a) (int)((a).size())
#define sqr(a) (a) * (a)
#define endl '\n'
#define DBG(a) cout << #a << " := " << a << endl

typedef long long LL;
typedef long double LD;

const int MAX = (int)(1e5);
const int MOD = (int)(1e9) + 7;
const int INF_I = (int)(1e9) + 7;
const LL INF_LL = (long long)(1e18) + 7;

using namespace std;

int n;
map<int, int> mp;

template <typename T> void info(T& a) {
    for (auto &el: a) cout << el << ' ';
    cout << endl;
}

inline int input_I() {
    int a;
    cin >> a;
    return a;
}

inline long long input_LL() {
    long long a;
    cin >> a;
    return a;
}

void boot() {
    #ifdef LOCAL
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif

    ios_base::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
}

void solve() {
    int ans = 0;
    vector<int> v(n);

    for (auto &i: v) cin >> i;

    for (int i = 1; i <= 2 * MAX; ++i) {
        int ans_cur = 0;
        mp.clear();

        for (auto &j: v) ++mp[j];

        for (int &j: v) {
            if (mp[i - j] > 0 && !(j * 2 == i && mp[j] == 1)) {
                --mp[i - j];
                --mp[j];
                ++ans_cur;
            }
        }

        ans = max(ans, ans_cur);
    }

    cout << ans << endl;
}

signed main() {
    boot();
    while (cin >> n) solve();
}


#include <bits/stdc++.h>

#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define sz(a) (int)((a).size())
#define sqr(a) (a) * (a)
#define endl '\n'
#define DBG(a) cout << #a << " := " << a << endl

typedef long long LL;
typedef long double LD;

const int MAX = (int)(1e5);
const int MOD = (int)(1e9) + 7;
const int INF_I = (int)(1e9) + 7;
const LL INF_LL = (long long)(1e18) + 7;

using namespace std;

int n;
int mp[2 * MAX + 1];

template <typename T> void info(T& a) {
    for (auto &el: a) cout << el << ' ';
    cout << endl;
}

inline int input_I() {
    int a;
    cin >> a;
    return a;
}

inline long long input_LL() {
    long long a;
    cin >> a;
    return a;
}

void boot() {
    #ifdef LOCAL
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif

    ios_base::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
}

void solve() {
    int ans = 0;
    vector<int> v(n);

    for (auto &i: v) cin >> i, mp[i] = 1;

    for (int i = 1; i <= 2 * MAX; ++i) {
        int ans_cur = 0;

        for (int &j: v) {
            if (j * 2 == i) continue;

            if (i >= j && mp[i - j]) {
                ++ans_cur;
            }
        }

        ans = max(ans, ans_cur / 2);
    }

    cout << ans << endl;
}

signed main() {
    boot();
    while (cin >> n) solve();
}


#include <bits/stdc++.h>

#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define sz(a) (int)((a).size())
#define sqr(a) (a) * (a)
#define endl '\n'
#define DBG(a) cout << #a << " := " << a << endl

typedef long long LL;
typedef long double LD;

const int MAX = (int)(1e5);
const int MOD = (int)(1e9) + 7;
const int INF_I = (int)(1e9) + 7;
const LL INF_LL = (long long)(1e18) + 7;

using namespace std;

int n;
int mp[2 * MAX + 1];

template <typename T> void info(T& a) {
    for (auto &el: a) cout << el << ' ';
    cout << endl;
}

inline int input_I() {
    int a;
    cin >> a;
    return a;
}

inline long long input_LL() {
    long long a;
    cin >> a;
    return a;
}

void boot() {
    #ifdef LOCAL
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif

    ios_base::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
}

void solve() {
    int ans = 0;
    vector<int> v(n);

    for (auto &i: v) cin >> i;

    for (int i = 1; i <= 2 * MAX; ++i) {
        int ans_cur = 0;
        memset(mp, 0, sizeof(mp));

        for (auto &j: v) ++mp[j];

        for (int &j: v) {
            if (mp[i - j] > 0 && !(j * 2 == i && mp[j] == 1)) {
                --mp[i - j];
                --mp[j];
                ++ans_cur;
            }
        }

        ans = max(ans, ans_cur);
    }

    cout << ans << endl;
}

signed main() {
    boot();
    while (cin >> n) solve();
}


#include <bits/stdc++.h>

#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define sz(a) (int)((a).size())
#define sqr(a) (a) * (a)
#define endl '\n'
#define DBG(a) cout << #a << " := " << a << endl

typedef long long LL;
typedef long double LD;

const int MAX = (int)(1e5);
const int MOD = (int)(1e9) + 7;
const int INF_I = (int)(1e9) + 7;
const LL INF_LL = (long long)(1e18) + 7;

using namespace std;

int n;
vector<int> v;

template <typename T> void info(T& a) {
    for (auto &el: a) cout << el << ' ';
    cout << endl;
}

inline int input_I() {
    int a;
    cin >> a;
    return a;
}

inline long long input_LL() {
    long long a;
    cin >> a;
    return a;
}

void boot() {
    #ifdef LOCAL
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif

    ios_base::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
}

void solve() {
    int ans = 0;
    vector<int> v(n);

    for (auto &i: v) cin >> i;

    for (int i = 1; i <= MAX; ++i) {
        int ans_cur = 0;
        map<int, int> mp;

        for (auto &j: v) ++mp[j];

        for (int &j: v) {
            if (mp[i - j] > 0 && !(j * 2 == i && mp[j] == 1)) {
                --mp[i - j];
                --mp[j];
                ++ans_cur;
            }
        }

        ans = max(ans, ans_cur);
    }

    cout << ans << endl;
}

signed main() {
    boot();
    while (cin >> n) solve();
}


#include <bits/stdc++.h>

#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define sz(a) (int)((a).size())
#define sqr(a) (a) * (a)
#define endl '\n'
#define DBG(a) cout << #a << " := " << a << endl

typedef long long LL;
typedef long double LD;

const int MAX = (int)(1e5);
const int MOD = (int)(1e9) + 7;
const int INF_I = (int)(1e9) + 7;
const LL INF_LL = (long long)(1e18) + 7;

using namespace std;

int n;
vector<int> v;

template <typename T> void info(T& a) {
    for (auto &el: a) cout << el << ' ';
    cout << endl;
}

inline int input_I() {
    int a;
    cin >> a;
    return a;
}

inline long long input_LL() {
    long long a;
    cin >> a;
    return a;
}

void boot() {
    #ifdef LOCAL
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif

    ios_base::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
}

void solve() {
    int ans = 0;
    vector<int> v(n);

    for (auto &i: v) cin >> i;

    for (int i = 1; i <= 2 * MAX; ++i) {
        int ans_cur = 0;
        map<int, int> mp;

        for (auto &j: v) ++mp[j];

        for (int &j: v) {
            if (mp[i - j] > 0 && !(j * 2 == i && mp[j] == 1)) {
                --mp[i - j];
                --mp[j];
                ++ans_cur;
            }
        }

        ans = max(ans, ans_cur);
    }

    cout << ans << endl;
}

signed main() {
    boot();
    while (cin >> n) solve();
}


#include <bits/stdc++.h>
#define MAX (int)(1e5) + 7
#define INF (int)(1e9) + 7
#define int long long
#define now alsdlkjfs
#define first nn
#define second lal
#define sz(a) (a).size()
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()

using namespace std;

struct man {
    int nn, lal, pos;
};

int n, k;
int ans;
vector<int> a;
vector<int> used;
vector<man> now;

void start() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
}

int Round(double x) {
    return (long long)((long double)x + 0.5);
}

int res(int m, int n) {
    return Round((long double)100 * m / n);
}

signed main() {
    start();

    cin >> n >> k;

    a.resize(n);
    used.resize(n);
    for (auto &i: a) cin >> i;

    for (int i = 0; i < min(n, k); ++i) now.push_back({1, a[i], i});

    int t = 0;
    int curD = 0;
    int solved = 0;
    int pos = min(n, k);

    while (sz(now)) {
        curD = res(solved, n);
        // cout << curD << endl;

        int flag = 0;

        while (!flag) {
            ++t;
            for (int i = 0; i < sz(now); ++i) {
                man tmp = now[i];
                if (tmp.first == curD && !used[tmp.pos]) {
                    used[tmp.pos] = 1;
                    ++ans;
                    // cout << tmp.second << endl;
                }
                if (tmp.first == tmp.second) {
                    ++solved;
                    flag = 1;
                    //cout << t << endl;
                    //cout << tmp.second << endl;
                    //cout << endl;
                }
                ++now[i].first;
            }
        }

        vector<man> nw;

        for (auto &tmp: now) {
            if (!(tmp.first - 1 == tmp.second)) nw.push_back(tmp);
        }

        now = nw;

        while (sz(now) < k && pos < n) {
            now.push_back({1, a[pos], pos});
            ++pos;
        }
    }

    cout << ans << endl;
}


#include <bits/stdc++.h>

#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define sz(a) (int)((a).size())
#define sqr(a) (a) * (a)
#define endl '\n'
#define DBG(a) cout << #a << " := " << a << endl

typedef long long LL;
typedef long double LD;

const int MAX = (int)(1e5);
const int MOD = (int)(1e9) + 7;
const int INF_I = (int)(1e9) + 7;
const LL INF_LL = (long long)(1e18) + 7;

using namespace std;

int n;
int mp[2 * MAX + 1];

template <typename T> void info(T& a) {
    for (auto &el: a) cout << el << ' ';
    cout << endl;
}

inline int input_I() {
    int a;
    cin >> a;
    return a;
}

inline long long input_LL() {
    long long a;
    cin >> a;
    return a;
}

void boot() {
    #ifdef LOCAL
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif

    ios_base::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
}

void solve() {
    int ans = 0;
    vector<int> v(n);

    for (auto &i: v) cin >> i, mp[i] = 1;

    for (int i = 1; i <= 2 * MAX; ++i) {
        int ans_cur = 0;

        for (int &j: v) {
            if (j * 2 == i) continue;

            if (mp[i - j]) {
                ++ans_cur;
            }
        }

        ans = max(ans, ans_cur / 2);
    }

    cout << ans << endl;
}

signed main() {
    boot();
    while (cin >> n) solve();
}


#include <bits/stdc++.h>

#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define sz(a) (int)((a).size())
#define sqr(a) (a) * (a)
#define endl '\n'
#define DBG(a) cout << #a << " := " << a << endl

typedef long long LL;
typedef long double LD;

const int MAX = (int)(1e5);
const int MOD = (int)(1e9) + 7;
const int INF_I = (int)(1e9) + 7;
const LL INF_LL = (long long)(1e18) + 7;

using namespace std;

int n;
int mp[2 * MAX + 1];

template <typename T> void info(T& a) {
    for (auto &el: a) cout << el << ' ';
    cout << endl;
}

inline int input_I() {
    int a;
    cin >> a;
    return a;
}

inline long long input_LL() {
    long long a;
    cin >> a;
    return a;
}

void boot() {
    #ifdef LOCAL
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif

    ios_base::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
}

void solve() {
    int ans = 0;
    memset(mp, 0, sizeof(mp));
    vector<int> v(n);

    for (auto &i: v) cin >> i, mp[i] = 1;

    for (int i = 1; i <= 2 * MAX; ++i) {
        int ans_cur = 0;

        for (int &j: v) {
            if (j * 2 == i) continue;

            if (mp[i - j]) {
                ++ans_cur;
            }
        }

        ans = max(ans, ans_cur / 2);
    }

    cout << ans << endl;
}

signed main() {
    boot();
    while (cin >> n) solve();
}


#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#define mm(o,k)
using namespace std;
int Max=0;
int ans=0;
int cnt[200005];
int n;
int main()
{
    ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    cin >> n;
    vector<int> a(n);
    for(int i=0;i<n;++i)
        cin >> a[i];
    sort(a.begin(),a.end());
    set<int> YY;
    int lim=min(n,400);
    if(n>=500)lim=100;
    for(int i=0;i<lim;++i)
        for(int j=i+1;j<n;++j)
            YY.insert(a[j]+a[i]);
    vector<int> XX;
    for(auto i:YY)
    XX.push_back(i);
    for(auto dif:XX){
        memset(cnt,0,sizeof cnt);
        for(int i=0;i<n;++i)
            cnt[a[i]]++;
        ans=0;
        for(int i=0;i<n;++i){
            if(dif-a[i]<0)
            break;
            if(!cnt[a[i]])
            continue;
            cnt[a[i]]--;
            if(cnt[dif-a[i]]){
            --cnt[dif-a[i]],++ans;
            }
            else
            cnt[a[i]]++;
        }
        Max=max(Max,ans);
    }
    cout<<Max;
}


#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#define mm(o,k)
using namespace std;
int Max=0;
int ans=0;
int cnt[200005];
int n;
int main()
{
    ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    cin >> n;
    vector<int> a(n);
    for(int i=0;i<n;++i)
        cin >> a[i];
    sort(a.begin(),a.end());
    set<int> YY;
    int lim=min(n,500);
    if(n>=500)lim=150;
    for(int i=0;i<lim;++i)
        for(int j=i+1;j<n;++j)
            YY.insert(a[j]+a[i]);
    vector<int> XX;
    for(auto i:YY)
    XX.push_back(i);
    for(auto dif:XX){
        memset(cnt,0,sizeof cnt);
        for(int i=0;i<n;++i)
            cnt[a[i]]++;
        ans=0;
        for(int i=0;i<n;++i){
            if(dif-a[i]<0)
            break;
            if(!cnt[a[i]])
            continue;
            cnt[a[i]]--;
            if(cnt[dif-a[i]]){
            --cnt[dif-a[i]],++ans;
            }
            else
            cnt[a[i]]++;
        }
        Max=max(Max,ans);
    }
    cout<<Max;
}


#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#define mm(o,k)
using namespace std;
int Max=0;
int ans=0;
int cnt[200005];
int n;
int main()
{
    ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    cin >> n;
    vector<int> a(n);
    for(int i=0;i<n;++i)
        cin >> a[i];
    sort(a.begin(),a.end());
    set<int> YY;
    int lim=min(n,200);
    if(n>=700)lim=100;
    for(int i=0;i<lim;++i)
        for(int j=i+1;j<n;++j)
            YY.insert(a[j]+a[i]);
    vector<int> XX;
    for(auto i:YY)
    XX.push_back(i);
    for(auto dif:XX){
        memset(cnt,0,sizeof cnt);
        for(int i=0;i<n;++i)
            cnt[a[i]]++;
        ans=0;
        for(int i=0;i<n;++i){
            if(dif-a[i]<0)
            break;
            if(!cnt[a[i]])
            continue;
            cnt[a[i]]--;
            if(cnt[dif-a[i]]){
            --cnt[dif-a[i]],++ans;
            }
            else
            cnt[a[i]]++;
        }
        Max=max(Max,ans);
    }
    cout<<Max;
}


#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#define mm(o,k)
using namespace std;
int Max=0;
int ans=0;
int cnt[200005];
int n;
int main()
{
    ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    cin >> n;
    vector<int> a(n);
    for(int i=0;i<n;++i)
        cin >> a[i];
    sort(a.begin(),a.end());
    set<int> YY;
    int lim=min(n,300);
    if(n>=700)lim=100;
    for(int i=0;i<lim;++i)
        for(int j=i+1;j<n;++j)
            YY.insert(a[j]+a[i]);
    vector<int> XX;
    for(auto i:YY)
    XX.push_back(i);
    for(auto dif:XX){
        memset(cnt,0,sizeof cnt);
        for(int i=0;i<n;++i)
            cnt[a[i]]++;
        ans=0;
        for(int i=0;i<n;++i){
            if(dif-a[i]<0)
            break;
            if(!cnt[a[i]])
            continue;
            cnt[a[i]]--;
            if(cnt[dif-a[i]]){
            --cnt[dif-a[i]],++ans;
            }
            else
            cnt[a[i]]++;
        }
        Max=max(Max,ans);
    }
    cout<<Max;
}


#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#define mm(o,k)
using namespace std;
int Max=0;
int ans=0;
int cnt[200005];
int n;
int main()
{
    ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    cin >> n;
    vector<int> a(n);
    for(int i=0;i<n;++i)
        cin >> a[i];
    sort(a.begin(),a.end());
    set<int> YY;
    for(int i=0;i<min(100,n);++i)
        for(int j=i+1;j<n;++j)
            YY.insert(a[j]+a[i]);
    vector<int> XX;
    for(auto i:YY)
    XX.push_back(i);
    for(auto dif:XX){
        memset(cnt,0,sizeof cnt);
        for(int i=0;i<n;++i)
            cnt[a[i]]++;
        ans=0;
        for(int i=0;i<n;++i){
            if(dif-a[i]<0)
            break;
            if(!cnt[a[i]])
            continue;
            cnt[a[i]]--;
            if(cnt[dif-a[i]]){
            --cnt[dif-a[i]],++ans;
            }
            else
            cnt[a[i]]++;
        }
        Max=max(Max,ans);
    }
    cout<<Max;
}


#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#define mm(o,k)
using namespace std;
int Max=0;
int ans=0;
int cnt[200005];
int n;
int main()
{
    ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    cin >> n;
    vector<int> a(n);
    for(int i=0;i<n;++i)
        cin >> a[i];
    sort(a.begin(),a.end());
    set<int> YY;
    for(int i=0;i<min(20,n);++i)
        for(int j=i+1;j<n;++j)
            YY.insert(a[j]+a[i]);
    vector<int> XX;
    for(auto i:YY)
    XX.push_back(i);
    for(auto dif:XX){
        memset(cnt,0,sizeof cnt);
        for(int i=0;i<n;++i)
            cnt[a[i]]++;
        ans=0;
        for(int i=0;i<n;++i){
            if(dif-a[i]<0)
            break;
            if(!cnt[a[i]])
            continue;
            cnt[a[i]]--;
            if(cnt[dif-a[i]]){
            --cnt[dif-a[i]],++ans;
            }
            else
            cnt[a[i]]++;
        }
        Max=max(Max,ans);
    }
    cout<<Max;
}


#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#define mm(o,k)
using namespace std;
int Max=0;
int ans=0;
int cnt[200005];
int n;
int main()
{
    ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    cin >> n;
    vector<int> a(n);
    for(int i=0;i<n;++i)
        cin >> a[i];
    sort(a.begin(),a.end());
    set<int> YY;
    for(int i=0;i<min(30,n);++i)
        for(int j=i+1;j<n;++j)
            YY.insert(a[j]+a[i]);
    vector<int> XX;
    for(auto i:YY)
    XX.push_back(i);
    for(auto dif:XX){
        memset(cnt,0,sizeof cnt);
        for(int i=0;i<n;++i)
            cnt[a[i]]++;
        ans=0;
        for(int i=0;i<n;++i){
            if(dif-a[i]<0)
            break;
            if(!cnt[a[i]])
            continue;
            cnt[a[i]]--;
            if(cnt[dif-a[i]]){
            --cnt[dif-a[i]],++ans;
            }
            else
            cnt[a[i]]++;
        }
        Max=max(Max,ans);
    }
    cout<<Max;
}


#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#define mm(o,k)
using namespace std;
int Max=0;
int ans=0;
int cnt[200005];
int n;
int main()
{
    ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    cin >> n;
    vector<int> a(n);
    for(int i=0;i<n;++i)
        cin >> a[i];
    sort(a.begin(),a.end());
    set<int> YY;
    for(int i=0;i<min(200,n);++i)
        for(int j=i+1;j<n;++j)
            YY.insert(a[j]+a[i]);
    vector<int> XX;
    for(auto i:YY)
    XX.push_back(i);
    for(auto dif:XX){
        memset(cnt,0,sizeof cnt);
        for(int i=0;i<n;++i)
            cnt[a[i]]++;
        ans=0;
        for(int i=0;i<n;++i){
            if(dif-a[i]<0)
            break;
            if(!cnt[a[i]])
            continue;
            cnt[a[i]]--;
            if(cnt[dif-a[i]]){
            --cnt[dif-a[i]],++ans;
            }
            else
            cnt[a[i]]++;
        }
        Max=max(Max,ans);
    }
    cout<<Max;
}


#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#define mm(o,k)
using namespace std;
int Max=0;
int ans=0;
int cnt[200005];
int n;
int main()
{
    ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    cin >> n;
    vector<int> a(n);
    for(int i=0;i<n;++i)
        cin >> a[i];
    sort(a.begin(),a.end());
    set<int> YY;
    for(int i=0;i<min(20,n);++i)
        for(int j=i+1;j<n;++j)
            YY.insert(a[j]+a[i]);
    vector<int> XX;
    for(auto i:YY)
    XX.push_back(i);
    for(auto dif:m3lsh){
        memset(cnt,0,sizeof cnt);
        for(int i=0;i<n;++i)
            cnt[a[i]]++;
        ans=0;
        for(int i=0;i<n;++i){
            if(dif-a[i]<0)
            break;
            if(!cnt[a[i]])
            continue;
            cnt[a[i]]--;
            if(cnt[dif-a[i]]){
            --cnt[dif-a[i]],++ans;
            }
            else
            cnt[a[i]]++;
        }
        Max=max(Max,ans);
    }
    cout<<Max;
}


/*
「God Is In His Heaven,
		All's Right With The World.」
*/
#include<bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(a)-1; i>=(b); i--)
#define each(i, q) for(auto i : q)
#define sz(a) (int)a.size()
#define de(a) cout<<#a<<" = "<<a<<endl
#define dd(a) cout<<#a<<" = "<<a<<" "
#define lowbit(x) x&(-x)
#define all(x) x.begin(),x.end()
#define ffs __builtin_ffs //idxOf(1<-)
#define clz __builtin_clz //numOf(->0)
#define ctz __builtin_ctz //numOf(0<-)
#define popcount __builtin_popcount //numOf1
#define parity __builtin_parity //(numOf1)%2
using namespace std;
typedef long long ll;
typedef double ld;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<pair<int, int> > vpii;
template <typename T> inline void read(T& x) {
	int f = 0, c = getchar(); x = 0;
	while (!isdigit(c)) f |= c == '-', c = getchar();
	while (isdigit(c)) x = x * 10 + c - 48, c = getchar();
	if (f) x = -x;
}
template <typename T, typename... Args>
inline void read(T& x, Args& ... args) {
	read(x); read(args...);
}
template <typename T> void write(T x) {
	if (x < 0) x = -x, putchar('-');
	if (x > 9) write(x / 10);
	putchar(x % 10 + 48);
}
template <typename T> void writes(T x) { write(x); putchar(' '); }
template <typename T> void writeln(T x) { write(x); puts(""); }
template <typename T> inline bool chkmin(T& x, const T& y) { return y < x ? (x = y, true) : false; }
template <typename T> inline bool chkmax(T& x, const T& y) { return x < y ? (x = y, true) : false; }
const int maxn = (int)3e5 + 10;
const ll inf = (ll)1e18;
const int mod = (int)1e9 + 7;
/*
	——ASUKA STRIKES!
*/
int n, a[1005], ans;
bool b[100500];
set<int> v;
int main() {
	read(n);
	rep(i, 0, n) {
		read(a[i]);
		b[a[i]] = 1;
	}
	rep(i, 0, n) {
		rep(j, i + 1, n) {
			v.insert(a[i] + a[j]);
		}
	}
	each(i, v) {
		int cnt = 0;
		rep(j, 0, n) {
			if (i - a[j] > 0 && b[i - a[j]]) cnt++;
		}
		chkmax(ans, cnt / 2);
	}
	writeln(ans);
}


/*
「God Is In His Heaven,
		All's Right With The World.」
*/
#include<bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(a)-1; i>=(b); i--)
#define each(i, q) for(auto i : q)
#define sz(a) (int)a.size()
#define de(a) cout<<#a<<" = "<<a<<endl
#define dd(a) cout<<#a<<" = "<<a<<" "
#define lowbit(x) x&(-x)
#define all(x) x.begin(),x.end()
#define ffs __builtin_ffs //idxOf(1<-)
#define clz __builtin_clz //numOf(->0)
#define ctz __builtin_ctz //numOf(0<-)
#define popcount __builtin_popcount //numOf1
#define parity __builtin_parity //(numOf1)%2
using namespace std;
typedef long long ll;
typedef double ld;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<pair<int, int> > vpii;
template <typename T> inline void read(T& x) {
	int f = 0, c = getchar(); x = 0;
	while (!isdigit(c)) f |= c == '-', c = getchar();
	while (isdigit(c)) x = x * 10 + c - 48, c = getchar();
	if (f) x = -x;
}
template <typename T, typename... Args>
inline void read(T& x, Args& ... args) {
	read(x); read(args...);
}
template <typename T> void write(T x) {
	if (x < 0) x = -x, putchar('-');
	if (x > 9) write(x / 10);
	putchar(x % 10 + 48);
}
template <typename T> void writes(T x) { write(x); putchar(' '); }
template <typename T> void writeln(T x) { write(x); puts(""); }
template <typename T> inline bool chkmin(T& x, const T& y) { return y < x ? (x = y, true) : false; }
template <typename T> inline bool chkmax(T& x, const T& y) { return x < y ? (x = y, true) : false; }
const int maxn = (int)3e5 + 10;
const ll inf = (ll)1e18;
const int mod = (int)1e9 + 7;
/*
	——ASUKA STRIKES!
*/
int n, a[1005], ans;
bool b[200500];
set<int> v;
int main() {
	read(n);
	rep(i, 0, n) {
		read(a[i]);
		b[a[i]] = 1;
	}
	rep(i, 0, n) {
		rep(j, i + 1, n) {
			v.insert(a[i] + a[j]);
		}
	}
	each(i, v) {
		int cnt = 0;
		rep(j, 0, n) {
			if (i - a[j] > 0 && b[i - a[j]]) cnt++;
		}
		chkmax(ans, cnt / 2);
	}
	writeln(ans);
}
/*
5
1 2 1 2 3
*/


/*
「God Is In His Heaven,
		All's Right With The World.」
*/
#include<bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(a)-1; i>=(b); i--)
#define each(i, q) for(auto i : q)
#define sz(a) (int)a.size()
#define de(a) cout<<#a<<" = "<<a<<endl
#define dd(a) cout<<#a<<" = "<<a<<" "
#define lowbit(x) x&(-x)
#define all(x) x.begin(),x.end()
#define ffs __builtin_ffs //idxOf(1<-)
#define clz __builtin_clz //numOf(->0)
#define ctz __builtin_ctz //numOf(0<-)
#define popcount __builtin_popcount //numOf1
#define parity __builtin_parity //(numOf1)%2
using namespace std;
typedef long long ll;
typedef double ld;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<pair<int, int> > vpii;
template <typename T> inline void read(T& x) {
	int f = 0, c = getchar(); x = 0;
	while (!isdigit(c)) f |= c == '-', c = getchar();
	while (isdigit(c)) x = x * 10 + c - 48, c = getchar();
	if (f) x = -x;
}
template <typename T, typename... Args>
inline void read(T& x, Args& ... args) {
	read(x); read(args...);
}
template <typename T> void write(T x) {
	if (x < 0) x = -x, putchar('-');
	if (x > 9) write(x / 10);
	putchar(x % 10 + 48);
}
template <typename T> void writes(T x) { write(x); putchar(' '); }
template <typename T> void writeln(T x) { write(x); puts(""); }
template <typename T> inline bool chkmin(T& x, const T& y) { return y < x ? (x = y, true) : false; }
template <typename T> inline bool chkmax(T& x, const T& y) { return x < y ? (x = y, true) : false; }
const int maxn = (int)3e5 + 10;
const ll inf = (ll)1e18;
const int mod = (int)1e9 + 7;
/*
	——ASUKA STRIKES!
*/
int n, a[1005], ans;
bool b[100500];
int main() {
	read(n);
	rep(i, 0, n) {
		read(a[i]);
		b[a[i]] = 1;
	}
	rep(i, 0, n) {
		rep(j, i + 1, n) {
			int sum = a[i] + a[j], cnt = 0;
			b[a[i]] = b[a[j]] = 0;
			if (i == 0 && j == 3) {
				int aa = 1;
			}
			rep(k, 0, n) {
				if (sum > a[k])
					cnt += b[sum - a[k]];
			}
			chkmax(ans, cnt / 2 + 1);
			b[a[i]] = b[a[j]] = 1;
		}
	}
	writeln(ans);
}


/*
「God Is In His Heaven,
		All's Right With The World.」
*/
#include<bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(a)-1; i>=(b); i--)
#define each(i, q) for(auto i : q)
#define sz(a) (int)a.size()
#define de(a) cout<<#a<<" = "<<a<<endl
#define dd(a) cout<<#a<<" = "<<a<<" "
#define lowbit(x) x&(-x)
#define all(x) x.begin(),x.end()
#define ffs __builtin_ffs //idxOf(1<-)
#define clz __builtin_clz //numOf(->0)
#define ctz __builtin_ctz //numOf(0<-)
#define popcount __builtin_popcount //numOf1
#define parity __builtin_parity //(numOf1)%2
using namespace std;
typedef long long ll;
typedef double ld;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<pair<int, int> > vpii;
template <typename T> inline void read(T& x) {
	int f = 0, c = getchar(); x = 0;
	while (!isdigit(c)) f |= c == '-', c = getchar();
	while (isdigit(c)) x = x * 10 + c - 48, c = getchar();
	if (f) x = -x;
}
template <typename T, typename... Args>
inline void read(T& x, Args& ... args) {
	read(x); read(args...);
}
template <typename T> void write(T x) {
	if (x < 0) x = -x, putchar('-');
	if (x > 9) write(x / 10);
	putchar(x % 10 + 48);
}
template <typename T> void writes(T x) { write(x); putchar(' '); }
template <typename T> void writeln(T x) { write(x); puts(""); }
template <typename T> inline bool chkmin(T& x, const T& y) { return y < x ? (x = y, true) : false; }
template <typename T> inline bool chkmax(T& x, const T& y) { return x < y ? (x = y, true) : false; }
const int maxn = (int)3e5 + 10;
const ll inf = (ll)1e18;
const int mod = (int)1e9 + 7;
/*
	——ASUKA STRIKES!
*/
int n, a[1005], ans;
bool b[100500];
int main() {
	read(n);
	rep(i, 0, n) {
		read(a[i]);
		b[a[i]] = 1;
	}
	sort(a, a + n);
	rep(i, 0, n / 2) {
		rep(j, n / 2, n) {
			int sum = a[i] + a[j], cnt = 0;
			b[a[i]] = b[a[j]] = 0;
			rep(k, 0, n / 2) {
				if (sum > a[k])
					cnt += b[sum - a[k]];
			}
			chkmax(ans, cnt + 1);
			b[a[i]] = b[a[j]] = 1;
		}
	}
	writeln(ans);
}


/*
「God Is In His Heaven,
All's Right With The World.」
*/
#include<bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(a)-1; i>=(b); i--)
#define each(i, q) for(auto i : q)
#define sz(a) (int)a.size()
#define de(a) cout<<#a<<" = "<<a<<endl
#define dd(a) cout<<#a<<" = "<<a<<" "
#define lowbit(x) x&(-x)
#define all(x) x.begin(),x.end()
#define ffs __builtin_ffs //idxOf(1<-)
#define clz __builtin_clz //numOf(->0)
#define ctz __builtin_ctz //numOf(0<-)
#define popcount __builtin_popcount //numOf1
#define parity __builtin_parity //(numOf1)%2
using namespace std;
typedef long long ll;
typedef double ld;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<pair<int, int> > vpii;
template <typename T> inline void read(T& x) {
	int f = 0, c = getchar(); x = 0;
	while (!isdigit(c)) f |= c == '-', c = getchar();
	while (isdigit(c)) x = x * 10 + c - 48, c = getchar();
	if (f) x = -x;
}
template <typename T, typename... Args>
inline void read(T& x, Args& ... args) {
	read(x); read(args...);
}
template <typename T> void write(T x) {
	if (x < 0) x = -x, putchar('-');
	if (x > 9) write(x / 10);
	putchar(x % 10 + 48);
}
template <typename T> void writes(T x) { write(x); putchar(' '); }
template <typename T> void writeln(T x) { write(x); puts(""); }
template <typename T> inline bool chkmin(T& x, const T& y) { return y < x ? (x = y, true) : false; }
template <typename T> inline bool chkmax(T& x, const T& y) { return x < y ? (x = y, true) : false; }
const int maxn = (int)3e5 + 10;
const ll inf = (ll)1e18;
const int mod = (int)1e9 + 7;
/*
——ASUKA STRIKES!
*/
int n, a[1005], ans;
bool b[200500];
int main() {
	read(n);
	rep(i, 0, n) {
		read(a[i]);
		b[a[i]] = 1;
	}
	rep(i, 0, n) {
		rep(j, i + 1, n) {
			int sum = a[i] + a[j], cnt = 0;
			b[a[i]] = b[a[j]] = 0;
			if (i == 0 && j == 3) {
				int aa = 1;
			}
			rep(k, 0, n) {
				if (sum > a[k])
					cnt += b[sum - a[k]];
			}
			chkmax(ans, cnt / 2 + 1);
			b[a[i]] = b[a[j]] = 1;
		}
	}
	writeln(ans);
}


#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#include <string>
#include <unordered_map>
#define endl "\n"
#define all(v) v.begin(),v.end()
#define allr(s) s.rbegin(),s.rend()
#define RT(s) return cout<<s,0
#define watch(x) cout<<(#x)<<" = "<<x<<endl
#define sz(s)	(int)(s.size())
#define PI acos(-1)
#define EPS 1e-8
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
int dy[] = { 1, -1, 0, 0, -1, 1, 1, -1 };
int dx[] = { 0, 0, 1, -1, 1, -1, 1, -1 };
void file() {
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
#endif
}
void fast() {
	std::ios_base::sync_with_stdio(0);
	cin.tie(NULL);
}

int main() {
	file();
	fast();
	int n;
	cin >> n;
	vector<int> v1(n);
	for (auto & x : v1)
		cin >> x;
	sort(all(v1));
	int ans = 0;
	for (int i = 0; i < n / 2; i++) {
		int sum1 = v1[i] + v1[n - i - 1];
		int cnt = 0;
		for (int j = i + 1; j < n / 2; j++) {
			int sum2 = v1[j] + v1[n - j - 1];
			if (sum2 == sum1) {
				i++;
				cnt++;
			}
		}
		if (cnt)
			ans += (cnt + 1);
	}
	cout << ans << endl;
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#include <string>
#include <unordered_map>
#define endl "\n"
#define all(v) v.begin(),v.end()
#define allr(s) s.rbegin(),s.rend()
#define RT(s) return cout<<s,0
#define watch(x) cout<<(#x)<<" = "<<x<<endl
#define sz(s)	(int)(s.size())
#define PI acos(-1)
#define EPS 1e-8
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
int dy[] = { 1, -1, 0, 0, -1, 1, 1, -1 };
int dx[] = { 0, 0, 1, -1, 1, -1, 1, -1 };
void file() {
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
#endif
}
void fast() {
	std::ios_base::sync_with_stdio(0);
	cin.tie(NULL);
}
int n;
vector<int> v1;
int cnt = 0, sum;
map<int, bool> take;
bool valid(int i, int j) {
	if (take[i] || take[j])
		return 0;
	if (i < n / 2 && j > n / 2)
		return 1;
	return 0;
}
void check(int start, int end) {
	if (!valid(start, end))
		return;
	while (start < end) {
		if (v1[start] + v1[end] < sum) {
			start++;
		}
		else if (v1[start] + v1[end] > sum)
			end--;
		else {
			cnt++;
			take[start] = 1;
			take[end] = 1;
			check(start + 1, end - 1);
			return;
		}
	}
}
int main() {
	file();
	fast();
	cin >> n;
	v1.resize(n);
	for (auto & x : v1)
		cin >> x;
	sort(all(v1));
	int ans = 0;
	for (int i = 0; i < n / 2; i++) {
		sum = v1[i] + v1[n - i - 1];
		cnt = 0;
		check(i + 1, n - i - 2);
		if (cnt)
			ans += (cnt + 1);
	}
	cout << ans << endl;
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#include <string>
#include <unordered_map>
#define endl "\n"
#define all(v) v.begin(),v.end()
#define allr(s) s.rbegin(),s.rend()
#define RT(s) return cout<<s,0
#define watch(x) cout<<(#x)<<" = "<<x<<endl
#define sz(s)	(int)(s.size())
#define PI acos(-1)
#define EPS 1e-8
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
int dy[] = { 1, -1, 0, 0, -1, 1, 1, -1 };
int dx[] = { 0, 0, 1, -1, 1, -1, 1, -1 };
void file() {
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
#endif
}
void fast() {
	std::ios_base::sync_with_stdio(0);
	cin.tie(NULL);
}

int main() {
	file();
	fast();
	int n;
	cin >> n;
	vector<int> v1(n);
	for (auto & x : v1)
		cin >> x;
	sort(all(v1));
	int ans = 0;
	for (int i = 0; i < n / 2; i++) {
		int sum1 = v1[i] + v1[n - i - 1];
		int cnt = 0;
		for (int j = i + 1; j < n / 2; j++) {
			int sum2 = v1[j] + v1[n - j - 1];
			if (sum2 == sum1) {
				i++;
				cnt++;
			}
			else
				break;
		}
		if (cnt)
			ans += (cnt + 1);
	}
	cout << ans << endl;
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#include <string>
#include <unordered_map>
#define endl "\n"
#define all(v) v.begin(),v.end()
#define allr(s) s.rbegin(),s.rend()
#define RT(s) return cout<<s,0
#define watch(x) cout<<(#x)<<" = "<<x<<endl
#define sz(s)	(int)(s.size())
#define PI acos(-1)
#define EPS 1e-8
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
int dy[] = { 1, -1, 0, 0, -1, 1, 1, -1 };
int dx[] = { 0, 0, 1, -1, 1, -1, 1, -1 };
void file() {
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
#endif
}
void fast() {
	std::ios_base::sync_with_stdio(0);
	cin.tie(NULL);
}
int n;
vector<int> v1;
int cnt = 0, sum;
map<int, bool> take;
bool valid(int i, int j) {
	if (take[i] || take[j])
		return 0;
	if (i < n / 2 && j >= n / 2)
		return 1;
	return 0;
}
void check(int start, int end) {
	if (!valid(start, end))
		return;
	while (start < end) {
		if (v1[start] + v1[end] < sum) {
			start++;
		}
		else if (v1[start] + v1[end] > sum)
			end--;
		else {
			cnt++;
			take[start] = 1;
			take[end] = 1;
			check(start + 1, end - 1);
			return;
		}
	}
}
int main() {
	file();
	fast();
	cin >> n;
	v1.resize(n);
	for (auto & x : v1)
		cin >> x;
	sort(all(v1));
	vector<int> a;
	map<int, int> mp;
	for (int i = 0; i < n; i++) {
		for (int j = i + 1; j < n; j++) {
			mp[v1[i] + v1[j]]++;
		}
	}
	int mx = INT_MIN;
	for (auto it : mp) {
		mx = max(mx, it.second);
	}
	cout << mx << endl;
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#include <string>
#include <unordered_map>
#define endl "\n"
#define all(v) v.begin(),v.end()
#define allr(s) s.rbegin(),s.rend()
#define RT(s) return cout<<s,0
#define watch(x) cout<<(#x)<<" = "<<x<<endl
#define sz(s)	(int)(s.size())
#define PI acos(-1)
#define EPS 1e-8
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
int dy[] = { 1, -1, 0, 0, -1, 1, 1, -1 };
int dx[] = { 0, 0, 1, -1, 1, -1, 1, -1 };
void file() {
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
#endif
}
void fast() {
	std::ios_base::sync_with_stdio(0);
	cin.tie(NULL);
}
int n;
vector<int> v1;
int cnt = 0, sum;
map<int, bool> take;
bool valid(int i, int j) {
	if (take[i] || take[j])
		return 0;
	if (i < n / 2 && j >= n / 2)
		return 1;
	return 0;
}
void check(int start, int end) {
	if (!valid(start, end))
		return;
	while (start < end) {
		if (v1[start] + v1[end] < sum) {
			start++;
		}
		else if (v1[start] + v1[end] > sum)
			end--;
		else {
			cnt++;
			take[start] = 1;
			take[end] = 1;
			check(start + 1, end - 1);
			return;
		}
	}
}
int main() {
	file();
	fast();
	cin >> n;
	v1.resize(n);
	for (auto & x : v1)
		cin >> x;
	sort(all(v1));
	int ans = 0;
	for (int i = 0; i < n / 2; i++) {
		sum = v1[i] + v1[n - i - 1];
		cnt = 0;
		check(i + 1, n - i - 2);
		if (cnt)
			ans += (cnt + 1);
	}
	cout << ans << endl;
	return 0;
}


#include<iostream>
#include<string.h>
#include<cmath>
#include<algorithm>
#define ll long long
using namespace std;
int C[10050];
int mm[200005];
int main()
{
    int n;
    cin>>n;
    memset(mm,0,sizeof(mm));
    for(int i=1;i<=n;i++){
        cin>>C[i];mm[C[i]]=1;
    }
    sort(C+1,C+1+n);
    int Max=-1;
    for(int i=1;i<=C[n/2]+C[n];i++){
        int ans=0;
        for(int j=1;j<=C[n/2];j++){
            if(mm[i-C[j]]&&i-C[j]>=C[n/2])ans++;//,cout<<C[j]<<" ";
        }
        Max=max(Max,ans);
        //cout<<Max<<endl;
    }
    cout<<Max<<endl;
}


#include<iostream>
#include<string.h>
#include<cmath>
#include<map>
#include<algorithm>
#define ll long long
using namespace std;
int C[10050];
int main()
{
    int n;
    cin>>n;
    map<int,int>mm;
    for(int i=1;i<=n;i++){
        cin>>C[i];mm[C[i]]=1;
    }
    sort(C+1,C+1+n);
    int Max=-1;
    for(int i=1;i<=C[n/2]+C[n];i++){
        int ans=0;
        for(int j=1;j<=C[n/2];j++){
            if(mm[i-C[j]]&&i-C[j]>=C[n/2])ans++;//,cout<<C[j]<<" ";
        }
        Max=max(Max,ans);
        //cout<<Max<<endl;
    }
    cout<<Max<<endl;
}


#include<iostream>
#include<string.h>
#include<cmath>
#include<map>
#include<algorithm>
#define ll long long
using namespace std;
int C[10050],ans[200050];
int main()
{
    int n;
    cin>>n;
    memset(C,0,sizeof(C));
    for(int i=1;i<=n;i++){
        cin>>C[i];
    }
    int Max=-1;
    for(int i=1;i<=n;i++){
        for(int j=i+1;j<=n;j++){
            ans[C[i]+C[j]]++;
            Max=max(ans[C[i]+C[j]],Max);
        }
    }
    cout<<Max<<endl;
}


#include<iostream>
#include<string.h>
#include<cmath>
#include<algorithm>
#define ll long long
using namespace std;
int C[10050];
int mm[200005];
int main()
{
    int n;
    cin>>n;
    memset(mm,0,sizeof(mm));
    for(int i=1;i<=n;i++){
        cin>>C[i];mm[C[i]]=1;
    }
    sort(C+1,C+1+n);
    int Max=-1;
    for(int i=1;i<=C[n/2]+C[n];i++){
        int ans=0;
        for(int j=1;j<=n/2;j++){
            if(mm[i-C[j]]&&i-C[j]>=C[n/2])ans++;//,cout<<C[j]<<" ";
        }
        Max=max(Max,ans);
        //cout<<Max<<endl;
    }
    cout<<Max<<endl;
}


#include<iostream>
#include<string.h>
#include<cmath>
#include<algorithm>
#define ll long long
using namespace std;
int C[10050];
int mm[200005];
int main()
{
    int n;
    cin>>n;
    memset(mm,0,sizeof(mm));
    for(int i=1;i<=n;i++){
        cin>>C[i];mm[C[i]]=1;
    }
    sort(C+1,C+1+n);
    int Max=-1;
    for(int i=1;i<=C[n/2]+C[n];i++){
        int ans=0;
        for(int j=1;j<=n;j++){
            if(i-C[j]>=1&&mm[i-C[j]])ans++;//,cout<<C[j]<<" ";
        }
        Max=max(Max,ans/2);
        //cout<<Max<<endl;
    }
    cout<<Max<<endl;
}


#include<iostream>
#include<string.h>
#include<cmath>
#include<map>
#include<algorithm>
#define ll long long
using namespace std;
int C[10050],ans[20050];
int main()
{
    int n;
    cin>>n;
    memset(C,0,sizeof(C));
    for(int i=1;i<=n;i++){
        cin>>C[i];
    }
    int Max=-1;
    for(int i=1;i<=n;i++){
        for(int j=i+1;j<=n;j++){
            ans[C[i]+C[j]]++;
            Max=max(ans[C[i]+C[j]],Max);
        }
    }
    cout<<Max<<endl;
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;

ll n,i,j,a[1001],kid[200001],k,l,sum,ans;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
//	freopen("t.in","r",stdin);
	cin>>n;
	for(i=0;i<n;i++){
		cin>>a[i];
	}
	for(i=0;i<n-1;i++){
		for(j=i+1;j<n;j++){
			sum=a[i]+a[j];
			kid[sum]++;
			if(kid[sum]>ans)ans=kid[sum];
		}
	}
	cout<<ans<<endl;
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;

ll n,i,j,a[1001],sum,kid[100000001],ans;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
//	freopen("t.in","r",stdin);
	cin>>n;
	for(i=0;i<n;i++){
		cin>>a[i];
	}
	for(i=0;i<n-1;i++){
		for(j=i+1;j<n;j++){
			sum=a[i]+a[j];
			kid[sum]++;
			if(kid[sum]>ans)ans=kid[sum];
		}
	}
	cout<<ans<<endl;
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;

ll n,i,j,a[1001],k,l,sum,ans;
pair<ll,ll> kid[10001];

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
//	freopen("t.in","r",stdin);
	cin>>n;
	for(i=0;i<n;i++){
		cin>>a[i];
	}
	for(i=0;i<n-1;i++){
		for(j=i+1;j<n;j++){
			sum=a[i]+a[j];
			if(l==0){
				kid[l].first=sum;
				kid[l].second++;
				l++;
			}
			else{
				for(k=0;k<l;k++){
					if(sum==kid[k].first) break;
				}
				if(k!=l){
					kid[k].second++;
				}
				else{
					kid[l].first=sum;
					kid[l].second++;
					l++;
				}
			}
		}
	}
	for(i=0;i<l;i++){
		if(kid[i].second>ans)ans=kid[i].second;
	}
	cout<<ans<<endl;
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;

ll n,i,j,a[1001],sum,ans;
map<ll, ll> kid;
set<ll> donesum;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
//	freopen("t.in","r",stdin);
	cin>>n;
	for(i=0;i<n;i++){
		cin>>a[i];
	}
	for(i=0;i<n-1;i++){
		for(j=i+1;j<n;j++){
			sum=a[i]+a[j];
			if(donesum.count(sum)==0){
				kid[sum]++;
				donesum.insert(sum);
			}
			else{
				kid[sum]++;
			}
		}
		if(kid[sum]>ans)ans=kid[sum];
	}
	cout<<ans<<endl;
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;

ll n,i,j,a[1001],k,l,sum,ans;
pair<ll,ll> kid[100001];

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
//	freopen("t.in","r",stdin);
	cin>>n;
	for(i=0;i<n;i++){
		cin>>a[i];
	}
	for(i=0;i<n-1;i++){
		for(j=i+1;j<n;j++){
			sum=a[i]+a[j];
			if(l==0){
				kid[l].first=sum;
				kid[l].second++;
				l++;
			}
			else{
				for(k=0;k<l;k++){
					if(sum==kid[k].first) break;
				}
				if(k!=l){
					kid[k].second++;
				}
				else{
					kid[l].first=sum;
					kid[l].second++;
					l++;
				}
			}
		}
	}
	for(i=0;i<l;i++){
		if(kid[i].second>ans)ans=kid[i].second;
	}
	cout<<ans<<endl;
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;

ll n,i,j,a[1001],k,l,sum,ans;
pair<ll,ll> kid[1001];

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
//	freopen("t.in","r",stdin);
	cin>>n;
	for(i=0;i<n;i++){
		cin>>a[i];
	}
	for(i=0;i<n-1;i++){
		for(j=i+1;j<n;j++){
			sum=a[i]+a[j];
			if(l==0){
				kid[l].first=sum;
				kid[l].second++;
				l++;
			}
			else{
				for(k=0;k<l;k++){
					if(sum==kid[k].first) break;
				}
				if(k!=l){
					kid[k].second++;
				}
				else{
					kid[l].first=sum;
					kid[l].second++;
					l++;
				}
			}
		}
	}
	for(i=0;i<l;i++){
		if(kid[i].second>ans)ans=kid[i].second;
	}
	cout<<ans<<endl;
}