#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

template<typename T>
void _dump(const char* s, T&& head)
{
  cerr << s << "=" << head << endl;
}

template<typename T, typename... Args>
void _dump(const char* s, T&& head, Args&&... tail)
{
  while (*s != ',')
    cerr << *s++;
  cerr << "=" << head << ",";
  _dump(s + 1, tail...);
}

template<typename T>
void _dumpv(const char* s, T&& v)
{
  cerr << *s << "=";
  for (auto it = v.begin(); it != v.end(); it++) {
    cerr << *it << " ";
  }
  cerr << endl;
}

// #define dump(...) _dump(#__VA_ARGS__, __VA_ARGS__)
// #define dumpv(...) _dumpv(#__VA_ARGS__, __VA_ARGS__)
#define dump(...)
#define dumpv(...)

const ll MOD = 1000000007;

// void find_near(set<ll>& st, ll val, ll& left, ll& right)
void find_near(vector<ll>& st, ll val, ll& left, ll& right)
{
  auto it = lower_bound(st.begin(), st.end(), val);
  if (it != st.end()) {
    right = *it;
  }
  if (it != st.begin()) {
    left = *(--it);
  }
}

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  // freopen("template.1", "r", stdin);

  int A, B, Q;
  // set<ll> S;
  // set<ll> T;
  vector<ll> S;
  vector<ll> T;
  int i, j;
  ll s, t, x;
  cin >> A >> B >> Q;
  for (i = 0; i < A; i++) {
    cin >> s;
    S.push_back(s);
    // S.insert(s);
  }
  for (i = 0; i < B; i++) {
    cin >> t;
    T.push_back(t);
    // T.insert(t);
  }
  dumpv(S);
  dumpv(T);
  for (i = 0; i < Q; i++) {
    cin >> x;
    ll ansS = (1LL) << 60;
    ll ansT = (1LL) << 60;
    {
      ll ans1 = (1LL) << 60;
      ll ans2 = (1LL) << 60;
      ll ans3 = (1LL) << 60;
      ll ans4 = (1LL) << 60;
      ll sl = -1;
      ll sr = -1;
      find_near(S, x, sl, sr);
      dump(x, sl, sr);
      if (0 <= sl) {
        ll tl = -1;
        ll tr = -1;
        find_near(T, sl, tl, tr);
        dump(x, tl, tr);
        if (0 <= tl) {
          ans1 = (x - sl) + (sl - tl);
        }
        if (0 <= tr) {
          if (x < tr) {
            ans2 = (x - sl) + (tr - sl);
          } else {
            ans2 = (x - sl); // すでにTを通った
          }
        }
      }
      if (0 <= sr) {
        ll tl = -1;
        ll tr = -1;
        find_near(T, sr, tl, tr);
        dump(x, tl, tr);
        if (0 <= tl) {
          if (tl < x) {
            ans3 = (sr - x) + (sr - tl);
          } else {
            ans3 = (sr - x); // すでにTを通った
          }
        }
        if (0 <= tr) {
          ans4 = (sr - x) + (tr - sr);
        }
      }
      ansS = min(min(ans1, ans2), min(ans3, ans4));
      dump("S", ansS, ans1, ans2, ans3, ans4);
    }
    {
      ll ans1 = (1LL) << 60;
      ll ans2 = (1LL) << 60;
      ll ans3 = (1LL) << 60;
      ll ans4 = (1LL) << 60;
      ll tl = -1;
      ll tr = -1;
      find_near(T, x, tl, tr);
      dump(x, tl, tr);
      if (0 <= tl) {
        ll sl = -1;
        ll sr = -1;
        find_near(S, tl, sl, sr);
        dump(x, sl, sr);
        if (0 <= sl) {
          ans1 = (x - tl) + (tl - sl);
        }
        if (0 <= sr) {
          if (x < sr) {
            ans2 = (x - tl) + (sr - tl);
          } else {
            ans2 = (x - tl); // すでにSを通った
          }
        }
      }
      if (0 <= tr) {
        ll sl = -1;
        ll sr = -1;
        find_near(S, tr, sl, sr);
        dump(x, sl, sr);
        if (0 <= sl) {
          if (sl < x) {
            ans3 = (tr - x) + (tr - sl);
          } else {
            ans3 = (tr - x); // すでにSを通った
          }
        }
        if (0 <= sr) {
          ans4 = (tr - x) + (sr - tr);
        }
      }
      ansT = min(min(ans1, ans2), min(ans3, ans4));
      dump("T", ansT, ans1, ans2, ans3, ans4);
    }
    ll ans = min(ansS, ansT);
    dump(ans);
    cout << ans << endl;
  }
  return 0;
}


Measured memory_bytes: 3060