#include <algorithm>
#include <bits/stdc++.h>
#include <cstdint>
#include <iostream>
#include <iterator>
#include <vector>

// lib/util.hpp
#ifndef UTIL_HPP
#define UTIL_HPP


typedef std::int_fast64_t i64;
typedef std::uint_fast64_t u64;
typedef std::int_fast32_t i32;
typedef std::uint_fast32_t u32;

namespace tools {
  template <typename T>
  void read(std::vector<T>& vector, const typename std::vector<T>::size_type size) {
    vector.reserve(size);
    std::copy_n(std::istream_iterator<T>(std::cin), size, std::back_inserter(vector));
  }

  template <typename T, std::size_t N>
  void read(std::array<T, N>& array) {
    std::copy_n(std::istream_iterator<T>(std::cin), N, array.begin());
  }
}

#endif

// main.cpp

int main() {
  i64 A, B, Q;
  std::cin >> A >> B >> Q;
  std::vector<i64> s, t;
  tools::read(s, A);
  tools::read(t, B);

  for (i64 i = 0; i < Q; ++i) {
    i64 x_i;
    std::cin >> x_i;

    i64 answer = std::numeric_limits<i64>::max();
    {
      const auto s1l = std::lower_bound(s.rbegin(), s.rend(), x_i, std::greater<i64>());
      if (s1l != s.rend()) {
        {
          const auto t2l = std::lower_bound(t.rbegin(), t.rend(), *s1l, std::greater<i64>());
          if (t2l != t.rend()) answer = std::min(answer, std::abs(x_i - *s1l) + std::abs(*s1l - *t2l));
        }
        {
          const auto t2r = std::lower_bound(t.begin(), t.end(), *s1l, std::less<i64>());
          if (t2r != t.end()) answer = std::min(answer, std::abs(x_i - *s1l) + std::abs(*s1l - *t2r));
        }
      }
    }
    {
      const auto s1r = std::lower_bound(s.begin(), s.end(), x_i, std::less<i64>());
      if (s1r != s.end()) {
        {
          const auto t2l = std::lower_bound(t.rbegin(), t.rend(), *s1r, std::greater<i64>());
          if (t2l != t.rend()) answer = std::min(answer, std::abs(x_i - *s1r) + std::abs(*s1r - *t2l));
        }
        {
          const auto t2r = std::lower_bound(t.begin(), t.end(), *s1r, std::less<i64>());
          if (t2r != t.end()) answer = std::min(answer, std::abs(x_i - *s1r) + std::abs(*s1r - *t2r));
        }
      }
    }
    {
      const auto t1l = std::lower_bound(t.rbegin(), t.rend(), x_i, std::greater<i64>());
      if (t1l != t.rend()) {
        {
          const auto s2l = std::lower_bound(s.rbegin(), s.rend(), *t1l, std::greater<i64>());
          if (s2l != s.rend()) answer = std::min(answer, std::abs(x_i - *t1l) + std::abs(*t1l - *s2l));
        }
        {
          const auto s2r = std::lower_bound(s.begin(), s.end(), *t1l, std::less<i64>());
          if (s2r != s.end()) answer = std::min(answer, std::abs(x_i - *t1l) + std::abs(*t1l - *s2r));
        }
      }
    }
    {
      const auto t1r = std::lower_bound(t.begin(), t.end(), x_i, std::less<i64>());
      if (t1r != t.end()) {
        {
          const auto s2l = std::lower_bound(s.rbegin(), s.rend(), *t1r, std::greater<i64>());
          if (s2l != s.rend()) answer = std::min(answer, std::abs(x_i - *t1r) + std::abs(*t1r - *s2l));
        }
        {
          const auto s2r = std::lower_bound(s.begin(), s.end(), *t1r, std::less<i64>());
          if (s2r != s.end()) answer = std::min(answer, std::abs(x_i - *t1r) + std::abs(*t1r - *s2r));
        }
      }
    }

    std::cout << answer << std::endl;
  }

  return 0;
}

Measured memory_bytes: 2944