#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
const long long INF = 1e18;

int main(){
  int A, B, Q;
  cin >> A >> B >> Q;
  vector<long long> S(A+2), T(B+2);
  S[0] = -INF;
  T[0] = -INF;
  S[A+1] = INF;
  T[B+1] = INF;
  for(int i = 0; i < A; ++i) cin >> S[i+1];
  for(int i = 0; i < B; ++i) cin >> T[i+1];
  while(Q--){
    long long x;
    cin >> x;
    long long si = lower_bound(S.begin(), S.end(), x) - S.begin(),
      ti = lower_bound(T.begin(), T.end(), x) - T.begin();
    //cerr << x << " " << S[si] << " " << T[ti] << endl;
    long long ans =  min({max(S[si],T[ti])-x,
                          x-min(S[si-1],T[ti-1]),
                          2*(S[si]-T[ti-1])-max(abs(S[si]-x),abs(T[ti-1]-x)),
                          2*(T[ti]-S[si-1])-max(abs(T[ti]-x),abs(S[si-1]-x))});
    cout << ans << endl;
  }
}
