'''
研究室PCでの解答
'''
import math
#import numpy as np
import queue
import bisect
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)
mod = 10**9+7 #998244353
dir = [(-1,0),(1,0),(0,-1),(0,1)]
alp = "abcdefghijklmnopqrstuvwxyz"

'''
pythonにsortedsetをくれlower_boundとupper_boundをくれ
'''

def main():
    a,b,q = map(int,ipt().split())
    s = [-10**11]+[int(ipt()) for i in range(a)]+[10**11]
    t = [-10**11]+[int(ipt()) for i in range(b)]+[10**11]

    for i in range(q):
        x = int(ipt())
        ns = bisect.bisect_left(s,x)
        nt = bisect.bisect_left(t,x)
        ls = s[ns-1]-x
        rs = s[ns]-x
        lt = t[nt-1]-x
        rt = t[nt]-x
        ans = []
        ans.append(2*rs-lt)
        ans.append(2*rt-ls)
        ans.append(max(rs,rt))
        ans.append(-min(ls,lt))
        ans.append(rs-2*lt)
        ans.append(rt-2*ls)
        print(min(ans))

if __name__ == '__main__':
    main() '''
研究室PCでの解答
''' import math math import queue queue import bisect bisect from collections import deque,defaultdict import heapq as hpq heapq from sys import stdin,setrecursionlimit ipt = stdin.readline ipt stdin.readline stdin readline setrecursionlimit(10**7) setrecursionlimit 10**7 10 7 mod = 10**9+7 mod 10**9+7 10**9 10 9 7 dir = [(-1,0),(1,0),(0,-1),(0,1)] dir [(-1,0),(1,0),(0,-1),(0,1)] (-1,0) -1 0 (1,0) 1 0 (0,-1) 0 -1 (0,1) 0 1 alp = "abcdefghijklmnopqrstuvwxyz" alp "abcdefghijklmnopqrstuvwxyz" '''
pythonにsortedsetをくれlower_boundとupper_boundをくれ
''' def main():
    a,b,q = map(int,ipt().split())
    s = [-10**11]+[int(ipt()) for i in range(a)]+[10**11]
    t = [-10**11]+[int(ipt()) for i in range(b)]+[10**11]

    for i in range(q):
        x = int(ipt())
        ns = bisect.bisect_left(s,x)
        nt = bisect.bisect_left(t,x)
        ls = s[ns-1]-x
        rs = s[ns]-x
        lt = t[nt-1]-x
        rt = t[nt]-x
        ans = []
        ans.append(2*rs-lt)
        ans.append(2*rt-ls)
        ans.append(max(rs,rt))
        ans.append(-min(ls,lt))
        ans.append(rs-2*lt)
        ans.append(rt-2*ls)
        print(min(ans)) main a,b,q = map(int,ipt().split()) a map(int,ipt().split()) map int ipt().split() ().split () ipt split b q int(ipt()) for i in range(a) for i in range(a) i range(a) range a for i in range(a) int(ipt()) int ipt() ipt s = [-10**11]+[int(ipt()) for i in range(a)]+[10**11] s [-10**11]+[int(ipt()) for i in range(a)]+[10**11] [-10**11]+[int(ipt()) for i in range(a)] [-10**11] -10**11 -10 11 [int(ipt()) for i in range(a)] [10**11] 10**11 10 11 int(ipt()) for i in range(b) for i in range(b) i range(b) range b for i in range(b) int(ipt()) int ipt() ipt t = [-10**11]+[int(ipt()) for i in range(b)]+[10**11] t [-10**11]+[int(ipt()) for i in range(b)]+[10**11] [-10**11]+[int(ipt()) for i in range(b)] [-10**11] -10**11 -10 11 [int(ipt()) for i in range(b)] [10**11] 10**11 10 11 for i in range(q):
        x = int(ipt())
        ns = bisect.bisect_left(s,x)
        nt = bisect.bisect_left(t,x)
        ls = s[ns-1]-x
        rs = s[ns]-x
        lt = t[nt-1]-x
        rt = t[nt]-x
        ans = []
        ans.append(2*rs-lt)
        ans.append(2*rt-ls)
        ans.append(max(rs,rt))
        ans.append(-min(ls,lt))
        ans.append(rs-2*lt)
        ans.append(rt-2*ls)
        print(min(ans)) i range(q) range q x = int(ipt()) x int(ipt()) int ipt() ipt ns = bisect.bisect_left(s,x) ns bisect.bisect_left(s,x) bisect.bisect_left bisect bisect_left s x nt = bisect.bisect_left(t,x) nt bisect.bisect_left(t,x) bisect.bisect_left bisect bisect_left t x ls = s[ns-1]-x ls s[ns-1]-x s[ns-1] s ns-1 ns 1 x rs = s[ns]-x rs s[ns]-x s[ns] s ns x lt = t[nt-1]-x lt t[nt-1]-x t[nt-1] t nt-1 nt 1 x rt = t[nt]-x rt t[nt]-x t[nt] t nt x ans = [] ans [] ans.append(2*rs-lt) ans.append ans append 2*rs-lt 2*rs 2 rs lt ans.append(2*rt-ls) ans.append ans append 2*rt-ls 2*rt 2 rt ls ans.append(max(rs,rt)) ans.append ans append max(rs,rt) max rs rt ans.append(-min(ls,lt)) ans.append ans append -min(ls,lt) min(ls,lt) min ls lt ans.append(rs-2*lt) ans.append ans append rs-2*lt rs 2*lt 2 lt ans.append(rt-2*ls) ans.append ans append rt-2*ls rt 2*ls 2 ls print(min(ans)) print min(ans) min ans if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main mod = 10**9+7 10**9+7 mod dir = [(-1,0),(1,0),(0,-1),(0,1)] [(-1,0),(1,0),(0,-1),(0,1)] dir alp = "abcdefghijklmnopqrstuvwxyz" "abcdefghijklmnopqrstuvwxyz" alp def main():
    a,b,q = map(int,ipt().split())
    s = [-10**11]+[int(ipt()) for i in range(a)]+[10**11]
    t = [-10**11]+[int(ipt()) for i in range(b)]+[10**11]

    for i in range(q):
        x = int(ipt())
        ns = bisect.bisect_left(s,x)
        nt = bisect.bisect_left(t,x)
        ls = s[ns-1]-x
        rs = s[ns]-x
        lt = t[nt-1]-x
        rt = t[nt]-x
        ans = []
        ans.append(2*rs-lt)
        ans.append(2*rt-ls)
        ans.append(max(rs,rt))
        ans.append(-min(ls,lt))
        ans.append(rs-2*lt)
        ans.append(rt-2*ls)
        print(min(ans)) def main():
    a,b,q = map(int,ipt().split())
    s = [-10**11]+[int(ipt()) for i in range(a)]+[10**11]
    t = [-10**11]+[int(ipt()) for i in range(b)]+[10**11]

    for i in range(q):
        x = int(ipt())
        ns = bisect.bisect_left(s,x)
        nt = bisect.bisect_left(t,x)
        ls = s[ns-1]-x
        rs = s[ns]-x
        lt = t[nt-1]-x
        rt = t[nt]-x
        ans = []
        ans.append(2*rs-lt)
        ans.append(2*rt-ls)
        ans.append(max(rs,rt))
        ans.append(-min(ls,lt))
        ans.append(rs-2*lt)
        ans.append(rt-2*ls)
        print(min(ans)) main ipt = stdin.readline stdin.readline ipt
'''
研究室PCでの解答
'''
import math
#import numpy as np
import queue
import bisect
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)
mod = 10**9+7 #998244353
dir = [(-1,0),(1,0),(0,-1),(0,1)]
alp = "abcdefghijklmnopqrstuvwxyz"

'''
pythonにsortedsetをくれlower_boundとupper_boundをくれ
'''

def main():
    a,b,q = map(int,ipt().split())
    s = [-10**11]+[int(ipt()) for i in range(a)]+[10**11]
    t = [-10**11]+[int(ipt()) for i in range(b)]+[10**11]

    for i in range(q):
        x = int(ipt())
        ns = bisect.bisect_left(s,x)
        nt = bisect.bisect_left(t,x)
        ls = s[ns-1]-x
        rs = s[ns]-x
        lt = t[nt-1]-x
        rt = t[nt]-x
        ans = []
        ans.append(2*rs-lt)
        ans.append(2*rt-ls)
        ans.append(max(rs,rt))
        ans.append(-min(ls,lt))
        ans.append(rs-2*lt)
        ans.append(rt-2*ls)
        print(min(ans))

if __name__ == '__main__':
    main()
