#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> lpair;
const ll MOD = 1e9 + 7;
#define rep(i,m,n) for(ll i = (m); i < (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define print2(x,y) cout << (x) << " " << (y) << endl;
#define printa(x,n) for(ll i = 0; i < n; i++){ cout << (x[i]) << " \n"[i == n-1];}
#define INF (1e18)

int main(){   
    cin.tie(0);
    ios::sync_with_stdio(false);
    // ll arr[5] = {0,100,200,300,400};
    // ll v = lower_bound(arr, arr+5, 199) - arr;
    // print(v);

    ll A,B,Q;
    ll s[100010], t[100010], x[100010];
    cin >> A >> B >> Q;
    rep(i,0,A) cin >> s[i];
    rep(i,0,B) cin >> t[i];
    rep(i,0,Q) cin >> x[i];
    // print("==-");
    rep(i,0,Q){
        ll ans = INF;
        ll p1 = lower_bound(s, s+A, x[i]) - s;
        ll p2 = lower_bound(t, t+B, x[i]) - t;
        if(p1 < A && p2 < B){
            ans = min(ans, max(s[p1] - x[i], t[p2] - x[i]));
        }
        if(p1 >= 1 && p2 >= 1){
            ans = min(ans, max(x[i] - s[p1-1], x[i] - t[p2-1]));
        }
        if(p1 < A && p2 >= 1){
            ans = min(ans, s[p1] - t[p2-1] + min(s[p1]-x[i], x[i]-t[p2-1]));
        }
        if(p1 >= 1 && p2 < B){
            ans = min(ans, t[p2] - s[p1-1] + min(t[p2]-x[i], x[i]-s[p1-1]));
        }
        print(ans);

        // if(upper_bound(s, s+A, x[i]) - lower_bound(s, s+A, x[i]) != 0){
        //     ll px = lower_bound(t, t+B, x[i]) - t;
        //     if(px >= 0 && px < B){
        //         ans = min(ans,abs(x[i] - t[px]));
        //     }
        //     if(px-1>= 0 && px-1 < B){
        //         ans = min(ans,abs(x[i] - t[px-1]));
        //     }

        // }else if(upper_bound(t, t+B, x[i]) - lower_bound(t, t+B, x[i]) != 0){
        //     ll px = lower_bound(s, s+A, x[i]) - s;
        //     if(px >= 0 && px < A){
        //         ans = min(ans,abs(x[i] - s[px]));
        //     }
        //     if(px-1>= 0 && px-1 < A){
        //         ans = min(ans,abs(x[i] - s[px-1]));
        //     }

        // }
        // ll pa = lower_bound(s, s+A, x[i]) - s - 1;
        // ll pb = lower_bound(t, t+B, x[i]) - t;
        // // print2(pa, pb);
        // if(pa < 0 || pa >= A || pb < 0 || pb >= B){
        // }else{
        //     ans = min(ans, abs(x[i] - s[pa]) + abs(x[i] - t[pb]) + min(abs(x[i] - s[pa]), abs(x[i] - t[pb])));
        // }
        // pa = lower_bound(s, s+A, x[i]) - s;
        // if(pa < 0 || pa >= A || pb < 0 || pb >= B){
        // }else{
        //     ans = min(ans, max(abs(s[pa] - x[i]), abs(t[pb] - x[i])));
        // }
        // pa = lower_bound(s, s+A, x[i]) - s - 1;
        // pb = lower_bound(t, t+B, x[i]) - t - 1;
        // if(pa < 0 || pa >= A || pb < 0 || pb >= B){
        // }else{
        //     ans = min(ans, max(abs(s[pa] - x[i]), abs(t[pb] - x[i])));
        // }
        // pb = lower_bound(t, t+B, x[i]) - t;
        // if(pa < 0 || pa >= A || pb < 0 || pb >= B){
        // }else{
        //     ans = min(ans, abs(x[i] - s[pa]) + abs(x[i] - t[pb]) + min(abs(x[i] - s[pa]), abs(x[i] - t[pb])));
        // }
        // print(ans);
    }


}


Measured memory_bytes: 3712