#include <bits/stdc++.h>
using namespace std;
using lint = int64_t;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define all(v)    begin(v), end(v)
#define in        []{lint n; cin>>n; return n;}()

int main() { cin.tie(0); ios::sync_with_stdio(false);
    const lint INF = 1e15;

    int A = in, B = in, Q = in;

    vector<lint> S(A+2);
    S[0] = -INF; S[A+1] = INF;
    rep( i, A ) S[i+1] = in;

    vector<lint> T(B+2);
    T[0] = -INF; T[B+1] = INF;
    rep( i, B ) T[i+1] = in;

    rep( _, Q ) {
        lint x = in;
        auto s = lower_bound( all(S), x );
        auto t = lower_bound( all(T), x );

        lint rs = *s-x, rt = *t-x, ls = x-*(s-1), lt = x-*(t-1);
        lint ans = min({
            max( rs, rt ),
            max( ls, lt ),
            ls*2+rt,
            lt*2+rs,
            rs*2+lt,
            rt*2+ls
        });
        cout << ans << "\n";
    }
}
