#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
#include <array>
#include <cmath>
#include <stack>
#include <queue>

using namespace std;

typedef long long ll;


int a,b,q;
ll teras[100000];
ll zinzyas[100000];
int nibun(ll * arr ,int size, ll target){
  int start = 0, end = size-1;
  int middle;
  if(arr[0] > target){
    return 0;
  } else if(arr[size-1] < target){
    return size;
  }
  while(end - start > 1){
    middle = (start + end) /2 ;
    if(target < arr[start]){
      start = middle;
    } else {
      end = middle;
    }
  }
  if(target < arr[start]){
    return start;
  } else{
    return end;
  }
}
ll answer(ll query){
  int teraM = nibun(teras, a, query);
  int zinzyaM = nibun(zinzyas, b, query);
  ll answer = ~(1LL << 63);
  if(teraM > 0 && zinzyaM > 0){
    answer = min(answer , query - min(teras[teraM-1], zinzyas[zinzyaM-1]));
  }
  if(teraM < a && zinzyaM < b){
    answer = min(answer , max(teras[teraM], zinzyas[zinzyaM]) - query);
  }
  if(teraM > 0 && zinzyaM < b){
    answer = min(answer ,abs(zinzyas[zinzyaM] - teras[teraM-1]) + min(abs(query - teras[teraM - 1]), abs(zinzyas[zinzyaM] - query)));
  }
  if(zinzyaM > 0 && teraM < a){
    answer = min(answer , abs(teras[teraM] - zinzyas[zinzyaM-1]) + min(abs(query - zinzyas[zinzyaM - 1]), abs(teras[teraM] - query)));
  }
  return answer;
}
int main(){
  cin >> a >> b >> q;
  for(int i=0;i<a;i++){
    cin >> teras[i];
  }
  for(int i=0;i<b;i++){
    cin >> zinzyas[i];
  }
  for(int i=0;i<q;i++){
    ll query;
    cin >> query;
    cout << answer(query) << endl;
  }
}

