#include <bits/stdc++.h>
using namespace std;
#define int long long
int inf = 1e18;

signed main() {

  int a, b, q;
  cin >> a >> b >> q;
  vector<int> s(a + 2), t(b + 2), x(q);

  for (int i = 1; i <= a; i++) {
    cin >> s[i];
  }

  for (int i = 1; i <= b; i++) {
    cin >> t[i];
  }
  s[0] = t[0] = -1 * inf;
  s[a + 1] = t[b + 1] = inf;
  for (auto &&w : x) {
    cin >> w;
  }

  for (auto &&w : x) {
    int res = inf;
    int sr = *lower_bound(s.begin(), s.end(), w);
    int sl = *(lower_bound(s.begin(), s.end(), w) - 1);
    int tr = *lower_bound(t.begin(), t.end(), w);
    int tl = *(lower_bound(t.begin(), t.end(), w) - 1);
    for (int s0 : {sl, sr})
      for (int t0 : {tl, tr}) {
        res = min(res, abs(w - s0) + abs(s0 - t0));
        res = min(res, abs(w - t0) + abs(s0 - t0));
      }
    cout << res << endl;
  }
}
