### BUGGY CODE ###

import bisect

A, B, Q = map(int, input().split())
S = [int(input()) for _ in range(A)]
# print(S)
T = [int(input()) for _ in range(B)]
# print(T)
X = [int(input()) for _ in range(Q)]

score_left_T_right_S = float('inf')
score_left_T_left_S = float('inf')
score_right_T_left_S = float('inf')
score_right_T_right_S = float('inf')
for x in X:
    if bisect.bisect_left(S, x) < A and S[bisect.bisect_left(S, x)] == x:
        left_S = x
        right_S = x
    else:
        if bisect.bisect_right(S, x) - 1 >= 0:
            left_S = S[bisect.bisect_right(S, x) - 1]
        elif bisect.bisect_right(S, x) - 1 < 0:
            left_S = None
        if bisect.bisect_right(S, x) < A:
            right_S = S[bisect.bisect_right(S, x)]
        elif bisect.bisect_right(S, x) >= A:
            right_S = None

    if bisect.bisect_right(T, x) < B and T[bisect.bisect_right(T, x)] == x:
        left_T = x
        right_T = x
    else:
        if bisect.bisect_right(T, x) - 1 >= 0:
            left_T = T[bisect.bisect_right(T, x) - 1]
        elif bisect.bisect_right(T, x) - 1 < 0:
            left_T = None
        if bisect.bisect_right(T, x) < B:
            right_T = T[bisect.bisect_right(T, x)]
        elif bisect.bisect_right(T, x) >= B:
            right_T = None

    if left_T and right_S:
        score_left_T_right_S = min(abs(left_T - x) + abs(left_T - right_S), abs(right_S - x) + abs(left_T - right_S))

    if left_T and left_S:
        score_left_T_left_S = min(abs(left_T - x) + abs(left_T - left_S), abs(left_S - x) + abs(left_T - left_S))

    if right_T and left_S:
        score_right_T_left_S = min(abs(right_T - x) + abs(right_T - left_S),
                                   abs(left_S - x) + abs(right_T - left_S))

    if right_T and right_S:
        score_right_T_right_S = min(abs(right_T - x) + abs(right_T - right_S),
                                  abs(right_S - x) + abs(right_T - right_S))

    print(min(score_left_T_right_S, score_left_T_left_S, score_right_T_left_S, score_right_T_right_S))

    score_left_T_right_S = float('inf')
    score_left_T_left_S = float('inf')
    score_right_T_left_S = float('inf')
    score_right_T_right_S = float('inf')

### FIXED CODE ###

import bisect

A, B, Q = map(int, input().split())
S = [int(input()) for _ in range(A)]
T = [int(input()) for _ in range(B)]
X = [int(input()) for _ in range(Q)]

for x in X:
    ans = float('inf')
    if x < S[0]:
        right_S = S[0]
        left_S = None
    elif x > S[-1]:
        right_S = None
        left_S = S[-1]

    else:
        index_right_S = bisect.bisect_right(S, x)
        if index_right_S < A and S[index_right_S] == x:
            left_S = x
            right_S = x
        else:
            if index_right_S - 1 >= 0:
                left_S = S[index_right_S - 1]
            if index_right_S < A:
                right_S = S[index_right_S]

    if x < T[0]:
        right_T = T[0]
        left_T = None
    elif x > T[-1]:
        right_T = None
        left_T = T[-1]

    else:
        index_right_T = bisect.bisect_right(T, x)
        if index_right_T < B and T[index_right_T] == x:
            left_T = x
            right_T = x
        else:
            if index_right_T - 1 >= 0:
                left_T = T[index_right_T - 1]
            if index_right_T < B:
                right_T = T[index_right_T]

    if left_T and right_S:
        ans = min(ans, abs(left_T - x) + abs(left_T - right_S),
                                   abs(right_S - x) + abs(left_T - right_S))

    if left_T and left_S:
        ans = min(ans, abs(left_T - x) + abs(left_T - left_S),
                                  abs(left_S - x) + abs(left_T - left_S))

    if right_T and left_S:
        ans = min(ans, abs(right_T - x) + abs(right_T - left_S),
                                   abs(left_S - x) + abs(right_T - left_S))

    if right_T and right_S:
        ans = min(ans, abs(right_T - x) + abs(right_T - right_S),
                                  abs(right_S - x) + abs(right_T - right_S))

    print(ans)