import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import time,random

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
mod2 = 998244353
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    a,b,q = LI()
    sa = [-inf,-inf] + [I() for _ in range(a)] + [inf, inf]
    ta = [-inf,-inf] + [I() for _ in range(b)] + [inf, inf]
    xa = [I() for _ in range(q)]
    r = []
    for x in xa:
        si = bisect.bisect_left(sa, x)
        ti = bisect.bisect_left(ta, x)
        l = sa[si-1]
        k = x - l
        ti2 = bisect.bisect_left(ta, l)
        t = inf
        if ti2 > 0 and t > k + l - ta[ti2-1]:
            t = k + l - ta[ti2-1]
        if t > k + ta[ti2] - l:
            t = k + ta[ti2] - l
        l = sa[si]
        k = l - x
        ti2 = bisect.bisect_left(ta, l)
        if ti2 > 0 and t > k + l - ta[ti2-1]:
            t = k + l - ta[ti2-1]
        if t > k + ta[ti2] - l:
            t = k + ta[ti2] - l

        l = ta[ti-1]
        k = x - l
        si2 = bisect.bisect_left(sa, l)
        if si2 > 0 and t > k + l - sa[si2-1]:
            t = k + l - sa[si2-1]
        if t > k + sa[si2] - l:
            t = k + sa[si2] - l
        l = ta[ti]
        k = l - x
        si2 = bisect.bisect_left(sa, l)
        if si2 > 0 and t > k + l - sa[si2-1]:
            t = k + l - sa[si2-1]
        if t > k + sa[si2] - l:
            t = k + sa[si2] - l


        r.append(t)

    return JA(r, "\n")

print(main())


 import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools math string itertools fractions heapq collections re array bisect sys copy functools import time,random time random sys.setrecursionlimit(10**7) sys.setrecursionlimit sys setrecursionlimit 10**7 10 7 inf = 10**20 inf 10**20 10 20 eps = 1.0 / 10**10 eps 1.0 / 10**10 1.0 10**10 10 10 mod = 10**9+7 mod 10**9+7 10**9 10 9 7 mod2 = 998244353 mod2 998244353 dd = [(-1,0),(0,1),(1,0),(0,-1)] dd [(-1,0),(0,1),(1,0),(0,-1)] (-1,0) -1 0 (0,1) 0 1 (1,0) 1 0 (0,-1) 0 -1 ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)] ddn [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)] (-1,0) -1 0 (-1,1) -1 1 (0,1) 0 1 (1,1) 1 1 (1,0) 1 0 (1,-1) 1 -1 (0,-1) 0 -1 (-1,-1) -1 -1 def LI(): return list(map(int, sys.stdin.readline().split())) LI list(map(int, l.split())) for l in sys.stdin.readlines() for l in sys.stdin.readlines() l sys.stdin.readlines() sys.stdin.readlines sys.stdin sys stdin readlines for l in sys.stdin.readlines() list(map(int, l.split())) list map(int, l.split()) map int l.split() l.split l split def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()] LLI int(x)-1 for x in sys.stdin.readline().split() for x in sys.stdin.readline().split() x sys.stdin.readline().split() sys.stdin.readline().split sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline split for x in sys.stdin.readline().split() int(x)-1 int(x) int x 1 def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()] LI_ float(x) for x in sys.stdin.readline().split() for x in sys.stdin.readline().split() x sys.stdin.readline().split() sys.stdin.readline().split sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline split for x in sys.stdin.readline().split() float(x) float x def LF(): return [float(x) for x in sys.stdin.readline().split()] LF def LS(): return sys.stdin.readline().split() LS def I(): return int(sys.stdin.readline()) I def F(): return float(sys.stdin.readline()) F def S(): return input() S def pf(s): return print(s, flush=True) pf s s def pe(s): return print(str(s), file=sys.stderr) pe s s def JA(a, sep): return sep.join(map(str, a)) JA a a sep sep def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a) JAA a a s s t t def main():
    a,b,q = LI()
    sa = [-inf,-inf] + [I() for _ in range(a)] + [inf, inf]
    ta = [-inf,-inf] + [I() for _ in range(b)] + [inf, inf]
    xa = [I() for _ in range(q)]
    r = []
    for x in xa:
        si = bisect.bisect_left(sa, x)
        ti = bisect.bisect_left(ta, x)
        l = sa[si-1]
        k = x - l
        ti2 = bisect.bisect_left(ta, l)
        t = inf
        if ti2 > 0 and t > k + l - ta[ti2-1]:
            t = k + l - ta[ti2-1]
        if t > k + ta[ti2] - l:
            t = k + ta[ti2] - l
        l = sa[si]
        k = l - x
        ti2 = bisect.bisect_left(ta, l)
        if ti2 > 0 and t > k + l - ta[ti2-1]:
            t = k + l - ta[ti2-1]
        if t > k + ta[ti2] - l:
            t = k + ta[ti2] - l

        l = ta[ti-1]
        k = x - l
        si2 = bisect.bisect_left(sa, l)
        if si2 > 0 and t > k + l - sa[si2-1]:
            t = k + l - sa[si2-1]
        if t > k + sa[si2] - l:
            t = k + sa[si2] - l
        l = ta[ti]
        k = l - x
        si2 = bisect.bisect_left(sa, l)
        if si2 > 0 and t > k + l - sa[si2-1]:
            t = k + l - sa[si2-1]
        if t > k + sa[si2] - l:
            t = k + sa[si2] - l


        r.append(t)

    return JA(r, "\n") main a,b,q = LI() a LI() LI b q I() for _ in range(a) for _ in range(a) _ range(a) range a for _ in range(a) I() I sa = [-inf,-inf] + [I() for _ in range(a)] + [inf, inf] sa [-inf,-inf] + [I() for _ in range(a)] + [inf, inf] [-inf,-inf] + [I() for _ in range(a)] [-inf,-inf] -inf inf -inf inf [I() for _ in range(a)] [inf, inf] inf inf I() for _ in range(b) for _ in range(b) _ range(b) range b for _ in range(b) I() I ta = [-inf,-inf] + [I() for _ in range(b)] + [inf, inf] ta [-inf,-inf] + [I() for _ in range(b)] + [inf, inf] [-inf,-inf] + [I() for _ in range(b)] [-inf,-inf] -inf inf -inf inf [I() for _ in range(b)] [inf, inf] inf inf I() for _ in range(q) for _ in range(q) _ range(q) range q for _ in range(q) I() I xa = [I() for _ in range(q)] xa [I() for _ in range(q)] r = [] r [] for x in xa:
        si = bisect.bisect_left(sa, x)
        ti = bisect.bisect_left(ta, x)
        l = sa[si-1]
        k = x - l
        ti2 = bisect.bisect_left(ta, l)
        t = inf
        if ti2 > 0 and t > k + l - ta[ti2-1]:
            t = k + l - ta[ti2-1]
        if t > k + ta[ti2] - l:
            t = k + ta[ti2] - l
        l = sa[si]
        k = l - x
        ti2 = bisect.bisect_left(ta, l)
        if ti2 > 0 and t > k + l - ta[ti2-1]:
            t = k + l - ta[ti2-1]
        if t > k + ta[ti2] - l:
            t = k + ta[ti2] - l

        l = ta[ti-1]
        k = x - l
        si2 = bisect.bisect_left(sa, l)
        if si2 > 0 and t > k + l - sa[si2-1]:
            t = k + l - sa[si2-1]
        if t > k + sa[si2] - l:
            t = k + sa[si2] - l
        l = ta[ti]
        k = l - x
        si2 = bisect.bisect_left(sa, l)
        if si2 > 0 and t > k + l - sa[si2-1]:
            t = k + l - sa[si2-1]
        if t > k + sa[si2] - l:
            t = k + sa[si2] - l


        r.append(t)

     x xa si = bisect.bisect_left(sa, x) si bisect.bisect_left(sa, x) bisect.bisect_left bisect bisect_left sa x ti = bisect.bisect_left(ta, x) ti bisect.bisect_left(ta, x) bisect.bisect_left bisect bisect_left ta x l = sa[si-1] l sa[si-1] sa si-1 si 1 k = x - l k x - l x l ti2 = bisect.bisect_left(ta, l) ti2 bisect.bisect_left(ta, l) bisect.bisect_left bisect bisect_left ta l t = inf t inf if ti2 > 0 and t > k + l - ta[ti2-1]:
            t = k + l - ta[ti2-1]
         ti2 > 0 and t > k + l - ta[ti2-1] ti2 > 0 ti2 0 t > k + l - ta[ti2-1] t k + l - ta[ti2-1] k + l k l ta[ti2-1] ta ti2-1 ti2 1 t = k + l - ta[ti2-1] t k + l - ta[ti2-1] k + l k l ta[ti2-1] ta ti2-1 ti2 1 if t > k + ta[ti2] - l:
            t = k + ta[ti2] - l
         t > k + ta[ti2] - l t k + ta[ti2] - l k + ta[ti2] k ta[ti2] ta ti2 l t = k + ta[ti2] - l t k + ta[ti2] - l k + ta[ti2] k ta[ti2] ta ti2 l l = sa[si] l sa[si] sa si k = l - x k l - x l x ti2 = bisect.bisect_left(ta, l) ti2 bisect.bisect_left(ta, l) bisect.bisect_left bisect bisect_left ta l if ti2 > 0 and t > k + l - ta[ti2-1]:
            t = k + l - ta[ti2-1]
         ti2 > 0 and t > k + l - ta[ti2-1] ti2 > 0 ti2 0 t > k + l - ta[ti2-1] t k + l - ta[ti2-1] k + l k l ta[ti2-1] ta ti2-1 ti2 1 t = k + l - ta[ti2-1] t k + l - ta[ti2-1] k + l k l ta[ti2-1] ta ti2-1 ti2 1 if t > k + ta[ti2] - l:
            t = k + ta[ti2] - l

         t > k + ta[ti2] - l t k + ta[ti2] - l k + ta[ti2] k ta[ti2] ta ti2 l t = k + ta[ti2] - l t k + ta[ti2] - l k + ta[ti2] k ta[ti2] ta ti2 l l = ta[ti-1] l ta[ti-1] ta ti-1 ti 1 k = x - l k x - l x l si2 = bisect.bisect_left(sa, l) si2 bisect.bisect_left(sa, l) bisect.bisect_left bisect bisect_left sa l if si2 > 0 and t > k + l - sa[si2-1]:
            t = k + l - sa[si2-1]
         si2 > 0 and t > k + l - sa[si2-1] si2 > 0 si2 0 t > k + l - sa[si2-1] t k + l - sa[si2-1] k + l k l sa[si2-1] sa si2-1 si2 1 t = k + l - sa[si2-1] t k + l - sa[si2-1] k + l k l sa[si2-1] sa si2-1 si2 1 if t > k + sa[si2] - l:
            t = k + sa[si2] - l
         t > k + sa[si2] - l t k + sa[si2] - l k + sa[si2] k sa[si2] sa si2 l t = k + sa[si2] - l t k + sa[si2] - l k + sa[si2] k sa[si2] sa si2 l l = ta[ti] l ta[ti] ta ti k = l - x k l - x l x si2 = bisect.bisect_left(sa, l) si2 bisect.bisect_left(sa, l) bisect.bisect_left bisect bisect_left sa l if si2 > 0 and t > k + l - sa[si2-1]:
            t = k + l - sa[si2-1]
         si2 > 0 and t > k + l - sa[si2-1] si2 > 0 si2 0 t > k + l - sa[si2-1] t k + l - sa[si2-1] k + l k l sa[si2-1] sa si2-1 si2 1 t = k + l - sa[si2-1] t k + l - sa[si2-1] k + l k l sa[si2-1] sa si2-1 si2 1 if t > k + sa[si2] - l:
            t = k + sa[si2] - l


         t > k + sa[si2] - l t k + sa[si2] - l k + sa[si2] k sa[si2] sa si2 l t = k + sa[si2] - l t k + sa[si2] - l k + sa[si2] k sa[si2] sa si2 l r.append(t) r.append r append t return JA(r, "\n") JA(r, "\n") JA r "\n" print(main()) print main() main def I(): return int(sys.stdin.readline()) def I(): return int(sys.stdin.readline()) I def F(): return float(sys.stdin.readline()) def F(): return float(sys.stdin.readline()) F eps = 1.0 / 10**10 1.0 / 10**10 eps def pe(s): return print(str(s), file=sys.stderr) def pe(s): return print(str(s), file=sys.stderr) pe def LS(): return sys.stdin.readline().split() def LS(): return sys.stdin.readline().split() LS mod = 10**9+7 10**9+7 mod ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)] [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)] ddn def pf(s): return print(s, flush=True) def pf(s): return print(s, flush=True) pf def JA(a, sep): return sep.join(map(str, a)) def JA(a, sep): return sep.join(map(str, a)) JA def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()] def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()] LLI def main():
    a,b,q = LI()
    sa = [-inf,-inf] + [I() for _ in range(a)] + [inf, inf]
    ta = [-inf,-inf] + [I() for _ in range(b)] + [inf, inf]
    xa = [I() for _ in range(q)]
    r = []
    for x in xa:
        si = bisect.bisect_left(sa, x)
        ti = bisect.bisect_left(ta, x)
        l = sa[si-1]
        k = x - l
        ti2 = bisect.bisect_left(ta, l)
        t = inf
        if ti2 > 0 and t > k + l - ta[ti2-1]:
            t = k + l - ta[ti2-1]
        if t > k + ta[ti2] - l:
            t = k + ta[ti2] - l
        l = sa[si]
        k = l - x
        ti2 = bisect.bisect_left(ta, l)
        if ti2 > 0 and t > k + l - ta[ti2-1]:
            t = k + l - ta[ti2-1]
        if t > k + ta[ti2] - l:
            t = k + ta[ti2] - l

        l = ta[ti-1]
        k = x - l
        si2 = bisect.bisect_left(sa, l)
        if si2 > 0 and t > k + l - sa[si2-1]:
            t = k + l - sa[si2-1]
        if t > k + sa[si2] - l:
            t = k + sa[si2] - l
        l = ta[ti]
        k = l - x
        si2 = bisect.bisect_left(sa, l)
        if si2 > 0 and t > k + l - sa[si2-1]:
            t = k + l - sa[si2-1]
        if t > k + sa[si2] - l:
            t = k + sa[si2] - l


        r.append(t)

    return JA(r, "\n") def main():
    a,b,q = LI()
    sa = [-inf,-inf] + [I() for _ in range(a)] + [inf, inf]
    ta = [-inf,-inf] + [I() for _ in range(b)] + [inf, inf]
    xa = [I() for _ in range(q)]
    r = []
    for x in xa:
        si = bisect.bisect_left(sa, x)
        ti = bisect.bisect_left(ta, x)
        l = sa[si-1]
        k = x - l
        ti2 = bisect.bisect_left(ta, l)
        t = inf
        if ti2 > 0 and t > k + l - ta[ti2-1]:
            t = k + l - ta[ti2-1]
        if t > k + ta[ti2] - l:
            t = k + ta[ti2] - l
        l = sa[si]
        k = l - x
        ti2 = bisect.bisect_left(ta, l)
        if ti2 > 0 and t > k + l - ta[ti2-1]:
            t = k + l - ta[ti2-1]
        if t > k + ta[ti2] - l:
            t = k + ta[ti2] - l

        l = ta[ti-1]
        k = x - l
        si2 = bisect.bisect_left(sa, l)
        if si2 > 0 and t > k + l - sa[si2-1]:
            t = k + l - sa[si2-1]
        if t > k + sa[si2] - l:
            t = k + sa[si2] - l
        l = ta[ti]
        k = l - x
        si2 = bisect.bisect_left(sa, l)
        if si2 > 0 and t > k + l - sa[si2-1]:
            t = k + l - sa[si2-1]
        if t > k + sa[si2] - l:
            t = k + sa[si2] - l


        r.append(t)

    return JA(r, "\n") main mod2 = 998244353 998244353 mod2 def LI(): return list(map(int, sys.stdin.readline().split())) def LI(): return list(map(int, sys.stdin.readline().split())) LI def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()] def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()] LI_ def LF(): return [float(x) for x in sys.stdin.readline().split()] def LF(): return [float(x) for x in sys.stdin.readline().split()] LF inf = 10**20 10**20 inf def S(): return input() def S(): return input() S dd = [(-1,0),(0,1),(1,0),(0,-1)] [(-1,0),(0,1),(1,0),(0,-1)] dd def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a) def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a) JAA
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import time,random

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
mod2 = 998244353
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    a,b,q = LI()
    sa = [-inf,-inf] + [I() for _ in range(a)] + [inf, inf]
    ta = [-inf,-inf] + [I() for _ in range(b)] + [inf, inf]
    xa = [I() for _ in range(q)]
    r = []
    for x in xa:
        si = bisect.bisect_left(sa, x)
        ti = bisect.bisect_left(ta, x)
        l = sa[si-1]
        k = x - l
        ti2 = bisect.bisect_left(ta, l)
        t = inf
        if ti2 > 0 and t > k + l - ta[ti2-1]:
            t = k + l - ta[ti2-1]
        if t > k + ta[ti2] - l:
            t = k + ta[ti2] - l
        l = sa[si]
        k = l - x
        ti2 = bisect.bisect_left(ta, l)
        if ti2 > 0 and t > k + l - ta[ti2-1]:
            t = k + l - ta[ti2-1]
        if t > k + ta[ti2] - l:
            t = k + ta[ti2] - l

        l = ta[ti-1]
        k = x - l
        si2 = bisect.bisect_left(sa, l)
        if si2 > 0 and t > k + l - sa[si2-1]:
            t = k + l - sa[si2-1]
        if t > k + sa[si2] - l:
            t = k + sa[si2] - l
        l = ta[ti]
        k = l - x
        si2 = bisect.bisect_left(sa, l)
        if si2 > 0 and t > k + l - sa[si2-1]:
            t = k + l - sa[si2-1]
        if t > k + sa[si2] - l:
            t = k + sa[si2] - l


        r.append(t)

    return JA(r, "\n")

print(main())



