A, B, Q = [int(x) for x in input().split()]
s = [-10 ** 10] + [None] * A + [2 * (10 ** 10)]  # s[0], s[A+1]はダミー
t = [-10 ** 10] + [None] * B + [2 * (10 ** 10)]  # t[0], t[B+1]はダミー
x = [0] * Q
for i in range(1, A + 1):
    s[i] = int(input())
for j in range(1, B + 1):
    t[j] = int(input())
for k in range(Q):
    x[k] = int(input())

for i in range(Q):
    # Find s[j] such that s[j] <= x[i] < s[j+1]
    ok = 0       # s[0] < x[i]
    ng = A + 1   # x[i] < s[A+1]
    while ng - ok > 1:
        mid = (ng + ok) // 2
        if s[mid] < x[i]:
            ok = mid
        else:
            ng = mid
    j = ok

    ok = 0      # t[0] < x[i]
    ng = B + 1  # x[i] < t[A+1]
    while ng - ok > 1:
        mid = (ng + ok) // 2
        if t[mid] < x[i]:
            ok = mid
        else:
            ng = mid
    k = ok
 
    ans = min(  max(s[j + 1], t[k + 1]) - x[i], # 右
                x[i] - min(s[j], t[k]),         # 左
                2 * s[j + 1] - t[k] - x[i],     # 右 s[j+1] -> 左 t[k]
                s[j + 1] - 2 * t[k] + x[i],     # 左 t[k] -> 右 s[j+1]
                -s[j] + 2 * t[k + 1] - x[i],    # 右 t[k+1] -> 左 s[j]
                -2 * s[j] + t[k + 1] + x[i])    # 左 s[j] -> 右 t[k+1]

    print(ans) int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x A, B, Q = [int(x) for x in input().split()] A [int(x) for x in input().split()] B Q s = [-10 ** 10] + [None] * A + [2 * (10 ** 10)] s [-10 ** 10] + [None] * A + [2 * (10 ** 10)] [-10 ** 10] + [None] * A [-10 ** 10] -10 ** 10 -10 10 [None] * A [None] None A [2 * (10 ** 10)] 2 * (10 ** 10) 2 10 ** 10 10 10 t = [-10 ** 10] + [None] * B + [2 * (10 ** 10)] t [-10 ** 10] + [None] * B + [2 * (10 ** 10)] [-10 ** 10] + [None] * B [-10 ** 10] -10 ** 10 -10 10 [None] * B [None] None B [2 * (10 ** 10)] 2 * (10 ** 10) 2 10 ** 10 10 10 x = [0] * Q x [0] * Q [0] 0 Q for i in range(1, A + 1):
    s[i] = int(input()) i range(1, A + 1) range 1 A + 1 A 1 s[i] = int(input()) s[i] s i int(input()) int input() input for j in range(1, B + 1):
    t[j] = int(input()) j range(1, B + 1) range 1 B + 1 B 1 t[j] = int(input()) t[j] t j int(input()) int input() input for k in range(Q):
    x[k] = int(input()) k range(Q) range Q x[k] = int(input()) x[k] x k int(input()) int input() input for i in range(Q):
    # Find s[j] such that s[j] <= x[i] < s[j+1]
    ok = 0       # s[0] < x[i]
    ng = A + 1   # x[i] < s[A+1]
    while ng - ok > 1:
        mid = (ng + ok) // 2
        if s[mid] < x[i]:
            ok = mid
        else:
            ng = mid
    j = ok

    ok = 0      # t[0] < x[i]
    ng = B + 1  # x[i] < t[A+1]
    while ng - ok > 1:
        mid = (ng + ok) // 2
        if t[mid] < x[i]:
            ok = mid
        else:
            ng = mid
    k = ok
 
    ans = min(  max(s[j + 1], t[k + 1]) - x[i], # 右
                x[i] - min(s[j], t[k]),         # 左
                2 * s[j + 1] - t[k] - x[i],     # 右 s[j+1] -> 左 t[k]
                s[j + 1] - 2 * t[k] + x[i],     # 左 t[k] -> 右 s[j+1]
                -s[j] + 2 * t[k + 1] - x[i],    # 右 t[k+1] -> 左 s[j]
                -2 * s[j] + t[k + 1] + x[i])    # 左 s[j] -> 右 t[k+1]

    print(ans) i range(Q) range Q ok = 0 ok 0 ng = A + 1 ng A + 1 A 1 while ng - ok > 1:
        mid = (ng + ok) // 2
        if s[mid] < x[i]:
            ok = mid
        else:
            ng = mid
     ng - ok > 1 ng - ok ng ok 1 mid = (ng + ok) // 2 mid (ng + ok) // 2 ng + ok ng ok 2 if s[mid] < x[i]:
            ok = mid
        else:
            ng = mid
     s[mid] < x[i] s[mid] s mid x[i] x i ok = mid ok mid ng = mid ng mid j = ok j ok ok = 0 ok 0 ng = B + 1 ng B + 1 B 1 while ng - ok > 1:
        mid = (ng + ok) // 2
        if t[mid] < x[i]:
            ok = mid
        else:
            ng = mid
     ng - ok > 1 ng - ok ng ok 1 mid = (ng + ok) // 2 mid (ng + ok) // 2 ng + ok ng ok 2 if t[mid] < x[i]:
            ok = mid
        else:
            ng = mid
     t[mid] < x[i] t[mid] t mid x[i] x i ok = mid ok mid ng = mid ng mid k = ok k ok ans = min(  max(s[j + 1], t[k + 1]) - x[i], # 右
                x[i] - min(s[j], t[k]),         # 左
                2 * s[j + 1] - t[k] - x[i],     # 右 s[j+1] -> 左 t[k]
                s[j + 1] - 2 * t[k] + x[i],     # 左 t[k] -> 右 s[j+1]
                -s[j] + 2 * t[k + 1] - x[i],    # 右 t[k+1] -> 左 s[j]
                -2 * s[j] + t[k + 1] + x[i]) ans min(  max(s[j + 1], t[k + 1]) - x[i], # 右
                x[i] - min(s[j], t[k]),         # 左
                2 * s[j + 1] - t[k] - x[i],     # 右 s[j+1] -> 左 t[k]
                s[j + 1] - 2 * t[k] + x[i],     # 左 t[k] -> 右 s[j+1]
                -s[j] + 2 * t[k + 1] - x[i],    # 右 t[k+1] -> 左 s[j]
                -2 * s[j] + t[k + 1] + x[i]) min max(s[j + 1], t[k + 1]) - x[i] max(s[j + 1], t[k + 1]) max s[j + 1] s j + 1 j 1 t[k + 1] t k + 1 k 1 x[i] x i x[i] - min(s[j], t[k]) x[i] x i min(s[j], t[k]) min s[j] s j t[k] t k 2 * s[j + 1] - t[k] - x[i] 2 * s[j + 1] - t[k] 2 * s[j + 1] 2 s[j + 1] s j + 1 j 1 t[k] t k x[i] x i s[j + 1] - 2 * t[k] + x[i] s[j + 1] - 2 * t[k] s[j + 1] s j + 1 j 1 2 * t[k] 2 t[k] t k x[i] x i -s[j] + 2 * t[k + 1] - x[i] -s[j] + 2 * t[k + 1] -s[j] s[j] s j 2 * t[k + 1] 2 t[k + 1] t k + 1 k 1 x[i] x i -2 * s[j] + t[k + 1] + x[i] -2 * s[j] + t[k + 1] -2 * s[j] -2 s[j] s j t[k + 1] t k + 1 k 1 x[i] x i print(ans) print ans mid = (ng + ok) // 2 (ng + ok) // 2 mid ng = mid mid ng s = [-10 ** 10] + [None] * A + [2 * (10 ** 10)] [-10 ** 10] + [None] * A + [2 * (10 ** 10)] s A, B, Q = [int(x) for x in input().split()] [int(x) for x in input().split()] A ok = 0 0 ok B, Q = [int(x) for x in input().split()] [int(x) for x in input().split()] B ok = mid mid ok mid = (ng + ok) // 2 (ng + ok) // 2 mid Q = [int(x) for x in input().split()] [int(x) for x in input().split()] Q ng = B + 1 B + 1 ng k = ok ok k ng = mid mid ng t = [-10 ** 10] + [None] * B + [2 * (10 ** 10)] [-10 ** 10] + [None] * B + [2 * (10 ** 10)] t ok = 0 0 ok ans = min(  max(s[j + 1], t[k + 1]) - x[i], # 右
                x[i] - min(s[j], t[k]),         # 左
                2 * s[j + 1] - t[k] - x[i],     # 右 s[j+1] -> 左 t[k]
                s[j + 1] - 2 * t[k] + x[i],     # 左 t[k] -> 右 s[j+1]
                -s[j] + 2 * t[k + 1] - x[i],    # 右 t[k+1] -> 左 s[j]
                -2 * s[j] + t[k + 1] + x[i]) min(  max(s[j + 1], t[k + 1]) - x[i], # 右
                x[i] - min(s[j], t[k]),         # 左
                2 * s[j + 1] - t[k] - x[i],     # 右 s[j+1] -> 左 t[k]
                s[j + 1] - 2 * t[k] + x[i],     # 左 t[k] -> 右 s[j+1]
                -s[j] + 2 * t[k + 1] - x[i],    # 右 t[k+1] -> 左 s[j]
                -2 * s[j] + t[k + 1] + x[i]) ans ok = mid mid ok ng = A + 1 A + 1 ng x = [0] * Q [0] * Q x j = ok ok j
A, B, Q = [int(x) for x in input().split()]
s = [-10 ** 10] + [None] * A + [2 * (10 ** 10)]  # s[0], s[A+1]はダミー
t = [-10 ** 10] + [None] * B + [2 * (10 ** 10)]  # t[0], t[B+1]はダミー
x = [0] * Q
for i in range(1, A + 1):
    s[i] = int(input())
for j in range(1, B + 1):
    t[j] = int(input())
for k in range(Q):
    x[k] = int(input())

for i in range(Q):
    # Find s[j] such that s[j] <= x[i] < s[j+1]
    ok = 0       # s[0] < x[i]
    ng = A + 1   # x[i] < s[A+1]
    while ng - ok > 1:
        mid = (ng + ok) // 2
        if s[mid] < x[i]:
            ok = mid
        else:
            ng = mid
    j = ok

    ok = 0      # t[0] < x[i]
    ng = B + 1  # x[i] < t[A+1]
    while ng - ok > 1:
        mid = (ng + ok) // 2
        if t[mid] < x[i]:
            ok = mid
        else:
            ng = mid
    k = ok
 
    ans = min(  max(s[j + 1], t[k + 1]) - x[i], # 右
                x[i] - min(s[j], t[k]),         # 左
                2 * s[j + 1] - t[k] - x[i],     # 右 s[j+1] -> 左 t[k]
                s[j + 1] - 2 * t[k] + x[i],     # 左 t[k] -> 右 s[j+1]
                -s[j] + 2 * t[k + 1] - x[i],    # 右 t[k+1] -> 左 s[j]
                -2 * s[j] + t[k + 1] + x[i])    # 左 s[j] -> 右 t[k+1]

    print(ans)
