#include <bits/stdc++.h>
using namespace std;
using ull = unsigned long long;
using P = pair<int, int>;
static constexpr ull MOD = 1000000007;
static constexpr double pi = 3.14159265359;
int main() {
  ull A, B;
  ull Q;
  cin >> A >> B >> Q;
  vector<ull> s;
  for (ull i = 0; i < A; ++i) {
    ull tmp;
    cin >> tmp;
    s.push_back(tmp);
  }
  sort(s.begin(), s.end());
  vector<ull> t;
  for (ull i = 0; i < B; ++i) {
    ull tmp;
    cin >> tmp;
    t.push_back(tmp);
  }
  sort(t.begin(), t.end());
  for (ull i = 0; i < Q; ++i) {
    ull x;
    cin >> x;
    auto es = lower_bound(s.begin(), s.end(), x);
    auto et = lower_bound(t.begin(), t.end(), x);
    auto ws = es - 1;
    auto wt = et - 1;
    ull d1 = 999999999999;
    if (es != s.end() && et != t.end()) {
      d1 = max(*es, *et) - x;
    }
    ull d2 = 999999999999;
    if (es != s.begin() && et != t.begin()) {
      d2 = x - min(*ws, *wt);
    }
    ull d3 = 999999999999;
    if (es != s.begin() && et != t.end()) {
      d3 = 2 * min((x - *ws), (*et - x)) + max((x - *ws), (*et - x));
    }
    ull d4 = 999999999999;
    if (et != t.begin() && es != s.end()) {
      d4 = 2 * min((x - *wt), (*es - x)) + max((x - *wt), (*es - x));
    }
    ull ans = min(d1, min(d2, min(d3, d4)));
    cout << ans << endl;
  }
}
