#include <iostream>
#include <vector>
using namespace std;

int main()
{
  const int64_t inf = 100000000000;
  int a, b, q;
  cin >> a >> b >> q;
  vector<int64_t> s(a + 2), t(b + 2), x(q);

  for (int i = 1; i <= a; i++) cin >> s[i];
  for (int i = 1; i <= b; i++) cin >> t[i];
  for (int i = 0; i < q; i++) cin >> x[i];

  s[0] = t[0] = -inf;
  s[a + 1] = t[b + 1] = inf;

  for (int i = 0; i < q; i++) {
    auto s_itr = lower_bound(begin(s), end(s), x[i]);
    auto t_itr = lower_bound(begin(t), end(t), x[i]);
    int64_t s1 = x[i] - *(s_itr - 1);
    int64_t s2 = *s_itr - x[i];
    int64_t t1 = x[i] - *(t_itr - 1);
    int64_t t2 = *t_itr - x[i];
    int64_t d = inf;
    d = min(d, s1 > t1 ? s1 : t1);
    d = min(d, s2 > t2 ? s2 : t2);
    d = min(d, s1 > t2 ? s1 + t2 * 2 : s1 * 2 + t2);
    d = min(d, t1 > s2 ? t1 + s2 * 2 : t1 * 2 + s2);
    cout << d << endl;
  }
}
