#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;

int main(){
   int A, B, Q;
   std::cin >> A >> B >> Q;
   ll s[A], t[B];
   for(int i=0; i<A; ++i)
      std::cin >> s[i];
   for(int i=0; i<B; ++i)
      std::cin >> t[i];

   for(int i=0; i<Q; ++i){
      ll x;
      std::cin >> x;
      ll *ps = std::lower_bound(s,s+A,x);
      ll *pt = std::lower_bound(t,t+B,x);
      ll ps0 = (ps==s+A) ? s[A-1] : *ps;
      ll pt0 = (pt==t+B) ? t[B-1] : *pt;
      ll ps1 = (ps==s) ? s[0] : ps[-1];
      ll pt1 = (pt==t) ? t[0] : pt[-1];

      ll ans = std::min({abs(x-ps0) + abs(ps0-pt0),
			 abs(x-ps0) + abs(ps0-pt1),
			 abs(x-ps1) + abs(ps1-pt0),
			 abs(x-ps1) + abs(ps1-pt1),
			 abs(x-pt0) + abs(pt0-ps0),
			 abs(x-pt0) + abs(pt0-ps1),
			 abs(x-pt1) + abs(pt1-ps0),
			 abs(x-pt1) + abs(pt1-ps1)});
      std::cout << ans << std::endl;
   }

   return 0;
}
