#include <bits/stdc++.h>

#define pi 2*acos(0)
#define INF 1e16
#define MIN 1e-9
#define min(a,b) (((a)<(b))?(a):(b))
#define max(a,b) (((a)>(b))?(a):(b))
#define m_p make_pair
#define p_b push_back
#define n_p(a) next_permutation(all(a))
#define all(v) v.begin(),v.end()
#define ii pair<int, int>
#define vi vector<int>
#define vii vector<ii>
#define rev(s) reverse(all(s))
#define ull unsigned long long
#define ll long long
#define MOD 1000000007
#define mem(a,k) memset(a,k,sizeof a)
#define REP(i, a, b) for (int i = int(a); i <= int(b); i++)
#define u_b(X,V) upper_bound(X.begin(),X.end(),V)
#define l_b(X,V) lower_bound(X.begin(),X.end(),V)
#define cnt(s,c) count(all(s),c)

//bitwise helpers
#define isOn(S, j) (S & (1 << j))
#define setBit(S, j) (S |= (1 << j))
#define clearBit(S, j) (S &= ~(1 << j))
#define toggleBit(S, j) (S ^= (1 << j))
#define lowBit(S) (S & (-S))
#define setAll(S, n) (S = (1 << n) - 1)

#define modulo(S, N) ((S) & (N - 1))
#define isPowerOfTwo(S) (!(S & (S - 1)))
#define nearestPowerOfTwo(S) ((int)pow(2.0, (int)((log((double)S) / log(2.0)) + 0.5)))
#define turnOffLastBit(S) ((S) & (S - 1))
#define turnOnLastZero(S) ((S) | (S + 1))
#define turnOffLastConsecutiveBits(S) ((S) & (S + 1))
#define turnOnLastConsecutiveZeroes(S) ((S) | (S - 1))

using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    ll n, m, q;

    cin >> n >> m >> q;

    vector<ll> a(n), b(m);

    for(int i = 0; i < n; i++)
        cin >> a[i];
    for(int i = 0; i < m; i++)
        cin >> b[i];


    ll mx = 999999999999;

    while(q--) {
        ll x;
        cin >> x;
        int ub1 = upper_bound(all(a), x) - a.begin();
        int ub2 = upper_bound(all(b), x) - b.begin();

        int lb1 = lower_bound(all(a), x) - a.begin();
        int lb2 = lower_bound(all(b), x) - b.begin();

        ll l1, r1, l2, r2;
        if(lb1 == n) {
            r1 = mx;
            l1 = a[lb1 - 1];
        }
        else if(lb1 == ub1) {
            if(lb1 == 0) {
                l1 = -mx;
                r1 = a[lb1];
            }
            else {
                l1 = a[lb1 - 1];
                r1 = a[lb1];
            }
        }
        else if(ub1 == n) {
            l1 = a[lb1];
            r1 = mx;
        }
        else {
            l1 = a[lb1];
            r1 = a[ub1];
        }

        if(lb2 == m) {
            r2 = mx;
            l2 = b[lb2 - 1];
        }
        else if(lb2 == ub2) {
            if(lb2 == 0) {
                l2 = -mx;
                r2 = b[lb2];
            }
            else {
                l2 = b[lb2 - 1];
                r2 = b[lb2];
            }
        }
        else if(ub2 == n) {
            l2 = b[lb2];
            r2 = mx;
        }
        else {
            l2 = b[lb2];
            r2 = b[ub2];
        }

        //cout << l1 << " " << r1 << " " << l2 << " " << r2 << endl;

        ll res = (max(r1, r2) - x);

        res = min(res, x - min(l1, l2));

        res = min(res, 2 * (r1 - x) + (x - l2));

        res = min(res, 2 * (r2 - x) + (x - l1));

        res = min(res, 2 * (x - l1) + (r2 - x));

        res = min(res, 2 * (x - l2) + (r1 - x));

        cout << res << endl;
    }

    return 0;
}


Measured memory_bytes: 2944