#include <iostream>
#include <algorithm>
#include <vector>
#include <tuple>
using namespace std;

int main(){
    int A,B,Q;
    cin>>A>>B>>Q;
    vector<int64_t> S(A),T(B);
    for(auto &s:S) cin>>s;
    for(auto &t:T) cin>>t;
    for(int i=0;i<Q;i++){
        int64_t x;
        cin>>x;
        int64_t ls,lt,rs,rt;
        if(x<S[0]) ls=-1e12;
        else ls=*--upper_bound(S.begin(), S.end(),x);
        if(x<T[0]) lt=-1e12;
        else lt=*--upper_bound(T.begin(), T.end(),x);
        if(x>S.back()) rs=1e12;
        else rs=*upper_bound(S.begin(), S.end(),x);
        if(x>T.back()) rt=1e12;
        else rt=*upper_bound(T.begin(), T.end(),x);
        int64_t ans = 1e12;
        ans=min(ans,max(rs,rt)-x);
        ans=min(ans,x-min(ls,lt));
        ans=min(ans,rs-lt+min(rs-x,x-lt));
        ans=min(ans,rt-ls+min(rt-x,x-ls));
        cout<<ans<<endl;
    }
    return 0;
}