#include <bits/stdc++.h>

#define rep(i, n) for(int i = 0; i < n; i++)

using namespace std;
using ll = long long;
int mod = 1000000007;

void solve();

int main(void){
    int A, B, Q; cin >> A >> B >> Q;
    ll S[A], T[B];
    rep(i, A) cin >> S[i];
    rep(i, B) cin >> T[i];
    rep(i, Q){
        ll x; cin >> x;
        //S[j] <= xなる最大のj, T[k] <= xなる最大のkを探す
        int oks = -1, ngs = A;
        ll m = (oks+ngs)/2;
        while(abs(ngs-oks) > 1){
            if(S[m] <= x) oks = m;
            else ngs = m;
            m = (oks+ngs)/2;
        }
        int okt = -1, ngt = B;
        m = (okt+ngt)/2;
        while(abs(ngt-okt) > 1){
            if(T[m] <= x) okt = m;
            else ngt = m;
            m = (okt+ngt)/2;
        }
        //cout << oks << " " << okt << endl;

        if(oks == -1 && okt == -1){
            cout << max(S[0]-x, T[0]-x) << endl;
        }
        else if(oks == -1){
            if(okt == B-1){
                cout << min(S[0]-x + abs(S[0]-T[B-1]), x-T[B-1] + abs(S[0]-T[B-1])) << endl;
            }
            else{
                ll res = min(S[0]-x + abs(S[0]-T[okt]), S[0]-x + abs(S[0]-T[okt+1]));
                res = min(res, abs(x-T[okt]) + abs(S[0]-T[okt]));
                res = min(res, abs(x-T[okt+1]) + abs(S[0]-T[okt+1]));
                cout << res << endl;
            }
        }
        else if(oks != -1 && okt == -1){
            if(oks == A-1){
                cout << min(T[0]-x + abs(T[0]-S[A-1]), x-S[A-1] + abs(T[0]-S[A-1])) << endl;
            }
            else{
                ll res = min(T[0]-x + abs(T[0]-S[oks]), T[0]-x + abs(T[0]-S[oks+1]));
                res = min(res, abs(x-S[oks]) + abs(T[0]-S[oks]));
                res = min(res, abs(x-S[oks+1]) + abs(T[0]-S[oks+1]));
                cout << res << endl;
            }
        }
        else{
            if(oks == A-1 && okt == B-1){
                cout << max(x-S[oks], x-T[okt]) << endl;
            }
            else if(oks == A-1){
                ll res = min(x-S[oks] + abs(S[oks]-T[okt]), x-S[oks] + abs(S[oks]-T[okt+1]));
                res = min(res, x-T[okt] + abs(T[okt]-S[oks]));
                res = min(res, abs(x-T[okt+1]) + abs(T[okt+1]-S[oks]));
                cout << res << endl;
            }
            else if(okt == B-1){
                ll res = min(x-T[okt] + abs(T[okt]-S[oks]), x-T[okt] + abs(T[okt]-S[oks+1]));
                res = min(res, x-S[oks] + abs(S[oks]-T[okt]));
                res = min(res, abs(x-S[oks+1]) + abs(S[oks+1]-T[okt]));
                cout << res << endl;
            }
            else{
                ll res = min(x-S[oks] + abs(T[okt]-S[oks]), x-S[oks] + abs(S[oks]-T[okt+1]));
                res = min(res, abs(x-S[oks+1]) + abs(S[oks+1]-T[okt]));
                res = min(res, abs(x-S[oks+1]) + abs(S[oks+1]-T[okt+1]));
                res = min(res, abs(x-T[okt]) + abs(T[okt]-S[oks]));
                res = min(res, abs(x-T[okt]) + abs(T[okt]-S[oks+1]));
                res = min(res, abs(x-T[okt+1]) + abs(T[okt+1]-S[oks]));
                res = min(res, abs(x-T[okt+1]) + abs(T[okt+1]-S[oks+1]));
                cout << res << endl;
            }
        }
    }
    return 0;
}

void solve(){}

Measured memory_bytes: 2816