#if 1

#include <bits/stdc++.h>
using namespace std;
int n,m;
int q;
long long a[100005],b[100005];

int main()
{
    scanf("%d %d %d", &n, &m, &q);
    for(int i = 1;i <= n;i++)
    {
        scanf("%lld",&a[i]);
    }
    a[0] = -1e18;
    a[n+1] = 1e18;
    for(int i = 1;i <= m;i++)
    {
        scanf("%lld",&b[i]);
    }
    b[m+1] = 1e18;
    b[0] = -1e18;
    long long al,ar,bl,br,x,y,z;
    for(int i = 1;i <= q;i++)
    {
        scanf("%lld",&x);
        ar = upper_bound(a+1,a+n+1,x)-a;
        al = upper_bound(a+1,a+n+1,x)-a-1;
        br = upper_bound(b+1,b+m+1,x)-b;
        bl = upper_bound(b+1,b+m+1,x)-b-1;
        //cout << al << " " << ar << " " << bl << " " << br << '\n';
        printf("%lld\n",min(min(x-min(a[al],b[bl]),max(b[br],a[ar])-x),min(min(a[ar]-x,x-b[bl])*2+max(a[ar]-x,x-b[bl]),min(b[br]-x,x-a[al])*2+max(b[br]-x,x-a[al]))));
    }
}

#endif // 1++
