#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <deque>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
#include <cctype>
#include <cstring>
#include <ctime>
#include <iterator>
#include <bitset>
#include <numeric>
#include <list>
#include <iomanip>
#include <stack>
using namespace std;
#define ll int64_t
const ll mod = 1000000007;


const ll LINF = 1e13;
const ll LLINF = 1e18;
const ll ALPHABET = 26;

template <class T>
void Swap(T& r, T& l) {
  T tmp = r;
  r = l;
  l = tmp;
}

template<typename T>
istream& operator >> (istream& is, vector<T>& vec) {
  for (T& x : vec) is >> x; //for(int i=0; i<vec.size(); i++) is >> x[i]; とかでもいい
  return is;
}

struct UnionFind {
  vector<int> data;
  UnionFind(int size) : data(size, -1) { }//最初は全て-1 :-1なら根なので全て根:木のサイズが増えると-2-3-4となる
  bool unionSet(int x, int y) {
    x = root(x); y = root(y);//両方のルートを出して、それをつなげる
    if (x != y) {
      if (data[y] < data[x]) swap(x, y);
      data[x] += data[y]; data[y] = x;
    }
    return x != y;
  }

  bool findSet(int x, int y) {//要素xとyが同じ集合か　→　rootを調べれば解決
    return root(x) == root(y);
  }
  int root(int x) {
    return data[x] < 0 ? x : data[x] = root(data[x]);//-1なら根、そうでないなら配列が指す場所へ移動
  }
  int size(int x) {
    return -data[root(x)];
  }
};






int main() {
  ll a, b, q;
  cin >> a >> b >> q;

  vector<ll> s(a);
  vector<ll> t(b);
  vector<ll> x(q);

  cin >> s;
  cin >> t;
  cin >> x;
  s.push_back(-10000000000000);
  t.push_back(-10000000000000);

  s.push_back(10000000000000);
  t.push_back(10000000000000);

  sort(s.begin(),s.end());
  sort(t.begin(),t.end());


  ll ans = 0;

  for (int i = 0; i < q; ++i){
    auto s1 = lower_bound(s.begin(),s.end(),x[i]);
    auto t1 = lower_bound(t.begin(),t.end(),x[i]);

    ll s11 = *s1;     //大きい
    ll s12 = *(s1-1); //小さい
    ll t11 = *t1;
    ll t12 = *(t1-1);

    auto t11s = lower_bound(s.begin(),s.end(),t11);
    auto t12s = lower_bound(s.begin(),s.end(),t12);
    auto s11t = lower_bound(t.begin(),t.end(),s11);
    auto s12t = lower_bound(t.begin(),t.end(),s12);

    ll t11sp = abs(t11 - *t11s) < abs(t11  - *(t11s-1) )  ?  *t11s  :  *(t11s-1)  ;//t2と近いsの座標
    ll t12sp = abs(t12 - *t12s) < abs(t12  - *(t12s-1) )  ?  *t12s  :  *(t12s-1)  ;//t2と近いsの座標

    ll s11tp = abs(s11 - *s11t) < abs(s11  - *(s11t-1) )  ?  *s11t  :  *(s11t-1)  ;//t2と近いsの座標
    ll s12tp = abs(s12 - *s12t) < abs(s12  - *(s12t-1) )  ?  *s12t  :  *(s12t-1)  ;//t2と近いsの座標


    ll dist1 = abs(x[i] - s11) + abs(s11 - s11tp);
    ll dist2 = abs(x[i] - s12) + abs(s12 - s12tp);
    ll dist3 = abs(x[i] - t11) + abs(t11 - t11sp);
    ll dist4 = abs(x[i] - t12) + abs(t12 - t12sp);

    // cerr << x[i] <<endl;
    // cerr << "c1 : "  << s2 << " - " << t4 <<endl;
    // cerr << "c2 : " << t2 << " - " << s4 <<endl;
    // cerr << min(dist1,dist2) <<endl << endl;
    cerr <<dist1 << " " <<dist2 << " " << dist3 << " " <<dist4 <<endl;
    cerr << min(dist1,dist2) << " " << min(dist3,dist4) <<endl;
  

    ll p1 = min(dist3,dist4);
    ll p2 = min(dist1,dist2);
    cout << min(p1,p2) <<endl;

  }


  // cout << ans << endl;

}




















Measured memory_bytes: 3680