#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

const int MOD = 1e9 + 7;
const int iINF = 1000000000;
const long long int llINF = 1000000000000000000;

using namespace std;
using ll = long long int;
using vv = vector<vector<ll>>;
using edge = struct {
  int to;
  int cost;
};
#define REP(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define AUTO(i, m) for (auto &i : m)
#define ALL(a) (a).begin(), (a).end()
#define MAX(vec) *std::max_element(vec.begin(), vec.end());
#define MIN(vec) *std::min_element(vec.begin(), vec.end());
#define BIT(n, num) std::bitset<(n)>((num)).to_string()
#define REV(T) greater<T>()

typedef pair<ll, ll> Pair;
bool pairCompare(const Pair &firstElof, const Pair &secondElof) {
  return firstElof.second > secondElof.second;
}

vector<ll> divisor(ll n) {
  vector<ll> ret;
  for (ll i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ret.push_back(i);
      if (i * i != n)
        ret.push_back(n / i);
    }
  }
  sort(begin(ret), end(ret));
  return (ret);
}

map<ll, int> prime_factor(ll n) {
  map<ll, int> ret;
  for (ll i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if (n != 1)
    ret[n] = 1;
  return ret;
}

ll factorial(int n) {
  ll ans = 1;
  for (int i = 2; i <= n; i++) {
    ans *= i;
    ans %= MOD;
  }
  return ans;
}
ll P(int n, int m) {
  ll ans = 1;
  for (int i = m + 1; i <= n; i++) {
    ans *= i;
    ans %= MOD;
  }
  return ans;
}
ll power(int n, int m) {
  if (m == 0) {
    return 1;
  } else if (m % 2 == 0) {
    ll tmp = power(n, m / 2);
    return (tmp * tmp) % MOD;
  } else {
    return (n * power(n, m - 1)) % MOD;
  }
}
ll C(int n, int m) {
  return (P(n, n - m) * power(factorial(m), MOD - 2)) % MOD;
}
ll GCD(ll a, ll b) {
  if (b == 0)
    return a;
  return GCD(b, a % b);
}
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

int main() {
  ll A, B, Q;
  vector<ll> s, t, X;
  cin >> A >> B >> Q;
  REP(i, A) {
    ll a = 0;
    cin >> a;
    s.push_back(a);
  }
  s.push_back(llINF);
  s.push_back(-llINF);
  sort(ALL(s));
  vector<ll> rs = s;
  sort(ALL(rs), REV(ll));
  REP(i, B) {
    ll a = 0;
    cin >> a;
    t.push_back(a);
  }
  t.push_back(llINF);
  t.push_back(-llINF);
  sort(ALL(t));
  vector<ll> rt = t;
  sort(ALL(rt), REV(ll));
  REP(i, Q) {
    ll x = 0;
    cin >> x;
    X.push_back(x);
  }
  AUTO(x, X) {
    auto it1 = lower_bound(ALL(rs), x, greater<ll>());
    auto it2 = lower_bound(ALL(rt), x, greater<ll>());
    auto it3 = lower_bound(ALL(s), x);
    auto it4 = lower_bound(ALL(t), x);
    vector<ll> AA;

    AA.push_back(abs(*it3 - x) + abs(*lower_bound(ALL(t), (ll)*it3) - *it3));
    AA.push_back(abs(*it3 - x) +
                 abs(*lower_bound(ALL(rt), *it3, greater<ll>()) - *it3));
    AA.push_back(abs(*it1 - x) + abs(*lower_bound(ALL(t), *it1) - *it1));
    AA.push_back(abs(*it1 - x) +
                 abs(*lower_bound(ALL(rt), *it1, greater<ll>()) - *it1));

    AA.push_back(abs(*it4 - x) + abs(*lower_bound(ALL(s), *it4) - *it4));
    AA.push_back(abs(*it4 - x) +
                 abs(*lower_bound(ALL(rs), *it4, greater<ll>()) - *it4));
    AA.push_back(abs(*it2 - x) + abs(*lower_bound(ALL(s), *it2) - *it2));
    AA.push_back(abs(*it2 - x) +
                 abs(*lower_bound(ALL(rs), *it2, greater<ll>()) - *it2));
    cout << *std::min_element(AA.begin(), AA.end()) << endl;
  }
  return 0;
}


Measured memory_bytes: 5364