#include <iostream>
#include <vector>
#include <algorithm>

#define ll long long
using namespace std;

ll find(vector<ll> s, ll x, ll l, ll r){
  ll mid = (l + r)/2;

  while(1){
    mid = (l + r)/2;
    if (s[mid] <= x && x <= s[mid + 1]){
      return mid;
    }
    if (s[mid] < x){
      l = mid;
    }
    else {
      r = mid;
    }
  }
}


int main(void){
  ll a, b, q;

  cin >> a >> b >> q;

  vector<ll> s(a + 2, 0), t(b + 2, 0);

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

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

  ll x;

  for (int i = 0; i < q; i++){
    cin >> x;
    ll smid, tmid, m;

    smid = find(s, x, 0, a + 1);
    tmid = find(t, s[smid], 0, b + 1);
    m = x - s[smid] + s[smid] - t[tmid];
    m = min(x - s[smid] + t[tmid + 1] - s[smid], m);

    smid = find(s, x, 0, a + 1);
    tmid = find(t, s[smid + 1], 0, b + 1);
    m = min(m, s[smid + 1] - x + s[smid + 1] - t[tmid]);
    m = min(m, s[smid + 1] - x + t[tmid + 1] - s[smid + 1]);

    tmid = find(t, x, 0, b + 1);
    smid = find(s, t[tmid], 0, a + 1);
    m = min(m, x - t[tmid] + t[tmid] - s[smid]);
    m = min(x - t[tmid] + s[smid + 1] - t[tmid], m);

    tmid = find(t, x, 0, b + 1);
    smid = find(s, t[smid + 1], 0, a + 1);
    m = min(m, t[tmid + 1] - x + t[tmid + 1] - s[smid]);
    m = min(m, t[tmid + 1] - x + s[smid + 1] - t[tmid + 1]);


    cout << m << endl;
  }
  
}
	