#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

const ll MINF=-pow(10,18);
const ll INF=pow(10,18);

int main(void){
    int A,B,Q; cin >> A >> B >> Q;
    vector<ll> s(A+2), t(B+2), X(Q);
    s[0]=MINF; for(int i=0; i<A; i++) cin >> s[i+1]; s[A+1]=INF;
    t[0]=MINF; for(int i=0; i<B; i++) cin >> t[i+1]; t[B+1]=INF;
    for(int i=0; i<Q; i++) cin >> X[i];

    for(int i=0; i<Q; i++){
        ll x=X[i];
        auto it1=upper_bound(s.begin(), s.end(), x);
        ll sR=*it1; it1--;
        ll sL=*it1;
        auto it2=upper_bound(t.begin(), t.end(), x);
        ll tR=*it2; it2--;
        ll tL=*it2;

        ll a=x-min(sL,tL);
        ll b=max(sR,tR)-x;
        ll c=min(2*sR-x-tL, sR+x-2*tL);
        ll d=min(2*tR-x-sL, tR+x-2*sL);

        cout << min(min(a,b), min(c,d)) << endl;
        //cout << sL << " " << sR << " " << tL << " " << tR << endl;
    }
}
