#include <iostream>
#include <cmath>
#include <cassert>
#include <vector>
#include <map>
#include <string>
#include <algorithm>
#include <numeric>
#include <queue>
#include <type_traits>
#include <fstream>
//#include <bits/stdc++.h>

typedef long long ll;
const ll INF = (ll)1e18 + 1;
const ll MOD = 1e9 + 7;

// print(x, y, z);
// printVec(va.begin(), va.end());
void print(){ std::cout << std::endl; }
template <typename Head> void print(Head&& head) { std::cout << head << std::endl; }
template <typename Head, typename... Tail> void print(Head&& head, Tail&&... tail)
{
  std::cout << head << " ";
  print(std::forward<Tail>(tail)...); // or print(tail...);
}
template<typename Iterator> void printVec(Iterator begin, Iterator end)
{
  for (Iterator it = begin; it != end; it++) {
    std::cout << "[" << it - begin << "] " << *it << " ";
    if ((it - begin) % 20 == 19 || it == end - 1) { std::cout << std::endl; }
  }
}
template<typename Iterator> void printVecPair(Iterator begin, Iterator end)
{
  for (Iterator it = begin; it != end; it++) {
    std::cout << "[" << it - begin << "] " << it->first << " " << it->second << " ";
    if ((it - begin) % 10 == 9 || it == end - 1) std::cout << std::endl;
  }
}

template<typename T> T lminimum(const std::vector< T >& v) {return *std::min_element(v.begin(), v.end());}
template<typename T> T lmaximum(const std::vector< T >& v) {return *std::max_element(v.begin(), v.end());}
template<typename T> void lunique(std::vector< T >& v) {v.erase(std::unique(v.begin(), v.end()), v.end());}
template<typename T> void lsort(std::vector< T >& v) {std::sort(v.begin(), v.end());}
template<typename T> void lgreatersort(std::vector< T >& v) {std::sort(v.begin(), v.end(), std::greater<>());}
template<typename T> bool lnext_permutation(std::vector< T >& v) {return std::next_permutation(v.begin(), v.end());}

int main(int argc, char* argv[])
{
  ll A, B, Q;
  std::cin >> A >> B >> Q;

  std::vector< ll > vs(A, 0LL);
  std::vector< ll > vt(B, 0LL);
  std::vector< ll > vx(Q, 0LL);
  for (ll i = 0; i < A; i++) {
    std::cin >> vs[i];
  }
  for (ll i = 0; i < B; i++) {
    std::cin >> vt[i];
  }
  std::sort(vs.begin(), vs.end());
  std::sort(vt.begin(), vt.end());

  for (ll i = 0; i < Q; i++) {
    ll x;
    std::cin >> x;

    ll min_s, min_t, max_s, max_t;
    std::vector< ll >::iterator its = std::lower_bound(vs.begin(), vs.end(), x);
    std::vector< ll >::iterator itt = std::lower_bound(vt.begin(), vt.end(), x);
    if (its == vs.end()) {
      min_s = vs[vs.size()-1];
      max_s = INF;
    } else if (its == vs.begin()) {
      min_s = -INF;
      max_s = vs[0];
    } else {
      min_s = vs[its - vs.begin() - 1];
      max_s = vs[its - vs.begin()];
    }
    if (itt == vt.end()) {
      min_t = vt[vt.size()-1];
      max_t = INF;
    } else if (itt == vt.begin()) {
      min_t = -INF;
      max_t = vt[0];
    } else {
      min_t = vt[itt - vt.begin() - 1];
      max_t = vt[itt - vt.begin()];
    }

    //print(x, min_s, min_t, max_s, max_t);
    ll ans = INF;
    ans = std::min(ans, (ll)std::fabs(x - min_s) + (ll)std::fabs(max_t - min_s));
    ans = std::min(ans, (ll)std::fabs(x - max_s) + (ll)std::fabs(min_t - max_s));
    ans = std::min(ans, (ll)std::fabs(x - min_t) + (ll)std::fabs(max_s - min_t));
    ans = std::min(ans, (ll)std::fabs(x - max_t) + (ll)std::fabs(min_s - max_t));
    ans = std::min(ans, (ll)std::fabs(x - std::max(max_s, max_t)));
    ans = std::min(ans, (ll)std::fabs(x - std::min(min_s, min_t)));
    print(ans);
  }

  return 0;
}


Measured memory_bytes: 3712