#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long a, b, q;
  cin >> a >> b >> q;
  long long A[a], B[b];
  for (long long i = 0; i < a; i++) cin >> A[i];
  for (long long i = 0; i < b; i++) cin >> B[i];
  sort(A, A + a);
  sort(B, B + b);
  for (long long Q = 0; Q < q; Q++) {
    long long x;
    cin >> x;
    long long aloc = lower_bound(A, A + a, x) - A;
    long long bloc = lower_bound(B, B + b, x) - B;
    long long ares = ULLONG_MAX;
    long long bres = ULLONG_MAX;
    {
      if (aloc != 0) {
        long long ALeft = A[aloc - 1];
        long long abloc = lower_bound(B, B + b, ALeft) - B;
        if (abloc != 0) {
          long long BLeft = B[abloc - 1];
          ares = min(ares, (x - ALeft) + (ALeft - BLeft));
        }
        long long BRight = B[abloc];
        ares = min(ares, (x - ALeft) + (BRight - ALeft));
      }
      long long ARight = A[aloc];
      long long abloc = lower_bound(B, B + b, ARight) - B;
      if (abloc != 0) {
        long long BLeft = B[abloc - 1];
        ares = min(ares, (ARight - x) + (ARight - BLeft));
      }
      long long BRight = B[abloc];
      ares = min(ares, (ARight - x) + (BRight - ARight));
    }
    {
      if (bloc != 0) {
        long long BLeft = B[bloc - 1];
        long long baloc = lower_bound(A, A + a, BLeft) - A;
        if (baloc != 0) {
          long long ALeft = A[baloc - 1];
          bres = min(bres, (x - BLeft) + (BLeft - ALeft));
        }
        long long ARight = A[baloc];
        bres = min(bres, (x - BLeft) + (ARight - BLeft));
      }
      long long BRight = B[bloc];
      long long baloc = lower_bound(A, A + a, BRight) - A;
      if (baloc != 0) {
        long long ALeft = A[baloc - 1];
        bres = min(bres, (BRight - x) + (BRight - ALeft));
      }
      long long ARight = A[baloc];
      bres = min(bres, (BRight - x) + (ARight - BRight));
    }
    cout << min(ares, bres) << endl;
  }
  return 0;
}
