#include <bits/stdc++.h>
using namespace std;
int dx[] = {-1, 0, 1};
int dy[] = {-1, 0, 1};
signed main(void) {
  cin.sync_with_stdio(false);
  cin.tie(0);
  long long A, B;
  cin >> A >> B;
  ;
  long long Q;
  cin >> Q;
  ;
  vector<long long> s(A), t(B), x(Q);
  for (long long i = 0; i < A; i++) cin >> s[i];
  for (long long i = 0; i < B; i++) cin >> t[i];
  for (long long i = 0; i < Q; i++) cin >> x[i];
  sort((s).begin(), (s).end());
  sort((t).begin(), (t).end());
  long long s_min = *min_element((s).begin(), (s).end());
  long long s_max = *max_element((s).begin(), (s).end());
  long long t_min = *min_element((t).begin(), (t).end());
  long long t_max = *max_element((t).begin(), (t).end());
  for (long long i = 0; i < Q; i++) {
    long long t_near1, t_near2, s_near1, s_near2;
    auto t_near_ptr = lower_bound((t).begin(), (t).end(), x[i]);
    auto s_near_ptr = lower_bound((s).begin(), (s).end(), x[i]);
    if (t_near_ptr == t.end()) {
      t_near1 = *(--t_near_ptr);
      t_near2 = t_near1;
    } else if (t_near_ptr == t.begin()) {
      t_near1 = *(t_near_ptr);
      t_near2 = t_near1;
    } else {
      t_near1 = *t_near_ptr;
      t_near2 = *(--t_near_ptr);
    }
    if (s_near_ptr == t.end()) {
      s_near1 = *(--s_near_ptr);
      s_near2 = s_near1;
    } else if (s_near_ptr == t.begin()) {
      s_near1 = *(s_near_ptr);
      s_near2 = s_near1;
    } else {
      s_near1 = *s_near_ptr;
      s_near2 = *(--s_near_ptr);
    }
    long long ans1 = abs(t_near1 - x[i]) + abs(s_near1 - t_near1);
    long long ans2 = abs(t_near1 - x[i]) + abs(s_near2 - t_near1);
    long long ans3 = abs(t_near2 - x[i]) + abs(s_near1 - t_near2);
    long long ans4 = abs(t_near2 - x[i]) + abs(s_near2 - t_near2);
    long long ans5 = abs(s_near1 - x[i]) + abs(t_near1 - s_near1);
    long long ans6 = abs(s_near1 - x[i]) + abs(t_near2 - s_near1);
    long long ans7 = abs(s_near2 - x[i]) + abs(t_near1 - s_near2);
    long long ans8 = abs(s_near2 - x[i]) + abs(t_near2 - s_near2);
    cout << min(ans1,
                min(ans2,
                    min(ans3,
                        min(ans4, min(ans5, min(ans6, min(ans7, ans8)))))))
         << '\n';
  }
  return 0;
}
