#include<iostream>
#include<algorithm>
#include<set>
#include<math.h>
#include<vector>
#include<sstream>
#include<queue>
#include<functional>
#include<bitset>
#include<cstdio>
#include<iomanip>
#include<map>
#include<unordered_map>
#include<unordered_set>
#include <string.h>

using ll = long long;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define reps(i, x) for(int i=1;i<=(int)(x);i++)
#define rrep(i, x) for(int i=((int)(x)-1);i>=0;i--)
#define rreps(i, x) for(int i=(int)(x);i>0;i--)
#define all(x) (x).begin(),(x).end()
#define m0(x) memset(x,0,sizeof(x))
#define vll vector<ll>
#define vi vector<int>
#define vpll vector<pair<ll,ll>>
#define vpi vector<pair<int,int>>
#define mod 1000000007
#define put2darr(arr, row, col) rep(i, row) { rep(j, col) { printf("%18d", arr[i][j]); } cout << endl; }

using namespace std;

template<class T>
inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}

template<class T>
inline bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return 1;
    }
    return 0;
}

/* 1..10
 * rep:   0 1 2 3 4 5 6 7 8 9
 * reps:  1 2 3 4 5 6 7 8 9 10
 * rrep:  9 8 7 6 5 4 3 2 1 0
 * rreps: 10 9 8 7 6 5 4 3 2 1
 */


int a, b, q;
ll x[100000];
vector<ll> s;
vector<ll> t;

ll binaryAs(ll pos, ll l, ll r) {
    if (l >= r) {
        if (s[l] <= pos) return l;
        else if (l > 0 && s[l - 1] <= pos) return l - 1;
        else return -1;
    }
    ll m = (l + r) / 2;
    if (s[m] < pos)return binaryAs(pos, m + 1, r);
    else return binaryAs(pos, l, m);
}


ll binaryDs(ll pos, ll l, ll r) {
    if (l >= r) {
        if (s[l] >= pos) return l;
        else if (l < s.size() - 2 && s[l + 1] >= pos) return l + 1;
        else return -1;
    }
    ll m = (l + r) / 2;
    if (s[m] < pos) return binaryDs(pos, m + 1, r);
    else return binaryDs(pos, l, m);
}
ll binaryAt(ll pos, ll l, ll r) {
    if (l >= r) {
        if (t[l] <= pos) return l;
        else if (l > 0 && t[l - 1] <= pos) return l - 1;
        else return -1;
    }
    ll m = (l + r) / 2;
    if (t[m] < pos)return binaryAt(pos, m + 1, r);
    else return binaryAt(pos, l, m);
}

ll binaryDt(ll pos, ll l, ll r) {
    if (l >= r) {
        if (t[l] >= pos) return l;
        else if (l < t.size() - 2 && t[l + 1] >= pos) return l + 1;
        else return -1;
    }
    ll m = (l + r) / 2;
    if (t[m] < pos) return binaryDt(pos, m + 1, r);
    else return binaryDt(pos, l, m);
}

int main() {
    cin >> a >> b >> q;
    ll tmp;
    rep(i, a) {
        scanf("%lld", &tmp);
        s.push_back(tmp);
    }
    rep(i, b) {
        scanf("%lld", &tmp);
        t.push_back(tmp);
    }
    rep(i, q) {
        scanf("%lld", &x[i]);
    }
    rep(i, q) {
        ll tx = x[i];
        ll as = binaryAs(tx, 0, a - 1);
        ll ds = binaryDs(tx, 0, a - 1);
        ll at = binaryAt(tx, 0, b - 1);
        ll dt = binaryDt(tx, 0, b - 1);
        ll ans = 1LL << 60;
        if (as >= 0 && at >= 0) {
            chmin(ans, tx - min(s[as], t[at]));
        }
        if (ds >= 0 && dt >= 0) {
            chmin(ans, max(s[ds], t[dt]) - tx);
        }
        if (as >= 0 && dt >= 0) {
            chmin(ans, min(t[dt] - tx, tx - s[as]) + (t[dt] - s[as]));
        }
        if (at >= 0 && ds >= 0) {
            chmin(ans, min(s[ds] - tx, tx - t[at]) + (s[ds] - t[at]));
        }
        printf("%lld\n",ans);
    }
}


Measured memory_bytes: 3828