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

int main(){
  int A,B,Q; cin>>A>>B>>Q;
  vector<ll> S(A+2),T(B+2);
  S[0]=-1e11,S[A+1]=1e11;
  T[0]=-1e11,T[B+1]=1e11;
  rep(i,A) cin>>S[i+1];
  rep(i,B) cin>>T[i+1];

  while(Q--){
    ll X; cin>>X;
    int s=lower_bound(S.begin(),S.end(),X)-S.begin();
    int t=lower_bound(T.begin(),T.end(),X)-T.begin();

    ll ans=1e18;
    ans=min(ans,X-min(S[s-1],T[t-1]));
    ans=min(ans,max(S[s],T[t])-X);
    ans=min(ans,T[t]-S[s-1]+min(T[t]-X,X-S[s-1]));
    ans=min(ans,S[s]-T[t-1]+min(S[s]-X,X-T[t-1]));
    cout<<ans<<endl;
  }
  return 0;
}
