import bisect
import sys

read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs = sys.stdin.buffer.readlines

a, b, q = map(int, input().split())
s = sorted([int(input()) for _ in range(a)])
t = sorted([int(input()) for _ in range(b)])

for _ in range(q):
    x = int(input())
    s_i = bisect.bisect_left(s, x)
    t_i = bisect.bisect_left(t, x)

    s0, s1, t0, t1 = None, None, None, None
    ans = 10 ** 11
    if s_i > 0:
        s0 = x - s[s_i-1]
    if s_i < a:
        s1 = s[s_i] - x
    if t_i > 0:
        t0 = x - t[t_i-1]
    if t_i < b:
        t1 = t[t_i] - x

    if s0 is not None and t0 is not None:
        ans = min(ans, max(s0, t0))
    if s1 is not None and t1 is not None:
        ans = min(ans, max(s1, t1))
    if s0 is not None and t1 is not None:
        ans = min(ans, s0*2 + t1, t1*2 + s0)
    if s1 is not None and t0 is not None:
        ans = min(ans, s1*2 + t0, t0*2 + s1)

    print(ans) import bisect bisect import sys sys read = sys.stdin.buffer.read read sys.stdin.buffer.read sys.stdin.buffer sys.stdin sys stdin buffer read input = sys.stdin.buffer.readline input sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer readline inputs = sys.stdin.buffer.readlines inputs sys.stdin.buffer.readlines sys.stdin.buffer sys.stdin sys stdin buffer readlines a, b, q = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b q int(input()) for _ in range(a) for _ in range(a) _ range(a) range a for _ in range(a) int(input()) int input() input s = sorted([int(input()) for _ in range(a)]) s sorted([int(input()) for _ in range(a)]) sorted [int(input()) for _ in range(a)] int(input()) for _ in range(b) for _ in range(b) _ range(b) range b for _ in range(b) int(input()) int input() input t = sorted([int(input()) for _ in range(b)]) t sorted([int(input()) for _ in range(b)]) sorted [int(input()) for _ in range(b)] for _ in range(q):
    x = int(input())
    s_i = bisect.bisect_left(s, x)
    t_i = bisect.bisect_left(t, x)

    s0, s1, t0, t1 = None, None, None, None
    ans = 10 ** 11
    if s_i > 0:
        s0 = x - s[s_i-1]
    if s_i < a:
        s1 = s[s_i] - x
    if t_i > 0:
        t0 = x - t[t_i-1]
    if t_i < b:
        t1 = t[t_i] - x

    if s0 is not None and t0 is not None:
        ans = min(ans, max(s0, t0))
    if s1 is not None and t1 is not None:
        ans = min(ans, max(s1, t1))
    if s0 is not None and t1 is not None:
        ans = min(ans, s0*2 + t1, t1*2 + s0)
    if s1 is not None and t0 is not None:
        ans = min(ans, s1*2 + t0, t0*2 + s1)

    print(ans) _ range(q) range q x = int(input()) x int(input()) int input() input s_i = bisect.bisect_left(s, x) s_i bisect.bisect_left(s, x) bisect.bisect_left bisect bisect_left s x t_i = bisect.bisect_left(t, x) t_i bisect.bisect_left(t, x) bisect.bisect_left bisect bisect_left t x s0, s1, t0, t1 = None, None, None, None s0 None s1 None t0 None t1 None ans = 10 ** 11 ans 10 ** 11 10 11 if s_i > 0:
        s0 = x - s[s_i-1]
     s_i > 0 s_i 0 s0 = x - s[s_i-1] s0 x - s[s_i-1] x s[s_i-1] s s_i-1 s_i 1 if s_i < a:
        s1 = s[s_i] - x
     s_i < a s_i a s1 = s[s_i] - x s1 s[s_i] - x s[s_i] s s_i x if t_i > 0:
        t0 = x - t[t_i-1]
     t_i > 0 t_i 0 t0 = x - t[t_i-1] t0 x - t[t_i-1] x t[t_i-1] t t_i-1 t_i 1 if t_i < b:
        t1 = t[t_i] - x

     t_i < b t_i b t1 = t[t_i] - x t1 t[t_i] - x t[t_i] t t_i x if s0 is not None and t0 is not None:
        ans = min(ans, max(s0, t0))
     s0 is not None and t0 is not None s0 is not None s0 None t0 is not None t0 None ans = min(ans, max(s0, t0)) ans min(ans, max(s0, t0)) min ans max(s0, t0) max s0 t0 if s1 is not None and t1 is not None:
        ans = min(ans, max(s1, t1))
     s1 is not None and t1 is not None s1 is not None s1 None t1 is not None t1 None ans = min(ans, max(s1, t1)) ans min(ans, max(s1, t1)) min ans max(s1, t1) max s1 t1 if s0 is not None and t1 is not None:
        ans = min(ans, s0*2 + t1, t1*2 + s0)
     s0 is not None and t1 is not None s0 is not None s0 None t1 is not None t1 None ans = min(ans, s0*2 + t1, t1*2 + s0) ans min(ans, s0*2 + t1, t1*2 + s0) min ans s0*2 + t1 s0*2 s0 2 t1 t1*2 + s0 t1*2 t1 2 s0 if s1 is not None and t0 is not None:
        ans = min(ans, s1*2 + t0, t0*2 + s1)

     s1 is not None and t0 is not None s1 is not None s1 None t0 is not None t0 None ans = min(ans, s1*2 + t0, t0*2 + s1) ans min(ans, s1*2 + t0, t0*2 + s1) min ans s1*2 + t0 s1*2 s1 2 t0 t0*2 + s1 t0*2 t0 2 s1 print(ans) print ans s0 = x - s[s_i-1] x - s[s_i-1] s0 q = map(int, input().split()) map(int, input().split()) q ans = 10 ** 11 10 ** 11 ans t0 = x - t[t_i-1] x - t[t_i-1] t0 t_i = bisect.bisect_left(t, x) bisect.bisect_left(t, x) t_i t1 = t[t_i] - x t[t_i] - x t1 read = sys.stdin.buffer.read sys.stdin.buffer.read read s1 = s[s_i] - x s[s_i] - x s1 s = sorted([int(input()) for _ in range(a)]) sorted([int(input()) for _ in range(a)]) s a, b, q = map(int, input().split()) map(int, input().split()) a s_i = bisect.bisect_left(s, x) bisect.bisect_left(s, x) s_i t1 = None, None, None, None None t1 ans = min(ans, max(s0, t0)) min(ans, max(s0, t0)) ans s1, t0, t1 = None, None, None, None None s1 b, q = map(int, input().split()) map(int, input().split()) b t = sorted([int(input()) for _ in range(b)]) sorted([int(input()) for _ in range(b)]) t x = int(input()) int(input()) x input = sys.stdin.buffer.readline sys.stdin.buffer.readline input inputs = sys.stdin.buffer.readlines sys.stdin.buffer.readlines inputs ans = min(ans, s0*2 + t1, t1*2 + s0) min(ans, s0*2 + t1, t1*2 + s0) ans ans = min(ans, max(s1, t1)) min(ans, max(s1, t1)) ans t0, t1 = None, None, None, None None t0 s0, s1, t0, t1 = None, None, None, None None s0 ans = min(ans, s1*2 + t0, t0*2 + s1) min(ans, s1*2 + t0, t0*2 + s1) ans
import bisect
import sys

read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs = sys.stdin.buffer.readlines

a, b, q = map(int, input().split())
s = sorted([int(input()) for _ in range(a)])
t = sorted([int(input()) for _ in range(b)])

for _ in range(q):
    x = int(input())
    s_i = bisect.bisect_left(s, x)
    t_i = bisect.bisect_left(t, x)

    s0, s1, t0, t1 = None, None, None, None
    ans = 10 ** 11
    if s_i > 0:
        s0 = x - s[s_i-1]
    if s_i < a:
        s1 = s[s_i] - x
    if t_i > 0:
        t0 = x - t[t_i-1]
    if t_i < b:
        t1 = t[t_i] - x

    if s0 is not None and t0 is not None:
        ans = min(ans, max(s0, t0))
    if s1 is not None and t1 is not None:
        ans = min(ans, max(s1, t1))
    if s0 is not None and t1 is not None:
        ans = min(ans, s0*2 + t1, t1*2 + s0)
    if s1 is not None and t0 is not None:
        ans = min(ans, s1*2 + t0, t0*2 + s1)

    print(ans)