#include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a,b) for(int i=a;i<=b;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define vi vector<int>
#define pb push_back
#define pi pair<int,int>
#define vp vector<pair<int,int> >
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define INF 10000000000
#define eps 1e-7
#define mod 1000000007
#define int ll
using namespace std;

signed main(void) {
    int A, B, Q;
    cin >> A >> B >> Q;
    deque<pi> street;
    vi pos;
    rep(i, A) {
        int s;
        cin >> s;
        pi tmp = mp(s, 0);
        street.pb(tmp);
        pos.pb(s);
    }
    rep(i, B) {
        int t;
        cin >> t;
        pi tmp = mp(t, 1);
        street.pb(tmp);
        pos.pb(t);
    }
    sort(all(street));
    sort(all(pos));

    int last_0 = INF;
    int last_1 = INF;
    vp next_one;
    rep(i, A+B) {
        if (street[i].se == 0) {
            if (last_1 >= INF) { //左ない
                pi tmp = mp(INF, INF);
                next_one.pb(tmp);
            } else { //左ある
                pi tmp = mp(street[i].fi - street[last_1].fi, INF);
                next_one.pb(tmp);
                next_one[last_1].se = min(next_one[last_1].se, street[i].fi - street[last_1].fi);
            }
            last_0 = i;
        } else { //1にいる
            if (last_0 >= INF) { //左ない
                pi tmp = mp(INF, INF);
                next_one.pb(tmp);
            } else { //左ある
                pi tmp = mp(street[i].fi - street[last_0].fi, INF);
                next_one.pb(tmp);
                next_one[last_0].se = min(next_one[last_0].se, street[i].fi - street[last_0].fi);
            }
            last_1 = i;
        }
    }

    last_0 = INF;
    last_1 = INF;
    rev(i, A+B) {
        if (street[i].se == 0) {
            if (last_1 >= INF) { //右ない
                next_one[i].se = INF;
            } else { //右ある
                next_one[i].se = min(next_one[i].se, street[last_1].fi - street[i].fi);
            }
            last_0 = i;
        } else { //1にいる
            if (last_0 >= INF) { //右ない
                next_one[i].se = INF;
            } else { //左ある
                next_one[i].se = min(next_one[i].se, street[last_0].fi - street[i].fi);
            }
            last_1 = i;
        }
    }


    rep(i, Q) {
        int x;
        cin >> x;

        // 左右のidx&種類を調べる
        int right_idx;
        int left_idx;
        if (pos[pos.size()-1] < x) {
            right_idx = INF;
            left_idx = pos.size()-1;
        } else {
            right_idx = (int)(upper_bound(all(pos), x) - pos.begin());
            left_idx = (right_idx == 0) ? INF : (right_idx - 1);
        }

        int r_r = ((right_idx >= INF) ? INF : street[right_idx].fi - x + next_one[right_idx].se);
        int r_l = ((right_idx >= INF) ? INF : street[right_idx].fi - x + next_one[right_idx].fi);
        int l_r = ((left_idx >= INF) ? INF : x - street[left_idx].fi + next_one[left_idx].se);
        int l_l = ((left_idx >= INF) ? INF : x - street[left_idx].fi + next_one[left_idx].fi);
        cout << (min(r_r, min(r_l, min(l_r, l_l)))) << endl;

    }

    return 0;
}


Measured memory_bytes: 11376