//#include <boost/multiprecision/cpp_dec_float.hpp>
//#include <boost/multiprecision/cpp_int.hpp>
#include <stdio.h>
#include <iostream>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <math.h>
#include <algorithm>
#include <bitset>
using namespace std;
//namespace mp = boost::multiprecision;
//using llll = mp::cpp_int;
// 仮数部が1024ビットの浮動小数点数型(TLEしたら小さくする)
//using Real = mp::number<mp::cpp_dec_float<1024>>;
using ll = long long;
const double EPS = 1e-10;
const ll MOD = 7+(1e+9);

ll ans,x;

void zzz(ll p,ll q){
  ans=min(ans,abs(p-x)+abs(p-q));
}

void vvv(ll p,ll q){
  zzz(p,q);
  zzz(q,p);
}

int main(){
  ll n;
  ll a,b,q;
  cin>>a>>b>>q;
  vector<ll>v1(a,0);
  vector<ll>v2(b,0);
  for(ll i=0;i<a;i++){
    cin>>v1[i];
  }
  for(ll i=0;i<b;i++){
    cin>>v2[i];
  }
  v1.push_back(-1*(1e+11));
  v1.push_back((1e+11));
  v2.push_back(-1*(1e+11));
  v2.push_back((1e+11));
  sort(v1.begin(),v1.end());
  sort(v2.begin(),v2.end());
  for(ll i=0;i<q;i++){
    ans=(1e+12);
    cin>>x;
    auto u1=lower_bound(v1.begin(), v1.end(), x);
    auto u2=lower_bound(v2.begin(), v2.end(), x);
    ll a2=*u1;
    u1--;
    ll a1=*u1;
    ll b2=*u2;
    u2--;
    ll b1=*u2;
    vvv(a1,b1);
    vvv(a1,b2);
    vvv(a2,b1);
    vvv(a2,b2);
    cout<<ans<<endl;
  }
}
