#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
long long s[N], t[N], near2s[N], neartot[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int a, b, q;
  cin >> a >> b >> q;
  for (int i = 0; i < a; i++) cin >> s[i];
  for (int i = 0; i < b; i++) cin >> t[i];
  for (int i = 0; i < q; i++) {
    long long x;
    cin >> x;
    int n = lower_bound(s, s + a, x) - s;
    int m = lower_bound(t, t + b, x) - t;
    long long ans = 1e10 + 5;
    if (n < a || m < b) {
      long long rn, rm;
      if (n < a)
        rn = s[n];
      else
        rn = 1e10 + 5;
      if (m < b)
        rm = t[m];
      else
        rm = 1e10 + 5;
      if (rn >= rm) {
        long long temp = rm - x;
        long long nextstep = min(n > 0 ? t[m] - s[n - 1] : (long long)1e10,
                                 n < a ? s[n] - t[m] : (long long)1e10);
        ans = min(ans, temp + nextstep);
      } else {
        long long temp = rn - x;
        long long nextstep = min(m > 0 ? s[n] - t[m - 1] : (long long)1e10,
                                 m < b ? t[m] - s[n] : (long long)1e10);
        ans = min(ans, temp + nextstep);
      }
    }
    if (n > 0 || m > 0) {
      long long lefn, lefm;
      if (n > 0)
        lefn = s[n - 1];
      else
        lefn = -1;
      if (m > 0)
        lefm = t[m - 1];
      else
        lefm = -1;
      if (lefn < lefm) {
        long long temp = x - lefm;
        long long nextstep = min(n < a ? s[n] - t[m - 1] : (long long)1e10,
                                 n > 0 ? t[m - 1] - s[n - 1] : (long long)1e10);
        ans = min(ans, temp + nextstep);
      } else {
        long long temp = x - lefn;
        long long nextstep = min(m < b ? t[m] - s[n - 1] : (long long)1e10,
                                 m > 0 ? s[n - 1] - t[m - 1] : (long long)1e10);
        ans = min(ans, temp + nextstep);
      }
    }
    cout << ans << endl;
  }
  return 0;
}
