#include <bits/stdc++.h>

using namespace std;

std::vector<int64_t> solve(const std::vector<int64_t>& ss,
                           const std::vector<int64_t>& ts,
                           const std::vector<int64_t>& xs) {
  int const a = ss.size();
  int const b = ts.size();
  int const q = xs.size();
  std::vector<int64_t> rets;
  rets.reserve(q);

  for (auto const x : xs) {
    int64_t ret = INT64_MAX;

    {
      int64_t candidate = 0;
      auto p1 = lower_bound(ss.begin(), ss.end(), x);
      if (p1 == ss.end()) {
        goto E2;
      }
      candidate = abs(*p1 - x);
      auto p2 = lower_bound(ts.begin(), ts.end(), *p1);
      if (p2 == ts.end()) {
        goto E1;
      }
      candidate += abs(*p2 - *p1);
      ret = std::min(candidate, ret);
    }
  E1 :

  {
    int64_t candidate = 0;
    auto p1 = lower_bound(ss.begin(), ss.end(), x);
    candidate = abs(*p1 - x);
    auto p2 = lower_bound(ts.begin(), ts.end(), *p1);
    if (p2 == ts.begin()) {
      goto E2;
    }
    p2--;
    candidate += abs(*p2 - *p1);
    ret = std::min(candidate, ret);
  }
  E2 :

  {
    int64_t candidate = 0;
    auto p1 = lower_bound(ss.begin(), ss.end(), x);
    if (p1 == ss.begin()) {
      goto E4;
    }
    p1--;
    candidate = abs(*p1 - x);
    auto p2 = lower_bound(ts.begin(), ts.end(), *p1);
    if (p2 == ts.end()) {
      goto E3;
    }
    candidate += abs(*p2 - *p1);
    ret = std::min(candidate, ret);
  }
  E3 :

  {
    int64_t candidate = 0;
    auto p1 = lower_bound(ss.begin(), ss.end(), x);
    p1--;
    candidate = abs(*p1 - x);
    auto p2 = lower_bound(ts.begin(), ts.end(), *p1);
    if (p2 == ts.begin()) {
      goto E4;
    }
    p2--;
    candidate += abs(*p2 - *p1);
    ret = std::min(candidate, ret);
  }
  E4 :

  {
    int64_t candidate = 0;
    auto p1 = lower_bound(ts.begin(), ts.end(), x);
    if (p1 == ts.end()) {
      goto E6;
    }
    candidate = abs(*p1 - x);
    auto p2 = lower_bound(ss.begin(), ss.end(), *p1);
    if (p2 == ss.end()) {
      goto E5;
    }
    candidate += abs(*p2 - *p1);
    ret = std::min(candidate, ret);
  }
  E5 :

  {
    int64_t candidate = 0;
    auto p1 = lower_bound(ts.begin(), ts.end(), x);
    candidate = abs(*p1 - x);
    auto p2 = lower_bound(ss.begin(), ss.end(), *p1);
    if (p2 == ss.begin()) {
      goto E6;
    }
    p2--;
    candidate += abs(*p2 - *p1);
    ret = std::min(candidate, ret);
  }
  E6 :

  {
    int64_t candidate = 0;
    auto p1 = lower_bound(ts.begin(), ts.end(), x);
    if (p1 == ts.begin()) {
      goto E8;
    }
    p1--;
    candidate = abs(*p1 - x);
    auto p2 = lower_bound(ss.begin(), ss.end(), *p1);
    if (p2 == ss.end()) {
      goto E7;
    }
    candidate += abs(*p2 - *p1);
    ret = std::min(candidate, ret);
  }
  E7 :

  {
    int64_t candidate = 0;
    auto p1 = lower_bound(ts.begin(), ts.end(), x);
    p1--;
    candidate = abs(*p1 - x);
    auto p2 = lower_bound(ss.begin(), ss.end(), *p1);
    if (p2 == ss.begin()) {
      goto E8;
    }
    p2--;
    candidate += abs(*p2 - *p1);
    ret = std::min(candidate, ret);
  }
  E8:

    rets.push_back(ret);
  }
  return rets;
}

int main() {
  std::cin.tie(nullptr);
  std::ios::sync_with_stdio(false);
  int a, b, q;
  std::cin >> a >> b >> q;
  std::vector<int64_t> ss(a);
  std::vector<int64_t> ts(b);
  std::vector<int64_t> xs(q);
  for (auto& s : ss) {
    std::cin >> s;
  }
  for (auto& t : ts) {
    std::cin >> t;
  }
  for (auto& x : xs) {
    std::cin >> x;
  }
  auto ret = solve(ss, ts, xs);
  for (auto const r : ret) {
    std::cout << r << std::endl;
  }
  return 0;
}


Measured memory_bytes: 4480