#include<bits/stdc++.h>
#include<iostream>
#include<cmath>
#include<vector>
#include<string>
#include<queue>
#include<set>
#include<map>
#include<algorithm>
#include<functional>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef pair<ull, ull> pullull;
typedef pair<ll, int> plli;
typedef pair<int, pii> pipii;
typedef vector<vector<int> > mati;
typedef vector<vector<double> > matd;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<vector<vector<ll>>> vvvll;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;
typedef vector<vector<vector<bool>>> vvvb;

#define FOR(i,x,y) for(ll i=(ll)x; i<(ll)y; ++i)
#define REP(i,y) FOR(i, 0, y)

template <typename T>
void vec_print(vector<T> VEC){
  REP(i, VEC.size()){
    cout << VEC[i] << " ";
  }
  cout << "\n";
};

template <typename T>
void mat_print(vector<vector<T> > MAT){
  REP(i, MAT.size()){
    REP(j, MAT[i].size()){
      cout << MAT[i][j] << " ";
    }
    cout << "\n";
  }
};

template <typename CLASS1, typename CLASS2>
class HOGE{
  public:
    CLASS1 key;
    CLASS2 value;
    HOGE(void){
      return;
    };
    HOGE(CLASS1 key, CLASS2 value){
      this->key = key;
      this->value = value;
    };
    ~HOGE(void){
      return;
    };

    void print(void){
      cout << "key : " << key << ", value : " << value << "\n";
      return;
    };
    
    bool operator==(const HOGE &obj){
      return (this->value == obj.value);
    };
    bool operator<(const HOGE &obj){
      return (this->value < obj.value);
    };
    bool operator>(const HOGE &obj){
      return (this->value > obj.value);
    };
};

constexpr int INF = (1<<30);
constexpr ll INFLL = 1LL<<62;
constexpr long double EPS = 1e-12;
constexpr ll MOD = (ll)((1E+9)+7);

ll st_search(ll xi, vll& st, ll start, ll end){
  if(end-start<=1){
    if(abs(st[start]-xi) < abs(st[end]-xi)) return start;
    else return end;
  }
  ll middle = (start+end)/2;
  if(st[middle]<xi) return st_search(xi, st, middle, end);
  else return st_search(xi, st, start, middle);
}

int main(){
  cin.tie(0); // cut the cin and cout (default, std::flush is performed after std::cin)
  ios::sync_with_stdio(false); // cut the iostream and stdio (DON'T endl; BUT "\n";)

  ll A, B, Q;
  cin >> A >> B >> Q;
  vll s(A);
  REP(i, A){
    cin >> s[i];
  }
  vll t(B);
  REP(i, B){
    cin >> t[i];
  }
  vll x(Q);
  REP(i, Q){
    cin >> x[i];
  }

  //1st search, the nearest temple 
  vll sl(A, INFLL);
  REP(i, A){
    ll t_near = st_search(s[i], t, 0, B-1);
    sl[i] = abs(s[i]-t[t_near]);
  }

  //2nd search,
  vll tl(B, INFLL);
  REP(i, B){
    ll s_near = st_search(t[i], s, 0, A-1);
    tl[i] = abs(t[i]-s[s_near]);
  }

  REP(i, Q){
    // nearest temple
    ll s_near = st_search(x[i], s, 0, A-1);
    ll ans = abs(s[s_near]-x[i]) + sl[s_near];
    if(s_near<A-1){
      ans = min(ans, abs(s[s_near+1]-x[i]) + sl[s_near+1]);
    }
    if(s_near>0){
      ans = min(ans, abs(s[s_near-1]-x[i]) + sl[s_near-1]);
    }
    ll t_near = st_search(x[i], t, 0, B-1);
    ans = min(ans, abs(t[t_near]-x[i]) + tl[t_near]);
    if(t_near<B-1){
      ans = min(ans, abs(t[t_near+1]-x[i]) + tl[t_near+1]);
    }
    if(t_near>0){
      ans = min(ans, abs(t[t_near-1]-x[i]) + tl[t_near-1]);
    }
    cout << ans << "\n";
  }

  return 0;
}


Measured memory_bytes: 5248