#include <bits/stdc++.h>
static void ABC120D_DecayedBridges();
static void ABC119D_LazyFaith();
int main() {
  ABC119D_LazyFaith();
  fflush(stdout);
  return 0;
}
static int binSearch(const long long& xpoint, const long long* container,
                     int contCount, int& secondIdx) {
  int startPoint = 0, endPoint = contCount;
  int bsTarget = 0, tmpTarget = 0;
  long long dist = 0, tmpDist = 0;
  while (1) {
    bsTarget = (startPoint + endPoint) / 2;
    if ((endPoint - startPoint) < 2) {
      secondIdx = -1;
      if ((container[bsTarget] < xpoint) && ((bsTarget + 1) < contCount)) {
        secondIdx = bsTarget + 1;
      } else if ((container[bsTarget] >= xpoint) && ((bsTarget - 1) >= 0)) {
        secondIdx = bsTarget - 1;
      }
      break;
    } else if (container[bsTarget] < xpoint) {
      startPoint = bsTarget;
    } else if (container[bsTarget] > xpoint) {
      endPoint = bsTarget;
    }
  }
  return bsTarget;
}
static void search(const long long& xpoint, const long long* shrine, int sCount,
                   const long long* temple, int tCount, long long& answer) {
  int sh1stIdx = 0, sh2ndIdx = 0;
  int tm1stIdx = 0, tm2ndIdx = 0;
  sh1stIdx = binSearch(xpoint, shrine, sCount, sh2ndIdx);
  tm1stIdx = binSearch(xpoint, temple, tCount, tm2ndIdx);
  long long shDist[2] = {0};
  long long tmDist[2] = {0};
  int shCount = 1;
  shDist[0] = xpoint - shrine[sh1stIdx];
  if (sh2ndIdx >= 0) {
    shCount = 2;
    shDist[1] = xpoint - shrine[sh2ndIdx];
  }
  int tmCount = 1;
  tmDist[0] = xpoint - temple[tm1stIdx];
  if (tm2ndIdx >= 0) {
    tmCount = 2;
    tmDist[1] = xpoint - temple[tm2ndIdx];
  }
  long long total = 0;
  long long totalMin = LLONG_MAX;
  for (int s = 0; s < shCount; s++) {
    for (int t = 0; t < tmCount; t++) {
      if (((shDist[s] < 0) && (tmDist[t] < 0)) ||
          ((shDist[s] >= 0) && (tmDist[t] >= 0))) {
        if (abs(shDist[s]) > abs(tmDist[t])) {
          total = abs(shDist[s]);
        } else {
          total = abs(tmDist[t]);
        }
      } else if (abs(shDist[s]) > abs(tmDist[t])) {
        total = abs(tmDist[t] * 2) + abs(shDist[s]);
      } else {
        total = abs(tmDist[t]) + abs(shDist[s] * 2);
      }
      if (totalMin > total) {
        totalMin = total;
      }
    }
  }
  answer = totalMin;
}
static void ABC119D_LazyFaith() {
  static long long shrine[100000] = {0};
  static long long temple[100000] = {0};
  static long long xpoint[100000] = {0};
  static long long answer[100000] = {0};
  int A = 0, B = 0, Q = 0;
  scanf(" %d %d %d", &A, &B, &Q);
  for (int i = 0; i < A; i++) {
    scanf(" %lld", &shrine[i]);
  }
  for (int i = 0; i < B; i++) {
    scanf(" %lld", &temple[i]);
  }
  for (int i = 0; i < Q; i++) {
    scanf(" %lld", &xpoint[i]);
  }
  for (int i = 0; i < Q; i++) {
    search(xpoint[i], shrine, A, temple, B, answer[i]);
    printf("%lld\n", answer[i]);
  }
}
