#include <bits/stdc++.h>
using namespace std;
using lint = long long;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;


int main() {
  cin.tie(nullptr); ios::sync_with_stdio(false);
  int a, b, q; cin >> a >> b >> q;
  V<lint> s(1, -1e18);
  while (a--) {
    lint x; cin >> x;
    s.push_back(x);
  }
  s.push_back(1e18);
  V<lint> t(1, -1e18);
  while (b--) {
    lint x; cin >> x;
    t.push_back(x);
  }
  t.push_back(1e18);
  while (q--) {
    lint x; cin >> x;
    int i = lower_bound(begin(s), end(s), x) - begin(s);
    int j = lower_bound(begin(t), end(t), x) - begin(t);
    lint res = 1e18;
    for (int ii : {i - 1, i}) for (int jj : {j - 1, j}) {
      res = min(res, abs(s[ii] - x) + abs(t[jj] - s[ii]));
      res = min(res, abs(t[jj] - x) + abs(s[ii] - t[jj]));
    }
    cout << res << '\n';
  }
}