#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int a, b, q;
  cin >> a >> b >> q;
  vector<vector<long long int>> s = {vector<long long int>(a),
                                     vector<long long int>(b)};
  for (auto& e : s[0]) cin >> e;
  for (auto& e : s[1]) cin >> e;
  for (; q > 0; q--) {
    long long int x;
    cin >> x;
    vector<vector<long long int>::iterator> it = {
        lower_bound(begin(s[0]), end(s[0]), x),
        lower_bound(begin(s[1]), end(s[1]), x)};
    vector<vector<long long int>> v(2);
    for (int i = 0; i < 2; i++) {
      if (it[i] != begin(s[i])) {
        v[i].push_back(*(it[i] - 1));
      }
      if (it[i] != end(s[i])) {
        v[i].push_back(*it[i]);
      }
    }
    long long int r = 1e18;
    for (auto e0 : v[0]) {
      for (auto e1 : v[1]) {
        r = min(r, min(abs(e0 - x), abs(e1 - x)) + abs(e0 - e1));
      }
    }
    cout << r << endl;
  }
  return 0;
}
