def near(x, X):
    i = bisect_left(X, x)
    if i == 0: return [X[i]-x]
    elif i == len(X): return [X[i-1]-x]
    else: return [X[i]-x, X[i-1]-x]
from bisect import *
A, B, Q = map(int, input().split())
S, T = [], []
for _ in range(A):
    S.append(int(input()))
for _ in range(B):
    T.append(int(input()))
for _ in range(Q):
    res = 1<<40
    x = int(input())
    for a in near(x,S):
        for b in near(x,T):
            res = min(abs(a)+abs(a-b), abs(b)+abs(b-a), res)
    print(res) def near(x, X):
    i = bisect_left(X, x)
    if i == 0: return [X[i]-x]
    elif i == len(X): return [X[i-1]-x]
    else: return [X[i]-x, X[i-1]-x] near i = bisect_left(X, x) i bisect_left(X, x) bisect_left X x if i == 0: return [X[i]-x]
    elif i == len(X): return [X[i-1]-x]
    else: return [X[i]-x, X[i-1]-x] i == 0 i 0 elif i == len(X): return [X[i-1]-x]
     i == len(X) i len(X) len X x x X X from bisect import * A, B, Q = map(int, input().split()) A map(int, input().split()) map int input().split() ().split () input split B Q S, T = [], [] S [] T [] for _ in range(A):
    S.append(int(input())) _ range(A) range A S.append(int(input())) S.append S append int(input()) int input() input for _ in range(B):
    T.append(int(input())) _ range(B) range B T.append(int(input())) T.append T append int(input()) int input() input for _ in range(Q):
    res = 1<<40
    x = int(input())
    for a in near(x,S):
        for b in near(x,T):
            res = min(abs(a)+abs(a-b), abs(b)+abs(b-a), res)
    print(res) _ range(Q) range Q res = 1<<40 res 1<<40 1 40 x = int(input()) x int(input()) int input() input for a in near(x,S):
        for b in near(x,T):
            res = min(abs(a)+abs(a-b), abs(b)+abs(b-a), res)
     a near(x,S) near x S for b in near(x,T):
            res = min(abs(a)+abs(a-b), abs(b)+abs(b-a), res)
     b near(x,T) near x T res = min(abs(a)+abs(a-b), abs(b)+abs(b-a), res) res min(abs(a)+abs(a-b), abs(b)+abs(b-a), res) min abs(a)+abs(a-b) abs(a) abs a abs(a-b) abs a-b a b abs(b)+abs(b-a) abs(b) abs b abs(b-a) abs b-a b a res print(res) print res A, B, Q = map(int, input().split()) map(int, input().split()) A T = [], [] [] T S, T = [], [] [] S def near(x, X):
    i = bisect_left(X, x)
    if i == 0: return [X[i]-x]
    elif i == len(X): return [X[i-1]-x]
    else: return [X[i]-x, X[i-1]-x] def near(x, X):
    i = bisect_left(X, x)
    if i == 0: return [X[i]-x]
    elif i == len(X): return [X[i-1]-x]
    else: return [X[i]-x, X[i-1]-x] near Q = map(int, input().split()) map(int, input().split()) Q res = 1<<40 1<<40 res res = min(abs(a)+abs(a-b), abs(b)+abs(b-a), res) min(abs(a)+abs(a-b), abs(b)+abs(b-a), res) res B, Q = map(int, input().split()) map(int, input().split()) B x = int(input()) int(input()) x
def near(x, X):
    i = bisect_left(X, x)
    if i == 0: return [X[i]-x]
    elif i == len(X): return [X[i-1]-x]
    else: return [X[i]-x, X[i-1]-x]
from bisect import *
A, B, Q = map(int, input().split())
S, T = [], []
for _ in range(A):
    S.append(int(input()))
for _ in range(B):
    T.append(int(input()))
for _ in range(Q):
    res = 1<<40
    x = int(input())
    for a in near(x,S):
        for b in near(x,T):
            res = min(abs(a)+abs(a-b), abs(b)+abs(b-a), res)
    print(res)