#include<cstdio>
#include<iostream>
#include<string>
#include<cstring>
#include<math.h>
#include<algorithm>
using namespace std;
typedef long long ll;
int main()
{
    int t;
    cin>>t;
    for(int r=0;r<t;r++)
    {
        int a;
        int ss[11111];
        cin>>a;
        for(int i=1;i<=2*a;i++)
        {
            scanf("%d",&ss[i]);
        }
        sort(ss+1,ss+1+2*a);
        printf("%d\n",ss[a+1]-ss[a]);
    }
}


#include<cstdio>
#include<iostream>
#include<string>
#include<cstring>
#include<math.h>
#include<algorithm>
using namespace std;
typedef long long ll;
int main()
{
    int t;
    cin>>t;
    for(int r=0;r<t;r++)
    {
        ll a,ss[11111];
       scanf("%lld",&a);
        for(int i=1;i<=2*a;i++)
        {
            scanf("%lld",&ss[i]);
        }
        sort(ss+1,ss+1+2*a);
        printf("%lld\n",ss[a+1]-ss[a]);
    }
}


#include<cstdio>
#include<iostream>
#include<string>
#include<cstring>
#include<math.h>
#include<algorithm>
using namespace std;
typedef long long ll;
int main()
{
    int t;
    cin>>t;
    for(int r=0;r<t;r++)
    {
        int a;
        int ss[11111];
        cin>>a;
        int e=2*a;
        for(int i=1;i<=e;i++)
        {
            scanf("%d",&ss[i]);
        }
        sort(ss+1,ss+1+e);
        printf("%d\n",ss[a+1]-ss[a]);
    }
}


//bismillahir rahmanir rahim            //Author:Fayed Anik

#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
//using namespace __gnu_pbds;

/*
template <typename T>  using ordered_set =
    tree<T, null_type, less<T>,   /// greater<T> for sorting decreasingly
    rb_tree_tag, tree_order_statistics_node_update>;
*/

#define         ll                          long  long
#define         lf                          double
#define         pb(x)                       push_back(x)
#define         ull                         unsigned long long
#define         sfl(a)                      scanf("%lld",&a)
#define         sf(a)                       scanf("%d",&a)
#define         pf(a)                       printf("%d\n",a)
#define         pfl(a)                      printf("%lld\n",a)
#define         FOR(x,n)                    for(ll x=1;x<=n;++x)
#define         pii                         pair< ll , ll >
#define         mp(a,b)                     make_pair(a,b)
#define         mod                         1000000007
#define         INF                         2e18
#define         f1                          first
#define         f2                          second
#define         all(v)                      v.begin(),v.end()
#define         PI                          acos(-1)
#define         printminusone               printf("-1\n")
#define         bug                         printf("bug")
#define         FILEIN                      freopen("in.txt","r",stdin)
#define         FILEOUT                     freopen("out.txt","w",stdout)

//ll SET(ll mask,ll pos){ return mask = (mask | (1ll<<pos)); }
//ll RESET(ll mask,ll pos){ return mask = mask & ~(1ll<<pos); }
//bool CHECK(ll mask,ll pos) { return (bool) (mask & (1ll<<pos)); }
//priority_queue <ll, vector<ll>, greater<ll> > pq;
#define lim 100005

ll a[lim];
vector<ll>v,v1;
int main(){
    ll tc,n;
    sfl(tc);
    FOR(cs,tc){
        sfl(n);
        FOR(i,2*n){
            sfl(a[i]);
        }
        ll p=2*n;
        sort(a+1,a+p+1);
        //or(ll i=1;i<=2*n;i++) cout << a[i] << endl;
        if(n%2==0){
            n++;
        }
        //cout << a[n+1] << ' ' << a[n] <<' '<<n << endl;
        cout << a[n+1]-a[n] << endl;
    }

    return 0;
}


//bismillahir rahmanir rahim            //Author:Fayed Anik

#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
//using namespace __gnu_pbds;

/*
template <typename T>  using ordered_set =
    tree<T, null_type, less<T>,   /// greater<T> for sorting decreasingly
    rb_tree_tag, tree_order_statistics_node_update>;
*/

#define         ll                          long  long
#define         lf                          double
#define         pb(x)                       push_back(x)
#define         ull                         unsigned long long
#define         sfl(a)                      scanf("%lld",&a)
#define         sf(a)                       scanf("%d",&a)
#define         pf(a)                       printf("%d\n",a)
#define         pfl(a)                      printf("%lld\n",a)
#define         FOR(x,n)                    for(ll x=1;x<=n;++x)
#define         pii                         pair< ll , ll >
#define         mp(a,b)                     make_pair(a,b)
#define         mod                         1000000007
#define         INF                         2e18
#define         f1                          first
#define         f2                          second
#define         all(v)                      v.begin(),v.end()
#define         PI                          acos(-1)
#define         printminusone               printf("-1\n")
#define         bug                         printf("bug")
#define         FILEIN                      freopen("in.txt","r",stdin)
#define         FILEOUT                     freopen("out.txt","w",stdout)

//ll SET(ll mask,ll pos){ return mask = (mask | (1ll<<pos)); }
//ll RESET(ll mask,ll pos){ return mask = mask & ~(1ll<<pos); }
//bool CHECK(ll mask,ll pos) { return (bool) (mask & (1ll<<pos)); }
//priority_queue <ll, vector<ll>, greater<ll> > pq;
#define lim 200005

ll a[lim];
int main(){
    ll tc,n;
    sfl(tc);
    FOR(cs,tc){
        sfl(n);
        FOR(i,2*n){
            sfl(a[i]);
        }
        sort(a+1,a+n+n+1);
        cout << a[n+1]-a[n] << endl;
    }

    return 0;
}


//bismillahir rahmanir rahim            //Author:Fayed Anik

#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
//using namespace __gnu_pbds;

/*
template <typename T>  using ordered_set =
    tree<T, null_type, less<T>,   /// greater<T> for sorting decreasingly
    rb_tree_tag, tree_order_statistics_node_update>;
*/

#define         ll                          long  long
#define         lf                          double
#define         pb(x)                       push_back(x)
#define         ull                         unsigned long long
#define         sfl(a)                      scanf("%lld",&a)
#define         sf(a)                       scanf("%d",&a)
#define         pf(a)                       printf("%d\n",a)
#define         pfl(a)                      printf("%lld\n",a)
#define         FOR(x,n)                    for(ll x=1;x<=n;++x)
#define         pii                         pair< ll , ll >
#define         mp(a,b)                     make_pair(a,b)
#define         mod                         1000000007
#define         INF                         2e18
#define         f1                          first
#define         f2                          second
#define         all(v)                      v.begin(),v.end()
#define         PI                          acos(-1)
#define         printminusone               printf("-1\n")
#define         bug                         printf("bug")
#define         FILEIN                      freopen("in.txt","r",stdin)
#define         FILEOUT                     freopen("out.txt","w",stdout)

//ll SET(ll mask,ll pos){ return mask = (mask | (1ll<<pos)); }
//ll RESET(ll mask,ll pos){ return mask = mask & ~(1ll<<pos); }
//bool CHECK(ll mask,ll pos) { return (bool) (mask & (1ll<<pos)); }
//priority_queue <ll, vector<ll>, greater<ll> > pq;
#define lim 100005

ll a[lim];
vector<ll>v,v1;
int main(){
    ll tc,n;
    sfl(tc);
    FOR(cs,tc){
        v.clear();
        v1.clear();
        sfl(n);
        FOR(i,2*n){
            sfl(a[i]);
        }
        sort(a+1,a+2*n+1);
        for(ll i=1;i<=2*n;i+=2){
            v.pb(a[i]);
        }
        for(ll i=2;i<=2*n;i+=2){
            v1.pb(a[i]);
        }
        ll sz=v.size(),sz1=v1.size(),ans;
        //cout << sz <<' '<<sz1<<endl;
        if(sz&1 and sz1&1){
            //cout << v[sz/2] <<' '<<v1[sz1/2]<<endl;
            ans = abs(v[sz/2]-v1[sz1/2]);
        }
        else{
            v1.pb(v[0]);
            v.erase(v.begin());
            sort(all(v1));
            sz=v.size();
            sz1=v1.size();
            ans=abs(v[sz/2]-v1[sz1/2]);
            v.pb(v[0]);
            v1.erase(v1.begin());
            v.pb(v[1]);
            v1.erase(v1.begin());
            sz=v.size();
            sz1=v1.size();
            ans = min(ans,abs(v[sz/2]-v1[sz1/2]));
        }
        pfl(ans);
    }
}


//bismillahir rahmanir rahim            //Author:Fayed Anik

#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
//using namespace __gnu_pbds;

/*
template <typename T>  using ordered_set =
    tree<T, null_type, less<T>,   /// greater<T> for sorting decreasingly
    rb_tree_tag, tree_order_statistics_node_update>;
*/

#define         ll                          long  long
#define         lf                          double
#define         pb(x)                       push_back(x)
#define         ull                         unsigned long long
#define         sfl(a)                      scanf("%lld",&a)
#define         sf(a)                       scanf("%d",&a)
#define         pf(a)                       printf("%d\n",a)
#define         pfl(a)                      printf("%lld\n",a)
#define         FOR(x,n)                    for(ll x=1;x<=n;++x)
#define         pii                         pair< ll , ll >
#define         mp(a,b)                     make_pair(a,b)
#define         mod                         1000000007
#define         INF                         2e18
#define         f1                          first
#define         f2                          second
#define         all(v)                      v.begin(),v.end()
#define         PI                          acos(-1)
#define         printminusone               printf("-1\n")
#define         bug                         printf("bug")
#define         FILEIN                      freopen("in.txt","r",stdin)
#define         FILEOUT                     freopen("out.txt","w",stdout)

//ll SET(ll mask,ll pos){ return mask = (mask | (1ll<<pos)); }
//ll RESET(ll mask,ll pos){ return mask = mask & ~(1ll<<pos); }
//bool CHECK(ll mask,ll pos) { return (bool) (mask & (1ll<<pos)); }
//priority_queue <ll, vector<ll>, greater<ll> > pq;
#define lim 100005

ll a[lim];
vector<ll>v,v1;
int main(){
    ll tc,n;
    sfl(tc);
    FOR(cs,tc){
        v.clear();
        v1.clear();
        sfl(n);
        FOR(i,2*n){
            sfl(a[i]);
        }
        sort(a+1,a+2*n+1);
        for(ll i=1;i<=2*n;i+=2){
            v.pb(a[i]);
        }
        for(ll i=2;i<=2*n;i+=2){
            v1.pb(a[i]);
        }
        ll sz=v.size(),sz1=v1.size(),ans;
        //cout << sz <<' '<<sz1<<endl;
        if(sz&1 and sz1&1){
            //cout << v[sz/2] <<' '<<v1[sz1/2]<<endl;
            ans = abs(v[sz/2]-v1[sz1/2]);
        }
        else{
            v1.pb(v[0]);
            v.erase(v.begin());
            sort(all(v1));
            sz=v.size();
            sz1=v1.size();
            ans=abs(v[sz/2]-v1[sz1/2]);
            v.pb(v[0]);
            v1.erase(v1.begin());
            v.pb(v[0]);
            v1.erase(v1.begin());
            sort(all(v1));
            sz=v.size();
            sz1=v1.size();
            ans = min(ans,abs(v[sz/2]-v1[sz1/2]));
        }
        pfl(ans);
    }
}


//bismillahir rahmanir rahim            //Author:Fayed Anik

#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
//using namespace __gnu_pbds;

/*
template <typename T>  using ordered_set =
    tree<T, null_type, less<T>,   /// greater<T> for sorting decreasingly
    rb_tree_tag, tree_order_statistics_node_update>;
*/

#define         ll                          long  long
#define         lf                          double
#define         pb(x)                       push_back(x)
#define         ull                         unsigned long long
#define         sfl(a)                      scanf("%lld",&a)
#define         sf(a)                       scanf("%d",&a)
#define         pf(a)                       printf("%d\n",a)
#define         pfl(a)                      printf("%lld\n",a)
#define         FOR(x,n)                    for(ll x=1;x<=n;++x)
#define         pii                         pair< ll , ll >
#define         mp(a,b)                     make_pair(a,b)
#define         mod                         1000000007
#define         INF                         2e18
#define         f1                          first
#define         f2                          second
#define         all(v)                      v.begin(),v.end()
#define         PI                          acos(-1)
#define         printminusone               printf("-1\n")
#define         bug                         printf("bug")
#define         FILEIN                      freopen("in.txt","r",stdin)
#define         FILEOUT                     freopen("out.txt","w",stdout)

//ll SET(ll mask,ll pos){ return mask = (mask | (1ll<<pos)); }
//ll RESET(ll mask,ll pos){ return mask = mask & ~(1ll<<pos); }
//bool CHECK(ll mask,ll pos) { return (bool) (mask & (1ll<<pos)); }
//priority_queue <ll, vector<ll>, greater<ll> > pq;
#define lim 100005

ll a[lim];
vector<ll>v,v1;
int main(){
    ll tc,n;
    sfl(tc);
    FOR(cs,tc){
        v.clear();
        v1.clear();
        sfl(n);
        FOR(i,2*n){
            sfl(a[i]);
        }
        sort(a+1,a+2*n+1);
        for(ll i=1;i<=2*n;i+=2){
            v.pb(a[i]);
        }
        for(ll i=2;i<=2*n;i+=2){
            v1.pb(a[i]);
        }
        ll sz=v.size(),sz1=v1.size(),ans;
        //cout << sz <<' '<<sz1<<endl;
        if(sz&1 and sz1&1){
            //cout << v[sz/2] <<' '<<v1[sz1/2]<<endl;
            ans = abs(v[sz/2]-v1[sz1/2]);
        }
        else{
            v1.pb(v[0]);
            v.erase(v.begin());
            sort(all(v1));
            sz=v.size();
            sz1=v1.size();
            ans=abs(v[sz/2]-v1[sz1/2]);
            v.pb(v[0]);
            v1.erase(v1.begin());
            v.pb(v[0]);
            v1.erase(v1.begin());
            sort(all(v));
            sz=v.size();
            sz1=v1.size();
            ans = min(ans,abs(v[sz/2]-v1[sz1/2]));
        }
        pfl(ans);
    }
}


//bismillahir rahmanir rahim            //Author:Fayed Anik

#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
//using namespace __gnu_pbds;

/*
template <typename T>  using ordered_set =
    tree<T, null_type, less<T>,   /// greater<T> for sorting decreasingly
    rb_tree_tag, tree_order_statistics_node_update>;
*/

#define         ll                          long  long
#define         lf                          double
#define         pb(x)                       push_back(x)
#define         ull                         unsigned long long
#define         sfl(a)                      scanf("%lld",&a)
#define         sf(a)                       scanf("%d",&a)
#define         pf(a)                       printf("%d\n",a)
#define         pfl(a)                      printf("%lld\n",a)
#define         FOR(x,n)                    for(ll x=1;x<=n;++x)
#define         pii                         pair< ll , ll >
#define         mp(a,b)                     make_pair(a,b)
#define         mod                         1000000007
#define         INF                         2e18
#define         f1                          first
#define         f2                          second
#define         all(v)                      v.begin(),v.end()
#define         PI                          acos(-1)
#define         printminusone               printf("-1\n")
#define         bug                         printf("bug")
#define         FILEIN                      freopen("in.txt","r",stdin)
#define         FILEOUT                     freopen("out.txt","w",stdout)

//ll SET(ll mask,ll pos){ return mask = (mask | (1ll<<pos)); }
//ll RESET(ll mask,ll pos){ return mask = mask & ~(1ll<<pos); }
//bool CHECK(ll mask,ll pos) { return (bool) (mask & (1ll<<pos)); }
//priority_queue <ll, vector<ll>, greater<ll> > pq;
#define lim 100005

ll a[lim];
vector<ll>v,v1;
int main(){
    ll tc,n;
    sfl(tc);
    FOR(cs,tc){
        sfl(n);
        FOR(i,2*n){
            sfl(a[i]);
        }
        ll p=2*n;
        sort(a+1,a+p+1);
        if(n&1){
            cout << a[n+1]-a[n] << endl;
        }
        else{
            cout << a[n+1]-a[n-1] << endl;
        }
    }

    return 0;
}


//bismillahir rahmanir rahim            //Author:Fayed Anik

#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
//using namespace __gnu_pbds;

/*
template <typename T>  using ordered_set =
    tree<T, null_type, less<T>,   /// greater<T> for sorting decreasingly
    rb_tree_tag, tree_order_statistics_node_update>;
*/

#define         ll                          long  long
#define         lf                          double
#define         pb(x)                       push_back(x)
#define         ull                         unsigned long long
#define         sfl(a)                      scanf("%lld",&a)
#define         sf(a)                       scanf("%d",&a)
#define         pf(a)                       printf("%d\n",a)
#define         pfl(a)                      printf("%lld\n",a)
#define         FOR(x,n)                    for(ll x=1;x<=n;++x)
#define         pii                         pair< ll , ll >
#define         mp(a,b)                     make_pair(a,b)
#define         mod                         1000000007
#define         INF                         2e18
#define         f1                          first
#define         f2                          second
#define         all(v)                      v.begin(),v.end()
#define         PI                          acos(-1)
#define         printminusone               printf("-1\n")
#define         bug                         printf("bug")
#define         FILEIN                      freopen("in.txt","r",stdin)
#define         FILEOUT                     freopen("out.txt","w",stdout)

//ll SET(ll mask,ll pos){ return mask = (mask | (1ll<<pos)); }
//ll RESET(ll mask,ll pos){ return mask = mask & ~(1ll<<pos); }
//bool CHECK(ll mask,ll pos) { return (bool) (mask & (1ll<<pos)); }
//priority_queue <ll, vector<ll>, greater<ll> > pq;
#define lim 100005

ll a[lim];
int main(){
    ll tc,n;
    sfl(tc);
    FOR(cs,tc){
        sfl(n);
        FOR(i,2*n){
            sfl(a[i]);
        }
        ll p=2*n;
        sort(a+1,a+p+1);
        cout << a[n+1]-a[n] << endl;
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    int t;cin>>t;
    while(t--)
    {
        int n;cin>>n;int a[2*n];
        for(int i=0;i<2*n;i++)
            cin>>a[i];
        sort(a,a+(2*n));

        //for(int i=0;i<2*n;i++) cout<<a[i]<<" ";

        if(n==1) cout<<a[1]-a[0]<<endl;
        else if(n%2 == 0)
        {
            int p,q;
            p=a[n-2]-a[n];
            q=a[n-1]-a[n+1];
            if(p>q) cout<<q<<endl;
            else cout<<p<<endl;
        }
        else
        {
            cout<<a[n]-a[n-1]<<endl;
        }

    }

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;cin>>t;
    while(t--)
    {
        int n;cin>>n;
        int size=2*n;
        int arr[size];
        for(int i=0;i<size;i++)
            cin>>arr[i];
        sort(arr,arr+size);
        int minAbs=INT_MAX;

        int main1=arr[(size/2)];
        int main2=arr[(size/2)-1];

        if(arr[(size/2)-1]<main1)
        {
            minAbs=min(minAbs,abs(arr[(size/2)-1]-main1));
        }
        else
            minAbs=min(minAbs,abs(arr[(size/2)+1]-main2));

        cout<<minAbs<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;cin>>t;
    while(t--)
    {
        int n,a;cin>>n;
        for(int i=0;i<n;i++)
            {cin>>a;cout<<a;}
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;cin>>t;
    while(t--)
    {
        int n;cin>>n;
        int size=2*n;
        int arr[size];
        for(int i=0;i<size;i++)
            cin>>arr[i];
        sort(arr,arr+size);
        int minAbs=INT_MAX;

        int main1=arr[(size/2)];
        int main2=arr[(size/2)-1];

        if(n==1)cout<<arr[1]-arr[0]<<endl;
        else
        {
            if(arr[n-1]<main1) minAbs=min(minAbs,abs(arr[n-1]-main1));
            else               minAbs=min(minAbs,abs(arr[n+1]-main2));

        cout<<minAbs<<endl;
        }
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;cin>>t;
    while(t--)
    {
        int n;cin>>n;
        int size=2*n;
        int arr[size];
        for(int i=0;i<size;i++)
            cin>>arr[i];
        sort(arr,arr+size);
        int minAbs=INT_MAX;

        int main1=arr[(size/2)];
        int main2=arr[(size/2)-1];

        if(n==1)cout<<arr[1]-arr[0]<<endl;
        else
        {
            if(arr[n-1]<main1) minAbs=min(minAbs,abs(arr[n-1]-main1));
            else               minAbs=min(minAbs,abs(arr[n+1]-main2));
        cout<<minAbs<<endl;
        }
    }
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    int t;cin>>t;
    while(t--)
    {
        int n;cin>>n;int a[2*n];
        for(int i=0;i<2*n;i++)
            cin>>a[i];
        sort(a,a+(2*n));

        //for(int i=0;i<2*n;i++) cout<<a[i]<<" ";

        if(n==1) cout<<a[0]-a[1]<<endl;
        else if(n%2 == 0)
        {
            int p,q;
            p=a[n-2]-a[n];
            q=a[n-1]-a[n+1];
            if(p>q) cout<<q<<endl;
            else cout<<p<<endl;
        }
        else
        {
            cout<<a[n]-a[n-1]<<endl;
        }

    }

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;cin>>t;
    while(t--)
    {
        int n;cin>>n;
        int size=2*n;
        int arr[size];
        for(int i=0;i<size;i++)
            cin>>arr[i];
        sort(arr,arr+size);
        int minAbs=INT_MAX;

        int main1=arr[(size/2)];
        int main2=arr[(size/2)-1];

        if(n==1)cout<<arr[1]-arr[0]<<endl;
        else
        {
            if(arr[n-1]<main1) minAbs=min(minAbs,abs(arr[n-1]-main1));
            else               minAbs=min(minAbs,abs(arr[n]-main2));

        cout<<minAbs<<endl;
        }
    }
}


#include <bits/stdc++.h>

#define MEM(a, b)           memset(a, (b), sizeof(a))
#define CLR(a)              memset(a, 0, sizeof(a))
#define MAX(a, b)           ((a) > (b) ? (a) : (b))
#define MIN(a, b)           ((a) < (b) ? (a) : (b))
#define ABS(X)              ( (X) > 0 ? (X) : ( -(X) ) )
#define S(X)                ( (X) * (X) )
#define SZ(V)               (int )V.size()
#define FORN(i, n)          for(int i = 0; i < n; i++)
#define FORAB(i, a, b)      for(int i = a; i <= b; i++)
#define ALL(V)              V.begin(), V.end()
#define IN(A, B, C)         ((B) <= (A) && (A) <= (C))
//#define AIN(A, B, C)        assert(IN(A, B, C))

#define watch2(x , y)       cout << (#x) << " " << (#y)<< " is " << (x) << " " << (y)<< endl
#define watch(x)            cout << (#x) << " is " << (x) << endl
#define hitAi               ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)

#define ll                  long long int
#define xx                  first
#define yy                  second
#define pb(x)               push_back(x)
#define PI                  acos(-1.0)

#define PII                 pair<int, int>
#define PLL                 pair<Long long int, Long long int>
#define VI                  vector <int>

using namespace std;
ll a,b,sum = 0 , temp;
void check(ll x, ll y){
    ll sumxy=x+y;
    if (a<b && a+sumxy<=temp)
    {
        a+=x;
        a+=y;
    }
    else {
        b+=x;
        b+=y;
    }
}

ll s[100005];

int main ()
{
    hitAi;
    ll n , x , testCase , ans = 0 ,  count = 0 ;
    //freopen("E:/Desktop/Programming/Codeforce/input.txt", "r" , stdin );

    cin >> testCase;

    while (testCase--){
        sum=0;
        a=0;
        b=0;
        cin >> n ;
        n*=2;
        FORN(i,n){
            cin >> s[i];
            sum+=s[i];
        }
        sort(s+0,s+n);
        temp=sum/2;
        a=s[n-2];
        b=s[n-1];
        int i=0,j=n-3;
        while (i<j){
            check(s[i++],s[j--]);
        }
        cout << ABS(a-b) << endl;

    }

}


#include <bits/stdc++.h>

#define MEM(a, b)           memset(a, (b), sizeof(a))
#define CLR(a)              memset(a, 0, sizeof(a))
#define MAX(a, b)           ((a) > (b) ? (a) : (b))
#define MIN(a, b)           ((a) < (b) ? (a) : (b))
#define ABS(X)              ( (X) > 0 ? (X) : ( -(X) ) )
#define S(X)                ( (X) * (X) )
#define SZ(V)               (int )V.size()
#define FORN(i, n)          for(int i = 0; i < n; i++)
#define FORAB(i, a, b)      for(int i = a; i <= b; i++)
#define ALL(V)              V.begin(), V.end()
#define IN(A, B, C)         ((B) <= (A) && (A) <= (C))
//#define AIN(A, B, C)        assert(IN(A, B, C))

#define watch2(x , y)       cout << (#x) << " " << (#y)<< " is " << (x) << " " << (y)<< endl
#define watch(x)            cout << (#x) << " is " << (x) << endl
#define hitAi               ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)

#define ll                  long long int
#define xx                  first
#define yy                  second
#define pb(x)               push_back(x)
#define PI                  acos(-1.0)

#define PII                 pair<int, int>
#define PLL                 pair<Long long int, Long long int>
#define VI                  vector <int>

using namespace std;
ll a,b,sum = 0 , temp;

ll s[100005];

int main ()
{
    hitAi;
    ll n , x , testCase , ans = 0 ,  count = 0 ;
    //freopen("E:/Desktop/Programming/Codeforce/input.txt", "r" , stdin );

    cin >> testCase;

    while (testCase--){
        sum=0;
        a=0;
        b=0;
        cin >> n ;
        n*=2;
        FORN(i,n){
            cin >> s[i];
            sum+=s[i];
        }
        sort(s+0,s+n);
        temp=sum/2;
        stack <int> ak,dui;

        for (int i=n-1;i>=0;i--)
        {
            if (a<=b && a+s[i]<=temp){
                ak.push(s[i]);
                a+=s[i];
            }
            else {
                dui.push(s[i]);
                b+=s[i];
            }
        }
        //watch (SZ(ak));
        //watch (SZ(dui));
        //watch( ak.top());
        //watch( dui.top());

        if (SZ(ak)%2==0 || SZ(dui)%2==0){
            x = MIN( ak.top() , dui.top() );
            if(a>b)
            {
                a+=x;
                b-=x;
            }
            else {
                b+=x;
                a-=x;
            }
        }

        cout << ABS(a-b) << endl;

    }

}


#include <bits/stdc++.h>

#define MEM(a, b)           memset(a, (b), sizeof(a))
#define CLR(a)              memset(a, 0, sizeof(a))
#define MAX(a, b)           ((a) > (b) ? (a) : (b))
#define MIN(a, b)           ((a) < (b) ? (a) : (b))
#define ABS(X)              ( (X) > 0 ? (X) : ( -(X) ) )
#define S(X)                ( (X) * (X) )
#define SZ(V)               (int )V.size()
#define FORN(i, n)          for(int i = 0; i < n; i++)
#define FORAB(i, a, b)      for(int i = a; i <= b; i++)
#define ALL(V)              V.begin(), V.end()
#define IN(A, B, C)         ((B) <= (A) && (A) <= (C))
//#define AIN(A, B, C)        assert(IN(A, B, C))

#define watch2(x , y)       cout << (#x) << " " << (#y)<< " is " << (x) << " " << (y)<< endl
#define watch(x)            cout << (#x) << " is " << (x) << endl
#define hitAi               ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)

#define ll                  long long int
#define xx                  first
#define yy                  second
#define pb(x)               push_back(x)
#define PI                  acos(-1.0)

#define PII                 pair<int, int>
#define PLL                 pair<Long long int, Long long int>
#define VI                  vector <int>

using namespace std;

VI s;

int main ()
{
    hitAi;
    ll n , x , testCase , ans = 0 ,  count = 0 ;
    //freopen("E:/Desktop/Programming/Codeforce/input.txt", "r" , stdin );

    cin >> testCase;

    while (testCase--){
        cin >> n ;
        FORN(i,n*2){
            cin >> x;
            s.pb(x);
        }
        sort(ALL(s));

        cout << s[n] - s[n-1] << endl;

    }

}


#include <bits/stdc++.h>

#define MEM(a, b)           memset(a, (b), sizeof(a))
#define CLR(a)              memset(a, 0, sizeof(a))
#define MAX(a, b)           ((a) > (b) ? (a) : (b))
#define MIN(a, b)           ((a) < (b) ? (a) : (b))
#define ABS(X)              ( (X) > 0 ? (X) : ( -(X) ) )
#define S(X)                ( (X) * (X) )
#define SZ(V)               (int )V.size()
#define FORN(i, n)          for(int i = 0; i < n; i++)
#define FORAB(i, a, b)      for(int i = a; i <= b; i++)
#define ALL(V)              V.begin(), V.end()
#define IN(A, B, C)         ((B) <= (A) && (A) <= (C))
//#define AIN(A, B, C)        assert(IN(A, B, C))

#define watch2(x , y)       cout << (#x) << " " << (#y)<< " is " << (x) << " " << (y)<< endl
#define watch(x)            cout << (#x) << " is " << (x) << endl
#define hitAi               ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)

#define ll                  long long int
#define xx                  first
#define yy                  second
#define pb(x)               push_back(x)
#define PI                  acos(-1.0)

#define PII                 pair<int, int>
#define PLL                 pair<Long long int, Long long int>
#define VI                  vector <int>

using namespace std;

int main ()
{
    hitAi;
    int n , x , testCase , ans = 0 , sum = 0 , a , b , c , count = 0 ;
    //freopen("E:/Desktop/Programming/Codeforce/input.txt", "r" , stdin );

    cin >> testCase;

    int s[100005];

    while (testCase--){
        a=0;
        b=0;
        int as=0;
        int bs=0;
        cin >> n ;
        n*=2;
        FORN(i,n){
            cin >> s[i];
        }
        sort(s+0,s+n);
        a+=s[n-1];
        b+=s[n-2];
        FORN(i,n-2){
            if (n-i-2<3){
              if (a<b){
                a+=s[i];
                i++;
                a+=s[i];
            }
            else {
                b+=s[i];
                i++;
                b+=s[i];
            }
            }
            else {
                if (a<b){
                    a+=s[i];
                    i++;
                    b+=s[i];
                    i++;
                    b+=s[i];
                    i++;
                    a+=s[i];
                }
                else {
                    b+=s[i];
                    i++;
                    a+=s[i];
                    i++;
                    a+=s[i];
                    i++;
                    b+=s[i];
                }
            }

        }

        cout << ABS(a-b) << endl;

    }

}


#include <bits/stdc++.h>

#define MEM(a, b)           memset(a, (b), sizeof(a))
#define CLR(a)              memset(a, 0, sizeof(a))
#define MAX(a, b)           ((a) > (b) ? (a) : (b))
#define MIN(a, b)           ((a) < (b) ? (a) : (b))
#define ABS(X)              ( (X) > 0 ? (X) : ( -(X) ) )
#define S(X)                ( (X) * (X) )
#define SZ(V)               (int )V.size()
#define FORN(i, n)          for(int i = 0; i < n; i++)
#define FORAB(i, a, b)      for(int i = a; i <= b; i++)
#define ALL(V)              V.begin(), V.end()
#define IN(A, B, C)         ((B) <= (A) && (A) <= (C))
//#define AIN(A, B, C)        assert(IN(A, B, C))

#define watch2(x , y)       cout << (#x) << " " << (#y)<< " is " << (x) << " " << (y)<< endl
#define watch(x)            cout << (#x) << " is " << (x) << endl
#define hitAi               ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)

#define ll                  long long int
#define xx                  first
#define yy                  second
#define pb(x)               push_back(x)
#define PI                  acos(-1.0)

#define PII                 pair<int, int>
#define PLL                 pair<Long long int, Long long int>
#define VI                  vector <int>

using namespace std;

VI s;

int main ()
{
    hitAi;
    ll n , x , testCase , ans = 0 ,  count = 0 ;
    //freopen("E:/Desktop/Programming/Codeforce/input.txt", "r" , stdin );

    cin >> testCase;

    while (testCase--){
        cin >> n ;
        FORN(i,n*2){
            cin >> x;
            s.pb(x);
        }
        sort(ALL(s));

        //cout << s[n] << " " << s[n-1] ;

        cout << s[n] - s[n-1] << endl;

        s.clear();

    }

}


#include <bits/stdc++.h>

#define MEM(a, b)           memset(a, (b), sizeof(a))
#define CLR(a)              memset(a, 0, sizeof(a))
#define MAX(a, b)           ((a) > (b) ? (a) : (b))
#define MIN(a, b)           ((a) < (b) ? (a) : (b))
#define ABS(X)              ( (X) > 0 ? (X) : ( -(X) ) )
#define S(X)                ( (X) * (X) )
#define SZ(V)               (int )V.size()
#define FORN(i, n)          for(int i = 0; i < n; i++)
#define FORAB(i, a, b)      for(int i = a; i <= b; i++)
#define ALL(V)              V.begin(), V.end()
#define IN(A, B, C)         ((B) <= (A) && (A) <= (C))
//#define AIN(A, B, C)        assert(IN(A, B, C))

#define watch2(x , y)       cout << (#x) << " " << (#y)<< " is " << (x) << " " << (y)<< endl
#define watch(x)            cout << (#x) << " is " << (x) << endl
#define hitAi               ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)

#define ll                  long long int
#define xx                  first
#define yy                  second
#define pb(x)               push_back(x)
#define PI                  acos(-1.0)

#define PII                 pair<int, int>
#define PLL                 pair<Long long int, Long long int>
#define VI                  vector <int>

using namespace std;
ll a,b,sum = 0 , temp;

ll s[100005];

int main ()
{
    hitAi;
    ll n , x , testCase , ans = 0 ,  count = 0 ;
    //freopen("E:/Desktop/Programming/Codeforce/input.txt", "r" , stdin );

    cin >> testCase;

    while (testCase--){
        sum=0;
        a=0;
        b=0;
        cin >> n ;
        n*=2;
        FORN(i,n){
            cin >> s[i];
            sum+=s[i];
        }
        sort(s+0,s+n);

        cout << s[n-1]-s[n-2] << endl;

    }

}


#include <bits/stdc++.h>

#define MEM(a, b)           memset(a, (b), sizeof(a))
#define CLR(a)              memset(a, 0, sizeof(a))
#define MAX(a, b)           ((a) > (b) ? (a) : (b))
#define MIN(a, b)           ((a) < (b) ? (a) : (b))
#define ABS(X)              ( (X) > 0 ? (X) : ( -(X) ) )
#define S(X)                ( (X) * (X) )
#define SZ(V)               (int )V.size()
#define FORN(i, n)          for(int i = 0; i < n; i++)
#define FORAB(i, a, b)      for(int i = a; i <= b; i++)
#define ALL(V)              V.begin(), V.end()
#define IN(A, B, C)         ((B) <= (A) && (A) <= (C))
//#define AIN(A, B, C)        assert(IN(A, B, C))

#define watch2(x , y)       cout << (#x) << " " << (#y)<< " is " << (x) << " " << (y)<< endl
#define watch(x)            cout << (#x) << " is " << (x) << endl
#define hitAi               ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)

#define ll                  long long int
#define xx                  first
#define yy                  second
#define pb(x)               push_back(x)
#define PI                  acos(-1.0)

#define PII                 pair<int, int>
#define PLL                 pair<Long long int, Long long int>
#define VI                  vector <int>

using namespace std;

ll s[100005];

int main ()
{
    hitAi;
    ll n , x , testCase , ans = 0 ,  count = 0 ;
    //freopen("E:/Desktop/Programming/Codeforce/input.txt", "r" , stdin );

    cin >> testCase;

    while (testCase--){
        cin >> n ;
        FORN(i,n*2){
            cin >> s[i];
        }
        sort(s,s+n*2);

        cout << s[n] - s[n-1] << endl;

    }

}


#include <bits/stdc++.h>

#define MEM(a, b)           memset(a, (b), sizeof(a))
#define CLR(a)              memset(a, 0, sizeof(a))
#define MAX(a, b)           ((a) > (b) ? (a) : (b))
#define MIN(a, b)           ((a) < (b) ? (a) : (b))
#define ABS(X)              ( (X) > 0 ? (X) : ( -(X) ) )
#define S(X)                ( (X) * (X) )
#define SZ(V)               (int )V.size()
#define FORN(i, n)          for(int i = 0; i < n; i++)
#define FORAB(i, a, b)      for(int i = a; i <= b; i++)
#define ALL(V)              V.begin(), V.end()
#define IN(A, B, C)         ((B) <= (A) && (A) <= (C))
//#define AIN(A, B, C)        assert(IN(A, B, C))

#define watch2(x , y)       cout << (#x) << " " << (#y)<< " is " << (x) << " " << (y)<< endl
#define watch(x)            cout << (#x) << " is " << (x) << endl
#define hitAi               ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)

#define ll                  long long int
#define xx                  first
#define yy                  second
#define pb(x)               push_back(x)
#define PI                  acos(-1.0)

#define PII                 pair<int, int>
#define PLL                 pair<Long long int, Long long int>
#define VI                  vector <int>

using namespace std;

int main ()
{
    hitAi;
    ll n , x , testCase , ans = 0 , sum = 0 , a , b , c , count = 0 ;
    //freopen("E:/Desktop/Programming/Codeforce/input.txt", "r" , stdin );

    cin >> testCase;

    ll s[100005];

    while (testCase--){
            MEM(s,0);
        a=0;
        b=0;
        cin >> n ;
        n*=2;
        FORN(i,n){
            cin >> s[i];
        }
        sort(s+0,s+n);
        a+=s[n-1];
        b+=s[n-2];
        FORN(i,n-2){
            if (n-i-2<3){
              if (a<b){
                a+=s[i];
                i++;
                a+=s[i];
            }
            else {
                b+=s[i];
                i++;
                b+=s[i];
            }
            }
            else {
                if (a<b){
                    a+=s[i];
                    i++;
                    b+=s[i];
                    i++;
                    b+=s[i];
                    i++;
                    a+=s[i];
                }
                else {
                    b+=s[i];
                    i++;
                    a+=s[i];
                    i++;
                    a+=s[i];
                    i++;
                    b+=s[i];
                }
            }

        }

        cout << ABS(a-b) << endl;

    }

}


#include<iostream>
#include<algorihtm>
using namespace std;

int main(){
    int t;
    scanf("%d",&t);
    while(t--){
        int n;
        scanf("%d",&n);
        int a[2*n];
        for(int i=0;i<2*n;i++){
            scanf("%d",&a[i]);
        }
        sort(a,a+2*n);
        int ans=a[n]-a[n-1];
        printf("%d",ans);
    }
    return 0;
}


#include<iostream>
#include<algorihtm>
using namespace std;

int main(){
    int t;
    scanf("%d",&t);
    while(t--){
        int n;
        scanf("%d",&n);
        int a[2*n];
        for(int i=0;i<2*n;i++){
            scanf("%d",&a[i]);
        }
        sort(a,a+2*n);
        int ans=a[n]-a[n-1];
        printf(ans);
    }
    return 0;
}


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

int main(){
    int t;
    cin>>t;
    while(t--){
        int n;
        cin>>n;
        int a[2*n];
        for(int i=0;i<2*n;i++){
            cin>>a[i];
        }
        sort(a,a+n+n);
        cout<<(a[n+1]-a[n])<<endl;
    }
    return 0;
}


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

int main(){
    int t;
    cin>>t;
    while(t--){
        int n;
        cin>>n;
        int a[2*n];
        for(int i=0;i<2*n;i++){
            cin>>a[i];
        }
        sort(a,a+2*n);
        int ans=a[n]-a[n-1];
        cout<<ans<<endl;
    }
    return 0;
}


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

int main(){
    int t;
    scanf("%d",&t);
    while(t--){
        int n;
        scanf("%d",&n);
        int a[2*n];
        for(int i=0;i<2*n;i++){
            scanf("%d",&a[i]);
        }
        sort(a,a+2*n);
        int ans=a[n]-a[n-1];
        printf(ans);
    }
    return 0;
}


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

int main(){
    int t;
    scanf("%d",&t);
    while(t--){
        int n;
        scanf("%d",&n);
        int a[2*n];
        for(int i=0;i<2*n;i++){
            scanf("%d",&a[i]);
        }
        sort(a,a+2*n);
        int ans=a[n]-a[n-1];
        printf("%d\n",ans);
    }
    return 0;
}


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

int main(){
    int t;
    scanf("%d",&t);
    while(t--){
        int n;
        scanf("%d",&n);
        int a[2*n];
        for(int i=0;i<2*n;i++){
            scanf("%d",&a[i]);
        }
        sort(a,a+2*n);
        int ans=a[n]-a[n-1];
        printf("%d",ans);
    }
    return 0;
}


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

int main(){
    int t;
    cin>>t;
    while(t--){
        int n;
        cin>>n;
        int a[2*n];
        for(int i=0;i<2*n;i++){
            cin>>a[i];
        }
        sort(a,a+2*n);
        int ans=a[n+1]-a[n];
        cout<<ans<<endl;
    }
    return 0;
}


#include<stdio.h>
#include<stdlib.h>

struct Node
{
	Node *parent, *left, *right, *child;
	int degree, marked, value;
};

Node* removeList(Node* a)					// Removes a from list: Does not modify its parent
{
	a->marked=0;
	if(a->left==a) return NULL;
	a->left->right=a->right;
	a->right->left=a->left;
	Node* left=a->left;
	a->right=a; a->left=a;
	return left;
}

Node* mergeList(Node* c, Node* b)			// Merges lists a,b: Does not modify parents
{
	if(!b || !c)
		return b? b: c;
	b->left->right=c->right;
	c->right->left=b->left;
	b->left=c;
	c->right=b;
	return b;
}

struct Heap
{
	Node *min;
	int size, roots;
};

int getMin(Heap *a)							// Non empty heap only
{
	return a->min->value;
}

void merge(Heap *a, Heap *b)				// Merges two heaps
{
	a->size+=b->size;
	a->roots+=b->roots;
	if(!a->roots || (b->roots && getMin(b)<getMin(a)))
		a->min=b->min;
	mergeList(a->min,b->min);
}

void insert(Heap* a, int v)
{
	a->size++;
	a->roots++;

	Node* n=new Node;
	n->child=NULL;
	n->left=n;
	n->right=n;
	n->parent=NULL;
	n->value=v;

	mergeList(a->min,n);
	if(!a->min || v<getMin(a))
		a->min=n;
}

void combine(Node* a, Node* b) 				// Sets b as child of a
{
	a->degree++;
	b->parent=a;
	a->child=mergeList(a->child,b);
}

void checkSameDeg(Node** nodeDeg, Node* a)		// Checks if a exist in nodeDeg then combine else insert
{
	int deg=a->degree;
	Node* b=nodeDeg[deg];
	if(!b)
	{
		nodeDeg[deg]=a;
		return;
	}
	nodeDeg[deg]=NULL;
	if(a->value > b->value)
	{
		Node* temp=a;
		a=b; b=temp;
	}
	removeList(b);
	combine(a,b);
	checkSameDeg(nodeDeg, a);
}

int delMin(Heap* a)						// Non empty heap only
{
	// Step 1:
	a->size--;	a->roots--;
	Node* min=a->min;
	Node* root=removeList(min);

	// Step 2:
	for(auto itr=min->child; itr and itr->parent; itr=itr->right)
	{
		itr->parent=NULL;
		a->roots++;
	}
	root=mergeList(root, min->child);
	if(a->roots==0)
	{
		int mn=min->value;
		delete min;
		return mn;
	}

	// Step 3:
	int maxDegree=0;
	Node** roots=new Node*[a->roots];
	for(int i=0; i<a->roots; i++)
	{
		roots[i]=root;
		if(root->degree>maxDegree) maxDegree=root->degree;
		root=root->right;
	}
	// Stores all the roots and gets maxDegree
	Node** nodeDeg=new Node*[a->roots+maxDegree];
	for(int i=0; i<a->roots+maxDegree; i++)
		nodeDeg[i]=NULL;
	for(int i=0; i<a->roots; i++)
		checkSameDeg(nodeDeg, roots[i]);

	// Step 4:
	Node* newMin=NULL;
	int newRoots=0;
	for(int i=0; i<a->roots+maxDegree; i++)
	{
		if(!nodeDeg[i]) continue;
		if(!newMin or newMin->value > nodeDeg[i]->value)
			newMin=nodeDeg[i];
		newRoots++;
	}
	a->roots=newRoots;
	a->min=newMin;

	int v=min->value;
	delete min;
	delete[] roots;
	delete[] nodeDeg;
	return v;
}

void cut(Node* a, Heap* h)
{
	Node* p=a->parent;
	if(p==NULL) return;
	a->parent=NULL;
	p->child=removeList(a);
	mergeList(h->min, a);
	if(a->value<h->min->value)
		h->min=a;
	if(p->marked)
		cut(p,h);
}

void update(Node* a, int v, Heap* h)
{
	a->value=v;
	if(a->parent and a->value<v)
		cut(a,h);
}

void test()
{
	Heap* h=new Heap;
	h->min=NULL;
	h->size=0;
	h->roots=0;
	int n; scanf("%d", &n);
	int* a=new int[2*n];
	for(int i=0;i<2*n;i++) scanf("%d",a+i);
	for(int i=0; i<2*n; i++) insert(h,a[i]);
	for(int i=0; i<2*n;i++)
		a[i]=delMin(h);
	printf("%d\n",a[n]-a[n-1]);
}

int main()
{
	int q; scanf("%d", &q);
	while(q--) test();
}


#include<stdio.h>
#include<stdlib.h>

struct Node
{
	Node *parent, *left, *right, *child;
	int degree, marked, value;
};

Node* removeList(Node* a)					// Removes a from list: Does not modify its parent
{
	a->marked=0;
	if(a->left==a) return NULL;
	a->left->right=a->right;
	a->right->left=a->left;
	Node* left=a->left;
	a->right=a; a->left=a;
	return left;
}

Node* mergeList(Node* c, Node* b)			// Merges lists a,b: Does not modify parents
{
	if(!b || !c)
		return b? b: c;
	b->left->right=c->right;
	c->right->left=b->left;
	b->left=c;
	c->right=b;
	return b;
}

struct Heap
{
	Node *min;
	int size, roots;
};

int getMin(Heap *a)							// Non empty heap only
{
	return a->min->value;
}

void merge(Heap *a, Heap *b)				// Merges two heaps
{
	a->size+=b->size;
	a->roots+=b->roots;
	if(!a->roots || (b->roots && getMin(b)<getMin(a)))
		a->min=b->min;
	mergeList(a->min,b->min);
}

void insert(Heap* a, int v)
{
	a->size++;
	a->roots++;

	Node* n=new Node;
	n->child=NULL;
	n->left=n;
	n->right=n;
	n->parent=NULL;
	n->value=v;

	mergeList(a->min,n);
	if(!a->min || v<getMin(a))
		a->min=n;
}

void combine(Node* a, Node* b) 				// Sets b as child of a
{
	a->degree++;
	b->parent=a;
	a->child=mergeList(a->child,b);
}

void checkSameDeg(Node** nodeDeg, Node* a)		// Checks if a exist in nodeDeg then combine else insert
{
	int deg=a->degree;
	Node* b=nodeDeg[deg];
	if(!b)
	{
		nodeDeg[deg]=a;
		return;
	}
	nodeDeg[deg]=NULL;
	if(a->value > b->value)
	{
		Node* temp=a;
		a=b; b=temp;
	}
	removeList(b);
	combine(a,b);
	checkSameDeg(nodeDeg, a);
}

int delMin(Heap* a)						// Non empty heap only
{
	// Step 1:
	a->size--;	a->roots--;
	Node* min=a->min;
	Node* root=removeList(min);

	// Step 2:
	for(auto itr=min->child; itr and itr->parent; itr=itr->right)
	{
		itr->parent=NULL;
		a->roots++;
	}
	root=mergeList(root, min->child);
	if(a->roots==0)
	{
		int mn=min->value;
		return mn;
	}

	// Step 3:
	int maxDegree=0;
	Node** roots=new Node*[a->roots];
	for(int i=0; i<a->roots; i++)
	{
		roots[i]=root;
		if(root->degree>maxDegree) maxDegree=root->degree;
		root=root->right;
	}
	// Stores all the roots and gets maxDegree
	Node** nodeDeg=new Node*[a->roots+maxDegree];
	for(int i=0; i<a->roots+maxDegree; i++)
		nodeDeg[i]=NULL;
	for(int i=0; i<a->roots; i++)
		checkSameDeg(nodeDeg, roots[i]);

	// Step 4:
	Node* newMin=NULL;
	int newRoots=0;
	for(int i=0; i<a->roots+maxDegree; i++)
	{
		if(!nodeDeg[i]) continue;
		if(!newMin or newMin->value > nodeDeg[i]->value)
			newMin=nodeDeg[i];
		newRoots++;
	}
	a->roots=newRoots;
	a->min=newMin;

	int v=min->value;
	return v;
}

void cut(Node* a, Heap* h)
{
	Node* p=a->parent;
	if(p==NULL) return;
	a->parent=NULL;
	p->child=removeList(a);
	mergeList(h->min, a);
	if(a->value<h->min->value)
		h->min=a;
	if(p->marked)
		cut(p,h);
}

void update(Node* a, int v, Heap* h)
{
	a->value=v;
	if(a->parent and a->value<v)
		cut(a,h);
}

void test()
{
	Heap* h=new Heap;
	h->min=NULL;
	h->size=0;
	h->roots=0;
	int n; scanf("%d", &n);
	int* a=new int[2*n];
	for(int i=0;i<2*n;i++) scanf("%d",a+i);
	for(int i=0; i<2*n; i++) insert(h,a[i]);
	for(int i=0; i<2*n;i++)
		a[i]=delMin(h);
	printf("%d\n",a[n]-a[n-1]);
}

int main()
{
	int q; scanf("%d", &q);
	while(q--) test();
}


#include<stdio.h>
#include<stdlib.h>
#include<algorithm>
#include<time.h>

struct Node
{
	Node *parent, *left, *right, *child;
	int degree, marked, value;
};

Node* removeList(Node* a)					// Removes a from list: Does not modify its parent
{
	a->marked=0;
	if(a->left==a) return NULL;
	a->left->right=a->right;
	a->right->left=a->left;
	Node* left=a->left;
	a->right=a; a->left=a;
	return left;
}

Node* mergeList(Node* c, Node* b)			// Merges lists a,b: Does not modify parents
{
	if(!b || !c)
		return b? b: c;
	b->left->right=c->right;
	c->right->left=b->left;
	b->left=c;
	c->right=b;
	return b;
}

struct Heap
{
	Node *min;
	int size, roots;
};

int getMin(Heap *a)							// Non empty heap only
{
	return a->min->value;
}

void merge(Heap *a, Heap *b)				// Merges two heaps
{
	a->size+=b->size;
	a->roots+=b->roots;
	if(!a->roots || (b->roots && getMin(b)<getMin(a)))
		a->min=b->min;
	mergeList(a->min,b->min);
}

Node* newNode(int v)						// Creates New Node
{
	Node* n=new Node;
	n->child=NULL;
	n->degree=0;
	n->left=n;
	n->marked=false;
	n->right=n;
	n->parent=NULL;
	n->value=v;
	return n;
}

void insert(Heap* a, int v)					// Insert In heap
{
	a->size++;
	a->roots++;
	Node* n=newNode(v);
	mergeList(a->min,n);
	if(!a->min || v<getMin(a))
		a->min=n;
}

void combine(Node* a, Node* b) 				// Sets b as child of a
{
	a->degree++;
	b->parent=a;
	a->child=mergeList(a->child,b);
}

void checkSameDeg(Node** nodeDeg, Node* a)	// Checks if a exist in nodeDeg then combine else insert
{
	int deg=a->degree;
	Node* b=nodeDeg[deg];
	if(!b)
	{
		nodeDeg[deg]=a;
		return;
	}
	nodeDeg[deg]=NULL;
	if(a->value > b->value)
	{
		Node* temp=a;
		a=b; b=temp;
	}
	removeList(b);
	combine(a,b);
	checkSameDeg(nodeDeg, a);
}

int delMin(Heap* a)							// Removes and returns min :Non empty heap only
{
	// Step 1:
	a->size--;	a->roots--;
	Node* min=a->min;
	Node* root=removeList(min);

	// Step 2:
	for(auto itr=min->child; itr and itr->parent; itr=itr->right)
	{
		itr->parent=NULL;
		a->roots++;
	}
	root=mergeList(root, min->child);
	if(a->roots==0)
	{
		a->min=NULL;
		if(a->size!=0) printf("Fuck");
		int mn=min->value;
		delete min;
		return mn;
	}

	// Step 3:
	int maxDegree=0;
	Node** roots=new Node*[a->roots];
	for(int i=0; i<a->roots; i++)
	{
		roots[i]=root;
		if(root->degree>maxDegree) maxDegree=root->degree;
		root=root->right;
	}
	// Stores all the roots and gets maxDegree
	Node** nodeDeg=new Node*[a->roots+maxDegree];
	for(int i=0; i<a->roots+maxDegree; i++)
		nodeDeg[i]=NULL;
	for(int i=0; i<a->roots; i++)
		checkSameDeg(nodeDeg, roots[i]);
	Node* newMin=NULL;
	int newRoots=0;
	for(int i=0; i<a->roots+maxDegree; i++)
	{
		if(!nodeDeg[i]) continue;
		if(!newMin or newMin->value > nodeDeg[i]->value)
			newMin=nodeDeg[i];
		newRoots++;
	}
	a->roots=newRoots;
	a->min=newMin;

	int v=min->value;
	delete min;
	delete[] roots;
	delete[] nodeDeg;
	return v;
}

void cut(Node* a, Heap* h)					// Removes edge between node and parent
{
	Node* p=a->parent;
	if(p==NULL) return;
	a->parent=NULL;
	p->child=removeList(a);
	mergeList(h->min, a);
	h->roots++;
	if(a->value<h->min->value)
		h->min=a;
	if(p->marked++)
		cut(p,h);
}

void update(Node* a, int v, Heap* h)		// Updates Values in node a to v
{
	a->value=v;
	if(a->parent and a->value<v)
		cut(a,h);
}

void deleteNode(Node *a, Heap* h)			// Delets Node a
{
	update(a,-(1<<30),h);
	delMin(h);
}

Heap* newHeap()								// Creates New Heap
{
	Heap* h=new Heap;
	h->min=NULL;
	h->roots=0;
	h->size=0;
	return h;
}

void test()
{
	Heap* h=newHeap();
	int n; scanf("%d", &n);
	int* a=new int[2*n];
	for(int i=0;i<2*n;i++) scanf("%d",a+i);
	for(int i=0; i<2*n; i++) insert(h,a[i]);
	for(int i=0; i<2*n;i++)
		a[i]=delMin(h);
	printf("%d\n",a[n]-a[n-1]);
}

int main()
{
	int q; scanf("%d", &q);
	while(q--) test();
}


// C++ program to demonstrate Extract min, Deletion()
// and Decrease key() operations in a fibonacci heap
#include<bits/stdc++.h>
using namespace std;

// Creating a structure to represent a node in the heap
struct node {
	node* parent; // Parent pointer
	node* child; // Child pointer
	node* left; // Pointer to the node on the left
	node* right; // Pointer to the node on the right
	int key; // Value of the node
	int degree; // Degree of the node
	char mark; // Black or white mark of the node
	char c; // Flag for assisting in the Find node function
};

// Creating min pointer as "mini"
struct node* mini = NULL;

// Declare an integer for number of nodes in the heap
int no_of_nodes = 0;

// Function to insert a node in heap
void insertion(int val)
{
	struct node* new_node = (struct node*)malloc(sizeof(struct node));
	new_node->key = val;
	new_node->degree = 0;
	new_node->mark = 'W';
	new_node->c = 'N';
	new_node->parent = NULL;
	new_node->child = NULL;
	new_node->left = new_node;
	new_node->right = new_node;
	if (mini != NULL) {
		(mini->left)->right = new_node;
		new_node->right = mini;
		new_node->left = mini->left;
		mini->left = new_node;
		if (new_node->key < mini->key)
			mini = new_node;
	}
	else {
		mini = new_node;
	}
	no_of_nodes++;
}
// Linking the heap nodes in parent child relationship
void Fibonnaci_link(struct node* ptr2, struct node* ptr1)
{
	(ptr2->left)->right = ptr2->right;
	(ptr2->right)->left = ptr2->left;
	if (ptr1->right == ptr1)
		mini = ptr1;
	ptr2->left = ptr2;
	ptr2->right = ptr2;
	ptr2->parent = ptr1;
	if (ptr1->child == NULL)
		ptr1->child = ptr2;
	ptr2->right = ptr1->child;
	ptr2->left = (ptr1->child)->left;
	((ptr1->child)->left)->right = ptr2;
	(ptr1->child)->left = ptr2;
	if (ptr2->key < (ptr1->child)->key)
		ptr1->child = ptr2;
	ptr1->degree++;
}
// Consolidating the heap
void Consolidate()
{
	int temp1;
	float temp2 = (log(no_of_nodes)) / (log(2));
	int temp3 = temp2;
	struct node* arr[temp3];
	for (int i = 0; i <= temp3; i++)
		arr[i] = NULL;
	node* ptr1 = mini;
	node* ptr2;
	node* ptr3;
	node* ptr4 = ptr1;
	do {
		ptr4 = ptr4->right;
		temp1 = ptr1->degree;
		while (arr[temp1] != NULL) {
			ptr2 = arr[temp1];
			if (ptr1->key > ptr2->key) {
				ptr3 = ptr1;
				ptr1 = ptr2;
				ptr2 = ptr3;
			}
			if (ptr2 == mini)
				mini = ptr1;
			Fibonnaci_link(ptr2, ptr1);
			if (ptr1->right == ptr1)
				mini = ptr1;
			arr[temp1] = NULL;
			temp1++;
		}
		arr[temp1] = ptr1;
		ptr1 = ptr1->right;
	} while (ptr1 != mini);
	mini = NULL;
	for (int j = 0; j <= temp3; j++) {
		if (arr[j] != NULL) {
			arr[j]->left = arr[j];
			arr[j]->right = arr[j];
			if (mini != NULL) {
				(mini->left)->right = arr[j];
				arr[j]->right = mini;
				arr[j]->left = mini->left;
				mini->left = arr[j];
				if (arr[j]->key < mini->key)
					mini = arr[j];
			}
			else {
				mini = arr[j];
			}
			if (mini == NULL)
				mini = arr[j];
			else if (arr[j]->key < mini->key)
				mini = arr[j];
		}
	}
}

// Function to extract minimum node in the heap
void Extract_min()
{
	if (mini == NULL)
		cout << "The heap is empty" << endl;
	else {
		node* temp = mini;
		node* pntr;
		pntr = temp;
		node* x = NULL;
		if (temp->child != NULL) {

			x = temp->child;
			do {
				pntr = x->right;
				(mini->left)->right = x;
				x->right = mini;
				x->left = mini->left;
				mini->left = x;
				if (x->key < mini->key)
					mini = x;
				x->parent = NULL;
				x = pntr;
			} while (pntr != temp->child);
		}
		(temp->left)->right = temp->right;
		(temp->right)->left = temp->left;
		mini = temp->right;
		if (temp == temp->right && temp->child == NULL)
			mini = NULL;
		else {
			mini = temp->right;
			Consolidate();
		}
		no_of_nodes--;
	}
}

// Cutting a node in the heap to be placed in the root list
void Cut(struct node* found, struct node* temp)
{
	if (found == found->right)
		temp->child = NULL;

	(found->left)->right = found->right;
	(found->right)->left = found->left;
	if (found == temp->child)
		temp->child = found->right;

	temp->degree = temp->degree - 1;
	found->right = found;
	found->left = found;
	(mini->left)->right = found;
	found->right = mini;
	found->left = mini->left;
	mini->left = found;
	found->parent = NULL;
	found->mark = 'B';
}

// Recursive cascade cutting function
void Cascase_cut(struct node* temp)
{
	node* ptr5 = temp->parent;
	if (ptr5 != NULL) {
		if (temp->mark == 'W') {
			temp->mark = 'B';
		}
		else {
			Cut(temp, ptr5);
			Cascase_cut(ptr5);
		}
	}
}

// Function to decrease the value of a node in the heap
void Decrease_key(struct node* found, int val)
{
	if (mini == NULL)
		cout << "The Heap is Empty" << endl;

	if (found == NULL)
		cout << "Node not found in the Heap" << endl;

	found->key = val;

	struct node* temp = found->parent;
	if (temp != NULL && found->key < temp->key) {
		Cut(found, temp);
		Cascase_cut(temp);
	}
	if (found->key < mini->key)
		mini = found;
}

// Function to find the given node
void Find(struct node* mini, int old_val, int val)
{
	struct node* found = NULL;
	node* temp5 = mini;
	temp5->c = 'Y';
	node* found_ptr = NULL;
	if (temp5->key == old_val) {
		found_ptr = temp5;
		temp5->c = 'N';
		found = found_ptr;
		Decrease_key(found, val);
	}
	if (found_ptr == NULL) {
		if (temp5->child != NULL)
			Find(temp5->child, old_val, val);
		if ((temp5->right)->c != 'Y')
			Find(temp5->right, old_val, val);
	}
	temp5->c = 'N';
	found = found_ptr;
}

// Deleting a node from the heap
void Deletion(int val)
{
	if (mini == NULL)
		cout << "The heap is empty" << endl;
	else {

		// Decreasing the value of the node to 0
		Find(mini, val, 0);

		// Calling Extract_min function to
		// delete minimum value node, which is 0
		Extract_min();
		cout << "Key Deleted" << endl;
	}
}

// Function to display the heap
void display()
{
	node* ptr = mini;
	if (ptr == NULL)
		cout << "The Heap is Empty" << endl;

	else {
		cout << "The root nodes of Heap are: " << endl;
		do {
			cout << ptr->key;
			ptr = ptr->right;
			if (ptr != mini) {
				cout << "-->";
			}
		} while (ptr != mini && ptr->right != NULL);
		cout << endl
			<< "The heap has " << no_of_nodes << " nodes" << endl
			<< endl;
	}
}

void test()
{
	int n; scanf("%d", &n);
	int* a=new int[2*n];
	for(int i=0;i<2*n;i++) scanf("%d",a+i);
	for(int i=0; i<2*n; i++) insertion(a[i]);
	for(int i=0; i<2*n;i++)
	{
		a[i]=mini->key;
		Extract_min();
	}
	printf("%d\n",a[n]-a[n-1]);
}

int main()
{
	int q; scanf("%d", &q);
	while(q--) test();
}


#include<bits/stdc++.h>
using namespace std;
void test()
{
	int n; cin>>n;
	int* a=new int[2*n];
	for(int i=0;i<2*n;i++) scanf("%d",a+i);
	sort(a,a+2*n);
	printf("%d\n",a[n]-a[n-1]);
}
int main()
{
	int q; cin>>q;
	while(q--) test();
}


#include<stdio.h>
#include<stdlib.h>

struct Node
{
	Node *parent, *left, *right, *child;
	int degree, marked, value;
};

Node* removeList(Node* a)					// Removes a from list: Does not modify its parent
{
	a->marked=0;
	if(a->left==a) return NULL;
	a->left->right=a->right;
	a->right->left=a->left;
	Node* left=a->left;
	a->right=a; a->left=a;
	return left;
}

Node* mergeList(Node* c, Node* b)			// Merges lists a,b: Does not modify parents
{
	if(!b || !c)
		return b? b: c;
	b->left->right=c->right;
	c->right->left=b->left;
	b->left=c;
	c->right=b;
}

struct Heap
{
	Node *min;
	int size, roots;
};

int getMin(Heap *a)							// Non empty heap only
{
	return a->min->value;
}

void merge(Heap *a, Heap *b)				// Merges two heaps
{
	a->size+=b->size;
	a->roots+=b->roots;
	if(!a->roots || (b->roots && getMin(b)<getMin(a)))
		a->min=b->min;
	mergeList(a->min,b->min);
}

void insert(Heap* a, int v)
{
	a->size++;
	a->roots++;

	Node* n=new Node;
	n->child=NULL;
	n->left=n;
	n->right=n;
	n->parent=NULL;
	n->value=v;

	mergeList(a->min,n);
	if(!a->min || v<getMin(a))
		a->min=n;
}

void combine(Node* a, Node* b) 				// Sets b as child of a
{
	a->degree++;
	b->parent=a;
	a->child=mergeList(a->child,b);
}

void checkSameDeg(Node** nodeDeg, Node* a)		// Checks if a exist in nodeDeg then combine else insert
{
	int deg=a->degree;
	Node* b=nodeDeg[deg];
	if(!b)
	{
		nodeDeg[deg]=a;
		return;
	}
	nodeDeg[deg]=NULL;
	if(a->value > b->value)
	{
		Node* temp=a;
		a=b; b=temp;
	}
	removeList(b);
	combine(a,b);
	checkSameDeg(nodeDeg, a);
}

int delMin(Heap* a)						// Non empty heap only
{
	// Step 1:
	a->size--;	a->roots--;
	Node* min=a->min;
	Node* root=removeList(min);

	// Step 2:
	for(auto itr=min->child; itr and itr->parent; itr=itr->right)
	{
		itr->parent=NULL;
		a->roots++;
	}
	root=mergeList(root, min->child);
	if(a->roots==0)
	{
		int mn=min->value;
		delete min;
		return mn;
	}

	// Step 3:
	int maxDegree=0;
	Node** roots=new Node*[a->roots];
	for(int i=0; i<a->roots; i++)
	{
		roots[i]=root;
		if(root->degree>maxDegree) maxDegree=root->degree;
		root=root->right;
	}
	// Stores all the roots and gets maxDegree
	Node** nodeDeg=new Node*[a->roots+maxDegree];
	for(int i=0; i<a->roots+maxDegree; i++)
		nodeDeg[i]=NULL;
	for(int i=0; i<a->roots; i++)
		checkSameDeg(nodeDeg, roots[i]);

	// Step 4:
	Node* newMin=NULL;
	int newRoots=0;
	for(int i=0; i<a->roots+maxDegree; i++)
	{
		if(!nodeDeg[i]) continue;
		if(!newMin or newMin->value > nodeDeg[i]->value)
			newMin=nodeDeg[i];
		newRoots++;
	}
	a->roots=newRoots;
	a->min=newMin;

	int v=min->value;
	delete min;
	delete[] roots;
	delete[] nodeDeg;
	return v;
}

void cut(Node* a, Heap* h)
{
	Node* p=a->parent;
	if(p==NULL) return;
	a->parent=NULL;
	p->child=removeList(a);
	mergeList(h->min, a);
	if(a->value<h->min->value)
		h->min=a;
	if(p->marked)
		cut(p,h);
}

void update(Node* a, int v, Heap* h)
{
	a->value=v;
	if(a->parent and a->value<v)
		cut(a,h);
}

void test()
{
	Heap* h=new Heap;
	h->min=NULL;
	h->size=0;
	h->roots=0;
	int n; scanf("%d", &n);
	int* a=new int[2*n];
	for(int i=0;i<2*n;i++) scanf("%d",a+i);
	for(int i=0; i<2*n; i++) insert(h,a[i]);
	for(int i=0; i<2*n;i++)
		a[i]=delMin(h);
	printf("%d\n",a[n]-a[n-1]);
}

int main()
{
	int q; scanf("%d", &q);
	while(q--) test();
}


#include<bits/stdc++.h>
using namespace std;
#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
long long mx(long long a,long long b){if(a>b)return a;else return b;}
long long mn(long long a,long long b){if(a<b)return a;else return b;}
long long cei(long long a,long long b){if(a%b==0)return a/b;else return (a/b+1);}
const int MOD=1e9+7;
long long po(long long a,long long b){long long res=1;while(b>0){res=(res*a);res%=MOD;b--;}return res;}
long long ab(long long a,long long b){if(a>b)return a-b;else return b-a;}
int main()
{
int t;
cin>>t;
while(t--)
{
    int n;
    cin>>n;
    long long a[2*n];
    for(int i=0;i<2*n;i++)
        cin>>a[i];
    sort(a,a+2*n);
    vector<int>first,second;
    for(int i=0;i<2*n;i++)
    {
        if(i&1)first.push_back(a[i]);
        else second.push_back(a[i]);
    }
    if(!(n&1)){if(first[n/2]>second[n/2]){first.push_back(second.back());cout<<ab(first[(n+1)/2],second[(n-1)/2])<<endl;}
    else {second.push_back(first.back());cout<<ab(first[(n-1)/2],second[(n+1)/2])<<endl;}
      //for(int i=0;i<n;i++)cout<<first[i]<<" "<<second[i]<<endl;
      //cout<<second[(n-1)/2]<<endl;
      //cout<<ab(first[(n+1)/2],second[(n-1)/2])<<endl;
    }
    else
    cout<<ab(first[n/2],second[n/2])<<endl;

}
}


#include<bits/stdc++.h>
using namespace std;
#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
long long mx(long long a,long long b){if(a>b)return a;else return b;}
long long mn(long long a,long long b){if(a<b)return a;else return b;}
long long cei(long long a,long long b){if(a%b==0)return a/b;else return (a/b+1);}
const int MOD=1e9+7;
long long po(long long a,long long b){long long res=1;while(b>0){res=(res*a);res%=MOD;b--;}return res;}
long long ab(long long a,long long b){if(a>b)return a-b;else return b-a;}
int main()
{
int t;
cin>>t;
while(t--)
{
    int n;
    cin>>n;
    long long a[2*n];
    for(int i=0;i<2*n;i++)
        cin>>a[i];
    sort(a,a+2*n);
    vector<int>first,second;
    for(int i=0;i<2*n;i++)
    {
        if(i&1)first.push_back(a[i]);
        else second.push_back(a[i]);
    }
    cout<<ab(first[n/2],second[n/2])<<endl;
}
}


#include<bits/stdc++.h>
using namespace std;
#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
long long mx(long long a,long long b){if(a>b)return a;else return b;}
long long mn(long long a,long long b){if(a<b)return a;else return b;}
long long cei(long long a,long long b){if(a%b==0)return a/b;else return (a/b+1);}
const int MOD=1e9+7;
long long po(long long a,long long b){long long res=1;while(b>0){res=(res*a);res%=MOD;b--;}return res;}
long long ab(long long a,long long b){if(a>b)return a-b;else return b-a;}
int main()
{
int t;
cin>>t;
while(t--)
{
    int n;
    cin>>n;
    long long a[2*n];
    for(int i=0;i<2*n;i++)
        cin>>a[i];
    sort(a,a+2*n);
    vector<int>first,second;
    for(int i=0;i<2*n;i++)
    {
        if(i&1)first.push_back(a[i]);
        else second.push_back(a[i]);
    }
    if(n&1)
    cout<<ab(first[n/2],second[n/2])<<endl;
    else
    {
        int x=(first[(n/2)-1]+first[(n/2)])/2;
        int y=(second[n/2]+second[(n/2)-1])/2;
        cout<<ab(x,y)<<endl;
    }
}
}


#include<bits/stdc++.h>
using namespace std;
#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
long long mx(long long a,long long b){if(a>b)return a;else return b;}
long long mn(long long a,long long b){if(a<b)return a;else return b;}
long long cei(long long a,long long b){if(a%b==0)return a/b;else return (a/b+1);}
const int MOD=1e9+7;
long long po(long long a,long long b){long long res=1;while(b>0){res=(res*a);res%=MOD;b--;}return res;}
long long ab(long long a,long long b){if(a>b)return a-b;else return b-a;}
int main()
{
int t;
cin>>t;
while(t--)
{
    int n;
    cin>>n;
    long long a[2*n];
    for(int i=0;i<2*n;i++)
        cin>>a[i];
    sort(a,a+2*n);
    vector<int>first,second;
    for(int i=0;i<2*n;i++)
    {
        if(i&1)first.push_back(a[i]);
        else second.push_back(a[i]);
    }
    if(!(n&1)){first.push_back(second.back());

      cout<<ab(first[(n/2)+1],second[(n/2)-1])<<endl;
    }
    else
    cout<<ab(first[n/2],second[n/2])<<endl;

}
}


#include<bits/stdc++.h>
using namespace std;
#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
long long mx(long long a,long long b){if(a>b)return a;else return b;}
long long mn(long long a,long long b){if(a<b)return a;else return b;}
long long cei(long long a,long long b){if(a%b==0)return a/b;else return (a/b+1);}
const int MOD=1e9+7;
long long po(long long a,long long b){long long res=1;while(b>0){res=(res*a);res%=MOD;b--;}return res;}
long long ab(long long a,long long b){if(a>b)return a-b;else return b-a;}
int main()
{
int t;
cin>>t;
while(t--)
{
    int n;
    cin>>n;
    long long a[2*n];
    for(int i=0;i<2*n;i++)
        cin>>a[i];
    sort(a,a+2*n);
    vector<int>first,second;
    for(int i=0;i<2*n;i++)
    {
        if(i&1)first.push_back(a[i]);
        else second.push_back(a[i]);
    }
    if(!(n&1))first.push_back(second.back());

    cout<<ab(first[n/2],second[(n/2)-1])<<endl;

}
}


#include<bits/stdc++.h>
using namespace std;
#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
long long mx(long long a,long long b){if(a>b)return a;else return b;}
long long mn(long long a,long long b){if(a<b)return a;else return b;}
long long cei(long long a,long long b){if(a%b==0)return a/b;else return (a/b+1);}
const int MOD=1e9+7;
long long po(long long a,long long b){long long res=1;while(b>0){res=(res*a);res%=MOD;b--;}return res;}
long long ab(long long a,long long b){if(a>b)return a-b;else return b-a;}
int main()
{
int t;
cin>>t;
while(t--)
{
    int n;
    cin>>n;
    long long a[2*n];
    for(int i=0;i<2*n;i++)
        cin>>a[i];
    sort(a,a+2*n);
    vector<int>first,second;
    for(int i=0;i<2*n;i++)
    {
        if(i&1)first.push_back(a[i]);
        else second.push_back(a[i]);
    }
    if(!(n&1)){first.push_back(second.back());

      cout<<ab(first[(first.size()/2)],second[(n-1)/2])<<endl;
    }
    else
    cout<<ab(first[n/2],second[n/2])<<endl;

}
}


#include<bits/stdc++.h>
using namespace std;
#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
long long mx(long long a,long long b){if(a>b)return a;else return b;}
long long mn(long long a,long long b){if(a<b)return a;else return b;}
long long cei(long long a,long long b){if(a%b==0)return a/b;else return (a/b+1);}
const int MOD=1e9+7;
long long po(long long a,long long b){long long res=1;while(b>0){res=(res*a);res%=MOD;b--;}return res;}
long long ab(long long a,long long b){if(a>b)return a-b;else return b-a;}
int main()
{
int t;
cin>>t;
while(t--)
{
    int n;
    cin>>n;
    long long a[2*n];
    for(int i=0;i<2*n;i++)
        cin>>a[i];
    sort(a,a+2*n);
    int ans=INT_MAX;
    int x=n;
    for(int i=0;i<x;i++)
    {
        //cout<<a[x]<<endl;
     ans=mn(ans,ab(a[i],a[x]));
    }

      //for(int i=0;i<n;i++)cout<<first[i]<<" "<<second[i]<<endl;
      //cout<<second[(n-1)/2]<<endl;
      //cout<<ab(first[(n+1)/2],second[(n-1)/2])<<endl;
      cout<<ans<<endl;
    }

}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define f first
#define s second
#define PLL pair<ll,ll>
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
using namespace std;
using namespace __gnu_pbds;
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ordset;
const ll inf=LLONG_MAX;

int main()
{
    //ios_base::sync_with_stdio(false);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    ll q;cin>>q;
    while(q--){
        ll n;cin>>n;
        vector<ll> a(n*2);
        n*=2;
        for(int i=0;i<n;i++){
            cin>>a[i];
        }
        sort(a.begin(),a.end());
        cout<<a[(n-1)/2+1]-a[(n-1)/2];

    }

    return 0;
}
///by Rumazius


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define f first
#define s second
#define PLL pair<ll,ll>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("O3")
using namespace std;
using namespace __gnu_pbds;
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ordset;
const ll inf=1e16;

int main()
{
    //ios_base::sync_with_stdio(false);cin.tie(0);
    ll q;cin>>q;
    while(q--){
        ll n;
        cin>>n;
        n*=2;
        vector<ll> a(1e5+1,0);
        for(int i=0;i<n;i++){
            ll x;cin>>x;
            a[x]++;
        }ll gde;
        ll ans=0;
        if(n%4==2){
            gde=n/2;
            for(int i=1;i<=1e5;i++){
                while(a[i]>0){
                    a[i]--;
                    gde--;
                    if(gde==0) ans+=i;
                    if(gde==-1){
                        ans-=i;
                        break;
                    }
                }
                if(gde==-1) break;
            }
        }else{
            gde=n/2-1;
            ll carry=gde;
            ll ans1=0,ans2=0;
            for(int i=1;i<=1e5;i++){
                while(a[i]>0){
                    a[i]--;
                    gde--;
                    if(gde==0) ans1+=i;
                    if(gde==-1){
                        ans1-=i;
                        break;
                    }
                    if(gde==-1)break;
                }
            }gde=carry;
            for(int i=1e5;i>=1;i--){
                while(a[i]>0){
                    a[i]--;
                    gde--;
                    if(gde==0) ans2-=i;
                    if(gde==-1){
                        ans2+=i;
                        break;
                    }
                    if(gde==-1)break;
                }
            }
            ans=max(ans1,ans2);
        }
        cout<<-ans<<'\n';
    }

    return 0;
}
// by Rumazius


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define f first
#define s second
#define PLL pair<ll,ll>
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
using namespace std;
using namespace __gnu_pbds;
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ordset;
const ll inf=LLONG_MAX;

int main()
{
    //ios_base::sync_with_stdio(false);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    ll q;cin>>q;
    while(q--){
        ordset s;
        ll n;cin>>n;
        n*=2;
        for(int i=0;i<n;i++){
            ll x;cin>>x;
            s.insert(x);
        }
        ll ans=*s.find_by_order(n/2+1);ans-=*s.find_by_order(n/2);
        cout<<ans<<'\n';

    }

    return 0;
}
///by Rumazius


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define f first
#define s second
#define PLL pair<ll,ll>
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
using namespace std;
using namespace __gnu_pbds;
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ordset;
const ll inf=LLONG_MAX;

int main()
{
    //ios_base::sync_with_stdio(false);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    ll q;cin>>q;
    while(q--){
        ordset s;
        ll n;cin>>n;
        n*=2;
        for(int i=0;i<n;i++){
            ll x;cin>>x;
            s.insert(x);
        }
        s.insert(-inf);
        ll ans=*s.find_by_order(n/2+1);ans-=*s.find_by_order(n/2);
        cout<<ans<<'\n';

    }

    return 0;
}
///by Rumazius


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define f first
#define s second
#define PLL pair<ll,ll>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("O3")
using namespace std;
using namespace __gnu_pbds;
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ordset;
const ll inf=1e16;

int main()
{
    //ios_base::sync_with_stdio(false);cin.tie(0);
    ll q;cin>>q;
    while(q--){
        ll n;
        cin>>n;
        n*=2;
        vector<ll> a(1e5+1,0);
        for(int i=0;i<n;i++){
            ll x;cin>>x;
            a[x]++;
        }ll gde;
        if(n%4==2) gde=n/2;else{
            gde=n/2-1;
        }
        ll ans=0;
        for(int i=1;i<=1e5;i++){
            while(a[i]>0){
                gde--;
                a[i]--;
                if(gde==0) ans+=i;
                if(gde==-1){
                    ans-=i;
                    break;
                }
            }
            if(gde==-1) break;
        }
        cout<<-ans<<'\n';
    }

    return 0;
}
// by Rumazius


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define f first
#define s second
#define PLL pair<ll,ll>
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
using namespace std;
using namespace __gnu_pbds;
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ordset;
const ll inf=LLONG_MAX;

int main()
{
    //ios_base::sync_with_stdio(false);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    ll q;cin>>q;
    while(q--){
        ll n;cin>>n;
        vector<ll> a(n*2);
        n*=2;
        for(int i=0;i<n;i++){
            cin>>a[i];
        }
        sort(a.begin(),a.end());
        cout<<a[(n-1)/2+1]-a[(n-1)/2]<<'\n';

    }

    return 0;
}
///by Rumazius


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int t;
    cin>>t;
    while(t--)
    {
        long long int n;
        cin>>n;
        vector<long long int> v(2*n);
        for(long long int i=0;i<n;i++)
            cin>>v[i];
        sort(v.begin(),v.end());
        cout<<v[n]-v[n-1]<<"\n";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int t;
    cin>>t;
    while(t--)
    {
        ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
        long long int n;
        cin>>n;
        vector<long long int> v(2*n);
        for(long long int i=0;i<2*n;i++)
            cin>>v[i];
        sort(v.begin(),v.end());
        cout<<v[n]-v[n-1]<<"\n";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int t;
    cin>>t;
    while(t--)
    {
        long long int n;
        vector<long long int> v(2*n);
        for(long long int i=0;i<n;i++)
            cin>>v[i];
        sort(v.begin(),v.end());
        cout<<v[n]-v[n-1]<<"\n";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int t;
    cin>>t;
    while(t--)
    {
        ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
        long long int n;
        cin>>n;
        vector<long long int> v(2*n);
        for(long long int i=0;i<2*n;i++)
            cin>>v[i];
        sort(v.begin(),v.end());
        cout<<v[n]-v[n-1]<<"\n";
    }
    return 0;


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int t;
    cin>>t;
    while(t--)
    {
        long long int n;
        cin>>n;
        vector<long long int> v(2*n);
        for(long long int i=0;i<2*n;i++)
            cin>>v[i];
        sort(v.begin(),v.end());
        cout<<v[n]-v[n-1]<<"\n";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int t;
    cin>>t;
    while(t--)
    {
        long long int n;
        vector<long long int> v(2*n);
        for(long long int i=0;i<2*n;i++)
            cin>>v[i];
        sort(v.begin(),v.end());
        cout<<v[n]-v[n-1]<<"\n";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    long long int t;
    cin>>t;
    while(t--)
    {
        long long int n;
        cin>>n;
        vector<long long int> v(2*n);
        for(long long int i=0;i<2*n;i++)
            cin>>v[i];
        sort(v.begin(),v.end());
        cout<<v[n]-v[n-1]<<"\n";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int t;
    cin>>t;
    while(t--)
    {
        ios_base::stdio(false);cin.tie(0);cout.tie(0);
        long long int n;
        cin>>n;
        vector<long long int> v(2*n);
        for(long long int i=0;i<2*n;i++)
            cin>>v[i];
        sort(v.begin(),v.end());
        cout<<v[n]-v[n-1]<<"\n";
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ar array
#define ll long long

const int MAX_N = 1e5 + 1;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll LINF = 1e18;

// void fastscan(ll &x)
//   {
//         bool neg=false;
//         register int c;
//         x =0;
//         c=getchar();
//         if(c=='-')
//         {
//             neg = true;
//             c=getchar();
//         }
//         for(;(c>47 && c<58);c=getchar())
//             x = (x<<1) + (x<<3) +c -48;
//         if(neg)
//             x *=-1;
//     }
int main() {
	ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
//   	ll a[1000];
//   	for(int  i=0;i<1000;i++)
//   	{
//   		fastscan(a[i]);
//	}
////	for(int  i=0;i<1000;i++)
////   	{
////   		cin>>a[i];
////	}
//	time(&end);
	ll t,a[MAX_N],n;
	cin>>t;
	while(t--)
	{
	cin>>n;
	for(ll i=0;i<2*n;i++)
	{
		cin>>a[i];
	}
	sort(a,a+2*n);
	cout<<abs(a[n-1]-a[n])<<endl;
    }
}


#include <bits/stdc++.h>

using namespace std;

#define ar array
#define ll long long

const int MAX_N = 1e5 + 1;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll LINF = 1e18;

// void fastscan(ll &x)
//   {
//         bool neg=false;
//         register int c;
//         x =0;
//         c=getchar();
//         if(c=='-')
//         {
//             neg = true;
//             c=getchar();
//         }
//         for(;(c>47 && c<58);c=getchar())
//             x = (x<<1) + (x<<3) +c -48;
//         if(neg)
//             x *=-1;
//     }
int main() {
	ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
//   	ll a[1000];
//   	for(int  i=0;i<1000;i++)
//   	{
//   		fastscan(a[i]);
//	}
////	for(int  i=0;i<1000;i++)
////   	{
////   		cin>>a[i];
////	}
//	time(&end);
	ll t,n;
	cin>>t;
	while(t--)
	{
	cin>>n;
	vector<int> a(2 * n);
	for(ll i=0;i<2*n;i++)
	{
		cin>>a[i];
	}
	a.sort(a.begin(),a.end());
	cout<<(a[n]-a[n-1])<<endl;
    }
}


#include <bits/stdc++.h>

using namespace std;

#define ar array
#define ll long long

const int MAX_N = 1e5 + 1;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll LINF = 1e18;

void fastscan(ll &x)
   {
        bool neg=false;
        register int c;
        x =0;
        c=getchar();
        if(c=='-')
        {
            neg = true;
            c=getchar();
        }
        for(;(c>47 && c<58);c=getchar())
            x = (x<<1) + (x<<3) +c -48;
        if(neg)
            x *=-1;
    }
int main() {
	ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
//   	ll a[1000];
//   	for(int  i=0;i<1000;i++)
//   	{
//   		fastscan(a[i]);
//	}
////	for(int  i=0;i<1000;i++)
////   	{
////   		cin>>a[i];
////	}
//	time(&end);
	ll t,a[MAX_N],n;
	cin>>t;
	while(t--)
	{
	fastscan(n);
	for(int i =0;i<2*n;i++)
	{
		fastscan(a[i]);
	}
	sort(a,a+2*n);
	cout<<abs(a[n-1]-a[n])<<endl;
    }
}


#include <bits/stdc++.h>

using namespace std;

#define ar array
#define ll long long

const int MAX_N = 1e5 + 1;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll LINF = 1e18;

// void fastscan(ll &x)
//   {
//         bool neg=false;
//         register int c;
//         x =0;
//         c=getchar();
//         if(c=='-')
//         {
//             neg = true;
//             c=getchar();
//         }
//         for(;(c>47 && c<58);c=getchar())
//             x = (x<<1) + (x<<3) +c -48;
//         if(neg)
//             x *=-1;
//     }
int main() {
	ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
//   	ll a[1000];
//   	for(int  i=0;i<1000;i++)
//   	{
//   		fastscan(a[i]);
//	}
////	for(int  i=0;i<1000;i++)
////   	{
////   		cin>>a[i];
////	}
//	time(&end);
	ll t,a[MAX_N],n;
	cin>>t;
	while(t--)
	{
	scanf("%d",&n);
	for(int i=0;i<2*n;i++)
	{
		cin>>a[i];
	}
	sort(a,a+2*n);
	cout<<abs(a[n-1]-a[n])<<endl;
    }
}


#include <bits/stdc++.h>

using namespace std;

#define ar array
#define ll long long

const int MAX_N = 1e5 + 1;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll LINF = 1e18;

void fastscan(ll &x)
   {
        bool neg=false;
        register int c;
        x =0;
        c=getchar();
        if(c=='-')
        {
            neg = true;
            c=getchar();
        }
        for(;(c>47 && c<58);c=getchar())
            x = (x<<1) + (x<<3) +c -48;
        if(neg)
            x *=-1;
    }
int main() {
	ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
//   	ll a[1000];
//   	for(int  i=0;i<1000;i++)
//   	{
//   		fastscan(a[i]);
//	}
////	for(int  i=0;i<1000;i++)
////   	{
////   		cin>>a[i];
////	}
//	time(&end);
	ll t,a[MAX_N],n;
	cin>>t;
	while(t--)
	{
	scanf("%ld",&a[i]);
	for(int i =0;i<2*n;i++)
	{
		scanf("%ld",&a[i]);
	}
	sort(a,a+2*n);
	cout<<abs(a[n-1]-a[n])<<endl;
    }
}


#include <bits/stdc++.h>

using namespace std;

#define ar array
#define ll long long

const int MAX_N = 1e5 + 1;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll LINF = 1e18;

// void fastscan(ll &x)
//   {
//         bool neg=false;
//         register int c;
//         x =0;
//         c=getchar();
//         if(c=='-')
//         {
//             neg = true;
//             c=getchar();
//         }
//         for(;(c>47 && c<58);c=getchar())
//             x = (x<<1) + (x<<3) +c -48;
//         if(neg)
//             x *=-1;
//     }
int main() {
	ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
//   	ll a[1000];
//   	for(int  i=0;i<1000;i++)
//   	{
//   		fastscan(a[i]);
//	}
////	for(int  i=0;i<1000;i++)
////   	{
////   		cin>>a[i];
////	}
//	time(&end);
	ll t,a[MAX_N],n;
	cin>>t;
	while(t--)
	{
	scanf("%d",&n);
	for(int i=0;i<2*n;i++)
	{
		cin>>a[i]
	}
	sort(a,a+2*n);
	cout<<abs(a[n-1]-a[n])<<endl;
    }
}


#include <bits/stdc++.h>

using namespace std;

#define ar array
#define ll long long

const int MAX_N = 1e5 + 1;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll LINF = 1e18;

// void fastscan(ll &x)
//   {
//         bool neg=false;
//         register int c;
//         x =0;
//         c=getchar();
//         if(c=='-')
//         {
//             neg = true;
//             c=getchar();
//         }
//         for(;(c>47 && c<58);c=getchar())
//             x = (x<<1) + (x<<3) +c -48;
//         if(neg)
//             x *=-1;
//     }
int main() {
	ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
//   	ll a[1000];
//   	for(int  i=0;i<1000;i++)
//   	{
//   		fastscan(a[i]);
//	}
////	for(int  i=0;i<1000;i++)
////   	{
////   		cin>>a[i];
////	}
//	time(&end);
	ll t,a[MAX_N],n;
	cin>>t;
	while(t--)
	{
	scanf("%d",&a[i]);
	for(int i =0;i<2*n;i++)
	{
		scanf("%d",&a[i]);
	}
	sort(a,a+2*n);
	cout<<abs(a[n-1]-a[n])<<endl;
    }
}


#include <bits/stdc++.h>

using namespace std;

#define ar array
#define ll long long

const int MAX_N = 1e5 + 1;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll LINF = 1e18;

// void fastscan(ll &x)
//   {
//         bool neg=false;
//         register int c;
//         x =0;
//         c=getchar();
//         if(c=='-')
//         {
//             neg = true;
//             c=getchar();
//         }
//         for(;(c>47 && c<58);c=getchar())
//             x = (x<<1) + (x<<3) +c -48;
//         if(neg)
//             x *=-1;
//     }
int main() {
	ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
//   	ll a[1000];
//   	for(int  i=0;i<1000;i++)
//   	{
//   		fastscan(a[i]);
//	}
////	for(int  i=0;i<1000;i++)
////   	{
////   		cin>>a[i];
////	}
//	time(&end);
	ll t,a[MAX_N],n;
	cin>>t;
	while(t--)
	{
	cin>>n;
	for(ll i=0;i<2*n;i++)
	{
		cin>>a[i];
	}
	sort(a,a+2*n);
	cout<<(a[n]-a[n-1])<<endl;
    }
}


#include <bits/stdc++.h>

using namespace std;

#define ar array
#define ll long long

const int MAX_N = 1e5 + 1;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll LINF = 1e18;

// void fastscan(ll &x)
//   {
//         bool neg=false;
//         register int c;
//         x =0;
//         c=getchar();
//         if(c=='-')
//         {
//             neg = true;
//             c=getchar();
//         }
//         for(;(c>47 && c<58);c=getchar())
//             x = (x<<1) + (x<<3) +c -48;
//         if(neg)
//             x *=-1;
//     }
int main() {
	ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
//   	ll a[1000];
//   	for(int  i=0;i<1000;i++)
//   	{
//   		fastscan(a[i]);
//	}
////	for(int  i=0;i<1000;i++)
////   	{
////   		cin>>a[i];
////	}
//	time(&end);
	ll t,a[MAX_N],n;
	cin>>t;
	while(t--)
	{
	scanf("%d",&n);
	for(int i =0;i<2*n;i++)
	{
		scanf("%d",&a[i]);
	}
	sort(a,a+2*n);
	cout<<abs(a[n-1]-a[n])<<endl;
    }
}


#include <bits/stdc++.h>

using namespace std;

#define ar array
#define ll long long

const int MAX_N = 1e5 + 1;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll LINF = 1e18;

// void fastscan(ll &x)
//   {
//         bool neg=false;
//         register int c;
//         x =0;
//         c=getchar();
//         if(c=='-')
//         {
//             neg = true;
//             c=getchar();
//         }
//         for(;(c>47 && c<58);c=getchar())
//             x = (x<<1) + (x<<3) +c -48;
//         if(neg)
//             x *=-1;
//     }
int main() {
	ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
//   	ll a[1000];
//   	for(int  i=0;i<1000;i++)
//   	{
//   		fastscan(a[i]);
//	}
////	for(int  i=0;i<1000;i++)
////   	{
////   		cin>>a[i];
////	}
//	time(&end);
	ll t,n;
	cin>>t;
	while(t--)
	{
	cin>>n;
	vector<int> a(2 * n);
	for(ll i=0;i<2*n;i++)
	{
		cin>>a[i];
	}
	sort(a.begin(),a.end());
	cout<<(a[n]-a[n-1])<<endl;
    }
}


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

int main () {
    int t;
    cin>>t;
    while (t--) {
        int n;
        cin>>n;
        vector <long long int> a(2*n);
        for (long long int i=0; i<2*n; i++) {
            cin>>a[i];
        }
        sort(a.begin(), a.end());
        long long int mod=a[n]-a[n-1];
        cout<<mod<<endl;
    } return 0;
}


#include <iostream>
#include <vector>
using namespace std;

int main () {
    int t;
    cin>>t;
    while (t--) {
        int n;
        cin>>n;
        vector <long long int> a(2*n);
        for (long long int i=0; i<2*n; i++) {
            cin>>a[i];
        }
        sort(a.begin(), a.end());
        long long int mod=a[n]-a[n-1];
        cout<<mod<<endl;
    } return 0;
}


#include <iostream>
#include <vector>
using namespace std;
void isort(int a[], int n) {
    for (int i=0; i<n-1; i++) {
        int mindex=i;
        for (int j=i+1; j<n; j++) {
            if (a[mindex]>a[j]) mindex=j;
        } int temp=a[i];
        a[i]=a[mindex];
        a[mindex]=temp;
    }
}
int main () {
    int t;
    cin>>t;
    while (t--) {
        int n;
        cin>>n;
        int a[2*n];
        for (int i=0; i<2*n; i++) {
            cin>>a[i];
        }
        isort(a, 2*n);
        int mod=a[n]-a[n-1];
        cout<<mod<<endl;
    } return 0;
}


#include <iostream>
#include <vector>
using namespace std;
void isort(long long int a[], int n) {
    for (int i=0; i<n-1; i++) {
        int mindex=i;
        for (int j=i+1; j<n; j++) {
            if (a[mindex]>a[j]) mindex=j;
        } long long int temp=a[i];
        a[i]=a[mindex];
        a[mindex]=temp;
    }
}
int main () {
    int t;
    cin>>t;
    while (t--) {
        int n;
        cin>>n;
        long long int a[2*n];
        for (int i=0; i<2*n; i++) {
            cin>>a[i];
        }
        isort(a, 2*n);
        long long int mod=a[n]-a[n-1];
        cout<<mod<<endl;
    } return 0;
}


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

int main () {
    int t;
    cin>>t;
    while (t--) {
        int n;
        cin>>n;
        vector <long long int> a(2*n);
        for (long long int i=0; i<2*n; i++) {
            cin>>a[i];
        }
        qsort(a.begin(), a.end());
        long long int mod=a[n]-a[n-1];
        cout<<mod<<endl;
    } return 0;
}


#include <iostream>
#include <vector>
using namespace std;

int main () {
    int t;
    cin>>t;
    while (t--) {
        int n;
        cin>>n;
        vector <long long int> a(2*n);
        for (long long int i=0; i<2*n; i++) {
            cin>>a[i];
        }
        qsort(a.begin(), a.end());
        long long int mod=a[n]-a[n-1];
        cout<<mod<<endl;
    } return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    int t,n,a[2*100000];
    cin>>t;
    while(t--){
        cin>>n;
        for(int i=0;i<2*n;i++){
            cin>>a[i];
        }
        sort(a,a+(2*n));
        cout<<abs(a[n-1]-a[n])<<endl;
    }
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    long long int t;
    cin>>t;
    while(t--){
        long long int n,a[1000000];
        cin>>n;
        for(int i=0;i<2*n;i++){
            cin>>a[i];
            for(int j=i;j>0;j--){
                if(a[j]<a[j-1]){
                    int temp=a[j];
                    a[j]=a[j-1];
                    a[j-1]=temp;
                }
            }
        }
        // sort(a,a+(2*n));
        cout<<abs(a[n-1]-a[n])<<endl;
    }
}


#pragma GCC optimize("omit-frame-pointer")
#pragma GCC optimize("unroll-loops")

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <cstring>
#include <iomanip>
#include <set>
#include <sstream>
#include <ctime>
#define rust(a, b, c, d) sqrt(sqr(a - c) + sqr(b - d))
#define sqr(a) (a)*(a)
#define m_p make_pair
#define fi first
#define se second
#define fast_io ios_base::sync_with_stdio(0);cin.tie(0)

typedef long long ll;
const int MAXINT=2147483640;
const ll MAXLL=9223372036854775800LL;
const ll MAXN=1000000;
const double pi=3.1415926535897932384626433832795;
using namespace std;

vector<ll> oor,aand,xoor;
ll b[600000][30];
pair<char,ll> x1[600000];
ll step[30000];
ll f[30000];

int main()
{
// freopen("1.in", "r", stdin);
// freopen("1.out", "w", stdout);

    fast_io;
    srand(time(0));

    ll n,val1=0, val2=0, val3=0, ans=0;
    ll z,a,m=0;

    cin >> n;
    for (int i=1; i<=n; i++) cin >> x1[i].fi >> x1[i].se;
    for (int i=1; i<=n; i++) {
        a=x1[i].se;
        z=1;
        while(a) a/=2, z++;
        m=max(z, m);
    }

    step[0]=1;
    for (int i=1; i<=40; i++) step[i]=step[i-1]*2;
    ll h=0;
    m=10;

    for (int i=1; i<=m; i++) b[i][1]=1, b[i][0]=0;

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

//        for (int j=1; j<=m; j++) cout << "j=" << j << " 1=" << b[j][1] << " 2=" << b[j][0] << endl;
//        cout << endl;\

        if (x1[i].fi=='&') h++;

        z=1;
        a=x1[i].se;
        for (int j=1; j<=m; j++) {

            if ((a%2)==1) {
                if (x1[i].fi=='|') b[z][1]=1, b[z][0]=1;
                else if (x1[i].fi=='^') {
                    b[z][0]=1-b[z][0];
                    b[z][1]=1-b[z][1];
                }
            }
            else {
                if (x1[i].fi=='&') b[z][1]=0, b[z][0]=0;
            }
            a/=2;
            z++;
        }
    }

//    for (int i=1; i<=m; i++) cout << "i=" << i << " 1=" << b[i][1] << " 2=" << b[i][0] << endl;

    for (int i=1; i<=m; i++) {

        if (b[i][1]==1 and b[i][0]==1) oor.push_back(i);
        else if (b[i][1]==0 and b[i][0]==0) aand.push_back(i);
        else if (b[i][1]==0 and b[i][0]==1) xoor.push_back(i);

    }

//    for (int i=0; i<aand.size(); i++) cout << aand[i] << " ";
//    cout << endl;

    val1=-1;
    val2=-1;
    val3=-1;
    if (oor.size()>0) {
        ans++;
        val1=0;
        for (int i=0; i<oor.size(); i++) val1+=step[oor[i]-1];
    }
    if (aand.size()>0) {
        ans++;
        val2=0;
//        for (int i=0; i<aand.size(); i++) val2+=step[aand[i]-1];
        for (int i=0; i<aand.size(); i++) f[aand[i]]=1;
        for (int i=1; i<=10; i++) if (f[i]==0) val2+=step[i-1];

    }
    if (xoor.size()>0) {
        ans++;
        val3=0;
        for (int i=0; i<xoor.size(); i++) val3+=step[xoor[i]-1];
    }

    cout << ans << endl;
    if (val2!=-1) cout << "& " << val2 << endl;
    if (val3!=-1) cout << "^ " << val3 << endl;
    if (val1!=-1) cout << "| " << val1 << endl;

    return 0;
}
/*
5 2
2 1 4 3 5
*/


#pragma GCC optimize("omit-frame-pointer")
#pragma GCC optimize("unroll-loops")

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <cstring>
#include <iomanip>
#include <set>
#include <sstream>
#include <ctime>
#define rust(a, b, c, d) sqrt(sqr(a - c) + sqr(b - d))
#define sqr(a) (a)*(a)
#define m_p make_pair
#define fi first
#define se second
#define fast_io ios_base::sync_with_stdio(0);cin.tie(0)

typedef long long ll;
const int MAXINT=2147483640;
const ll MAXLL=9223372036854775800LL;
const ll MAXN=1000000;
const double pi=3.1415926535897932384626433832795;
using namespace std;

vector<ll> oor,aand,xoor;
ll b[600000][30];
pair<char,ll> x1[600000];
ll step[30000];
ll f[30000];

int main()
{
// freopen("1.in", "r", stdin);
// freopen("1.out", "w", stdout);

    fast_io;
    srand(time(0));

    ll n,val1=0, val2=0, val3=0, ans=0;
    ll z,a,m=0;

    cin >> n;
    for (int i=1; i<=n; i++) cin >> x1[i].fi >> x1[i].se;
    for (int i=1; i<=n; i++) {
        a=x1[i].se;
        z=1;
        while(a) a/=2, z++;
        m=max(z, m);
    }

    step[0]=1;
    for (int i=1; i<=40; i++) step[i]=step[i-1]*2;
//    cout << "m=" << m << endl;

    for (int i=1; i<=m; i++) b[i][1]=1, b[i][0]=0;

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

//        for (int j=1; j<=m; j++) cout << "j=" << j << " 1=" << b[j][1] << " 2=" << b[j][0] << endl;
//        cout << endl;

        z=1;
        a=x1[i].se;
        for (int j=1; j<=m; j++) {

            if ((a%2)==1) {
                if (x1[i].fi=='|') b[z][1]=1, b[z][0]=1;
                else if (x1[i].fi=='^') {
                    b[z][0]=1-b[z][0];
                    b[z][1]=1-b[z][1];
                }
            }
            else {
                if (x1[i].fi=='&') b[z][1]=0, b[z][0]=0;
            }
            a/=2;
            z++;
        }
    }

//    for (int i=1; i<=m; i++) cout << "i=" << i << " 1=" << b[i][1] << " 2=" << b[i][0] << endl;

    for (int i=1; i<=m; i++) {

        if (b[i][1]==1 and b[i][0]==1) oor.push_back(i);
        else if (b[i][1]==0 and b[i][0]==0) aand.push_back(i);
        else if (b[i][1]==0 and b[i][0]==1) xoor.push_back(i);

    }

//    for (int i=0; i<aand.size(); i++) cout << aand[i] << " ";
//    cout << endl;

    if (oor.size()>0) {
        ans++;
        val1=0;
        for (int i=0; i<oor.size(); i++) val1+=step[oor[i]-1];
    }
    if (aand.size()>0) {
        ans++;
        val2=0;
//        for (int i=0; i<aand.size(); i++) f[aand[i]]=1;
//        for (int i=1; i<=m; i++) if (f[i]==0) val2+=step[i-1];
        for (int i=0; i<aand.size(); i++) val3+=step[aand[i]-1], val1+=step[aand[i]-1];
    }
//    if (xoor.size()>0) {
//        ans++;
//        val3=0;
//        for (int i=0; i<xoor.size(); i++) val3+=step[xoor[i]-1];
//    }

//    cout << 322 << endl;
ans=0;
    if (val1!=0) ans++;
    if (val2!=0) ans++;
    if (val3!=0) ans++;

    cout << ans << endl;
    if (val1!=0) cout << "| " << val1 << endl;
    if (val3!=0) cout << "^ " << val3 << endl;
    if (val2!=0) cout << "& " << val2 << endl;

    return 0;
}
/*
5 2
2 1 4 3 5
*/