#include <bits/stdc++.h>
using namespace std;
long long fun(long long x, set<long long> &sa, set<long long> &sb) {
  auto it1 = sa.lower_bound(x);
  long long z1 = 10000000000000007;
  if (it1 != sa.end()) {
    z1 = *it1;
  }
  auto it2 = sa.lower_bound(x);
  long long z2 = -10000000000000007;
  if (it2 != sa.begin()) {
    it2--;
    z2 = *it2;
  }
  auto it3 = sb.lower_bound(x);
  long long z3 = 10000000000000007;
  if (it3 != sb.end()) {
    z3 = *it3;
  }
  auto it4 = sb.lower_bound(x);
  long long z4 = -10000000000000007;
  if (it4 != sb.begin()) {
    it4--;
    z4 = *it4;
  }
  long long y1, y2, y3, y4;
  y1 = (z1 - x);
  y2 = (x - z2);
  y3 = (z3 - x);
  y4 = (x - z4);
  return min(
      y1 + y3,
      min(y2 + y4,
          min(2 * y1 + y4, min(2 * y4 + y1, min(2 * y2 + y3, 2 * y3 + y2)))));
}
int main() {
  long long a, b, q;
  cin >> a >> b >> q;
  set<long long> sa, sb;
  for (long long i = 0; i < a; i++) {
    long long x;
    cin >> x;
    sa.insert(x);
  }
  for (long long i = 0; i < b; i++) {
    long long x;
    cin >> x;
    sb.insert(x);
  }
  for (long long i = 0; i < q; i++) {
    long long x;
    cin >> x;
    cout << fun(x, sa, sb) << '\n';
  }
}
