#import sys
#import numpy as np
#import math
#import itertools
#from fractions import Fraction
#import itertools
from collections import deque
#import heapq
#from fractions  import gcd
#input=sys.stdin.readline
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 start in x:
    res=[]
    start_s=bisect.bisect_left(s,start)
    start_t=bisect.bisect_left(t,start)
    if start_s<a and start_t<b:
        res.append(max(s[start_s]-start,t[start_t]-start))
    if start_s-1>-1 and start_t-1>-1:
        res.append(max(start-s[start_s-1],start-t[start_t-1]))
    if start_s<a and start_t-1>-1:
        res.append(2*(s[start_s]-start)+start-t[start_t-1])
        res.append(2*(start-t[start_t-1])+s[start_s]-start)
    if start_t<b and start_s-1>-1:
        res.append(2*(t[start_t]-start)+start-s[start_s-1])
        res.append(2*(start-s[start_s-1])+t[start_t]-start)
    print(min(res)) from collections import deque import bisect bisect 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=[int(input()) for _ in range(a)] s [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=[int(input()) for _ in range(b)] t [int(input()) for _ in range(b)] int(input()) for _ in range(q) for _ in range(q) _ range(q) range q for _ in range(q) int(input()) int input() input x=[int(input()) for _ in range(q)] x [int(input()) for _ in range(q)] for start in x:
    res=[]
    start_s=bisect.bisect_left(s,start)
    start_t=bisect.bisect_left(t,start)
    if start_s<a and start_t<b:
        res.append(max(s[start_s]-start,t[start_t]-start))
    if start_s-1>-1 and start_t-1>-1:
        res.append(max(start-s[start_s-1],start-t[start_t-1]))
    if start_s<a and start_t-1>-1:
        res.append(2*(s[start_s]-start)+start-t[start_t-1])
        res.append(2*(start-t[start_t-1])+s[start_s]-start)
    if start_t<b and start_s-1>-1:
        res.append(2*(t[start_t]-start)+start-s[start_s-1])
        res.append(2*(start-s[start_s-1])+t[start_t]-start)
    print(min(res)) start x res=[] res [] start_s=bisect.bisect_left(s,start) start_s bisect.bisect_left(s,start) bisect.bisect_left bisect bisect_left s start start_t=bisect.bisect_left(t,start) start_t bisect.bisect_left(t,start) bisect.bisect_left bisect bisect_left t start if start_s<a and start_t<b:
        res.append(max(s[start_s]-start,t[start_t]-start))
     start_s<a and start_t<b start_s<a start_s a start_t<b start_t b res.append(max(s[start_s]-start,t[start_t]-start)) res.append res append max(s[start_s]-start,t[start_t]-start) max s[start_s]-start s[start_s] s start_s start t[start_t]-start t[start_t] t start_t start if start_s-1>-1 and start_t-1>-1:
        res.append(max(start-s[start_s-1],start-t[start_t-1]))
     start_s-1>-1 and start_t-1>-1 start_s-1>-1 start_s-1 start_s 1 -1 start_t-1>-1 start_t-1 start_t 1 -1 res.append(max(start-s[start_s-1],start-t[start_t-1])) res.append res append max(start-s[start_s-1],start-t[start_t-1]) max start-s[start_s-1] start s[start_s-1] s start_s-1 start_s 1 start-t[start_t-1] start t[start_t-1] t start_t-1 start_t 1 if start_s<a and start_t-1>-1:
        res.append(2*(s[start_s]-start)+start-t[start_t-1])
        res.append(2*(start-t[start_t-1])+s[start_s]-start)
     start_s<a and start_t-1>-1 start_s<a start_s a start_t-1>-1 start_t-1 start_t 1 -1 res.append(2*(s[start_s]-start)+start-t[start_t-1]) res.append res append 2*(s[start_s]-start)+start-t[start_t-1] 2*(s[start_s]-start)+start 2*(s[start_s]-start) 2 s[start_s]-start s[start_s] s start_s start start t[start_t-1] t start_t-1 start_t 1 res.append(2*(start-t[start_t-1])+s[start_s]-start) res.append res append 2*(start-t[start_t-1])+s[start_s]-start 2*(start-t[start_t-1])+s[start_s] 2*(start-t[start_t-1]) 2 start-t[start_t-1] start t[start_t-1] t start_t-1 start_t 1 s[start_s] s start_s start if start_t<b and start_s-1>-1:
        res.append(2*(t[start_t]-start)+start-s[start_s-1])
        res.append(2*(start-s[start_s-1])+t[start_t]-start)
     start_t<b and start_s-1>-1 start_t<b start_t b start_s-1>-1 start_s-1 start_s 1 -1 res.append(2*(t[start_t]-start)+start-s[start_s-1]) res.append res append 2*(t[start_t]-start)+start-s[start_s-1] 2*(t[start_t]-start)+start 2*(t[start_t]-start) 2 t[start_t]-start t[start_t] t start_t start start s[start_s-1] s start_s-1 start_s 1 res.append(2*(start-s[start_s-1])+t[start_t]-start) res.append res append 2*(start-s[start_s-1])+t[start_t]-start 2*(start-s[start_s-1])+t[start_t] 2*(start-s[start_s-1]) 2 start-s[start_s-1] start s[start_s-1] s start_s-1 start_s 1 t[start_t] t start_t start print(min(res)) print min(res) min res start_t=bisect.bisect_left(t,start) bisect.bisect_left(t,start) start_t b,q=map(int,input().split()) map(int,input().split()) b s=[int(input()) for _ in range(a)] [int(input()) for _ in range(a)] s a,b,q=map(int,input().split()) map(int,input().split()) a q=map(int,input().split()) map(int,input().split()) q start_s=bisect.bisect_left(s,start) bisect.bisect_left(s,start) start_s res=[] [] res t=[int(input()) for _ in range(b)] [int(input()) for _ in range(b)] t x=[int(input()) for _ in range(q)] [int(input()) for _ in range(q)] x
#import sys
#import numpy as np
#import math
#import itertools
#from fractions import Fraction
#import itertools
from collections import deque
#import heapq
#from fractions  import gcd
#input=sys.stdin.readline
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 start in x:
    res=[]
    start_s=bisect.bisect_left(s,start)
    start_t=bisect.bisect_left(t,start)
    if start_s<a and start_t<b:
        res.append(max(s[start_s]-start,t[start_t]-start))
    if start_s-1>-1 and start_t-1>-1:
        res.append(max(start-s[start_s-1],start-t[start_t-1]))
    if start_s<a and start_t-1>-1:
        res.append(2*(s[start_s]-start)+start-t[start_t-1])
        res.append(2*(start-t[start_t-1])+s[start_s]-start)
    if start_t<b and start_s-1>-1:
        res.append(2*(t[start_t]-start)+start-s[start_s-1])
        res.append(2*(start-s[start_s-1])+t[start_t]-start)
    print(min(res))