#include <bits/stdc++.h>
int a, b, q;
long long s[100005], t[100005];
int main() {
  std::cin >> a >> b >> q;
  for (int i = 0; i < a; ++i) std::cin >> s[i];
  for (int i = 0; i < b; ++i) std::cin >> t[i];
  std::sort(s, s + a);
  std::sort(t, t + b);
  for (int i = 0; i < q; ++i) {
    int x;
    std::cin >> x;
    auto r1 = std::distance(s, std::lower_bound(s, s + a, x));
    decltype(r1) r2;
    if (r1 > a - 1) r1 = a - 1;
    if (r1 > 0)
      r2 = r1 - 1;
    else if (r1 < a - 1)
      r2 = r1 + 1;
    else
      r2 = r1;
    auto l1 = std::distance(t, std::lower_bound(t, t + a, x));
    decltype(l1) l2;
    if (l1 > b - 1) l1 = b - 1;
    if (l1 > 0)
      l2 = l1 - 1;
    else if (l1 < b - 1)
      l2 = l1 + 1;
    else
      l2 = l1;
    long long ans = 1000000000000;
    ans = std::min(ans, std::abs(s[r1] - x) + std::abs(s[r1] - t[l1]));
    ans = std::min(ans, std::abs(s[r1] - x) + std::abs(s[r1] - t[l2]));
    ans = std::min(ans, std::abs(s[r2] - x) + std::abs(s[r2] - t[l1]));
    ans = std::min(ans, std::abs(s[r2] - x) + std::abs(s[r2] - t[l2]));
    ans = std::min(ans, std::abs(t[l1] - x) + std::abs(s[r1] - t[l1]));
    ans = std::min(ans, std::abs(t[l2] - x) + std::abs(s[r1] - t[l2]));
    ans = std::min(ans, std::abs(t[l1] - x) + std::abs(s[r2] - t[l1]));
    ans = std::min(ans, std::abs(t[l2] - x) + std::abs(s[r2] - t[l2]));
    std::cout << ans << std::endl;
  }
  return 0;
}
