#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i = 0; i < n; i++)


int main(){
    int a,b,q; cin >> a >> b >> q;
    vector<ll> s(a+2),t(b+2),x(q);
    s[0] = -1e18,s[a+1] = 1e18,t[0] = -1e18,t[b+1] = 1e18;    
    rep(i,a) cin >> s[i+1];
    rep(i,b) cin >> t[i+1];
    rep(i,q) cin >> x[i];

    vector<ll> S(2),T(2);
    ll ans = 3*1e18;
    rep(i,q){
        ans = 3*1e18;
        S[1] = *upper_bound(s.begin(),s.end(),x[i]);
        S[0] = *(upper_bound(s.begin(),s.end(),x[i])-1);
        T[1] = *upper_bound(t.begin(),t.end(),x[i]);
        T[0] = *(upper_bound(t.begin(),t.end(),x[i])-1);
        rep(j,2){
            rep(k,2){
                ans = min(ans,min(abs(S[j]-x[i]) + abs(T[k]-S[j]),abs(T[k]-x[i]) + abs(T[k]-S[j])));
            }
        }
        cout << ans << endl;
    }
}