a,b,q=map(int,input().split())
s=[-10**30]+[int(input())for _ in range(a)]+[10**30]
t=[-10**30]+[int(input())for _ in range(b)]+[10**30]
x=[int(input())for _ in range(q)]
from bisect import bisect_left,bisect_right
for xx in x:
  s1=s[bisect_right(s,xx)-1]
  s2=s[bisect_right(s,xx)]
  t1=t[bisect_right(t,xx)-1]
  t2=t[bisect_right(t,xx)]
  ans=[]
  ans.append(abs(s1-t1)+min(abs(xx-s1),abs(xx-t1)))
  ans.append(abs(s1-t2)+min(abs(xx-s1),abs(xx-t2)))
  ans.append(abs(s2-t1)+min(abs(xx-s2),abs(xx-t1)))
  ans.append(abs(s2-t2)+min(abs(xx-s2),abs(xx-t2)))
  print(min(ans)) 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=[-10**30]+[int(input())for _ in range(a)]+[10**30] s [-10**30]+[int(input())for _ in range(a)]+[10**30] [-10**30]+[int(input())for _ in range(a)] [-10**30] -10**30 -10 30 [int(input())for _ in range(a)] [10**30] 10**30 10 30 int(input())for _ in range(b) for _ in range(b) _ range(b) range b for _ in range(b) int(input()) int input() input t=[-10**30]+[int(input())for _ in range(b)]+[10**30] t [-10**30]+[int(input())for _ in range(b)]+[10**30] [-10**30]+[int(input())for _ in range(b)] [-10**30] -10**30 -10 30 [int(input())for _ in range(b)] [10**30] 10**30 10 30 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)] from bisect import bisect_left,bisect_right for xx in x:
  s1=s[bisect_right(s,xx)-1]
  s2=s[bisect_right(s,xx)]
  t1=t[bisect_right(t,xx)-1]
  t2=t[bisect_right(t,xx)]
  ans=[]
  ans.append(abs(s1-t1)+min(abs(xx-s1),abs(xx-t1)))
  ans.append(abs(s1-t2)+min(abs(xx-s1),abs(xx-t2)))
  ans.append(abs(s2-t1)+min(abs(xx-s2),abs(xx-t1)))
  ans.append(abs(s2-t2)+min(abs(xx-s2),abs(xx-t2)))
  print(min(ans)) xx x s1=s[bisect_right(s,xx)-1] s1 s[bisect_right(s,xx)-1] s bisect_right(s,xx)-1 bisect_right(s,xx) bisect_right s xx 1 s2=s[bisect_right(s,xx)] s2 s[bisect_right(s,xx)] s bisect_right(s,xx) bisect_right s xx t1=t[bisect_right(t,xx)-1] t1 t[bisect_right(t,xx)-1] t bisect_right(t,xx)-1 bisect_right(t,xx) bisect_right t xx 1 t2=t[bisect_right(t,xx)] t2 t[bisect_right(t,xx)] t bisect_right(t,xx) bisect_right t xx ans=[] ans [] ans.append(abs(s1-t1)+min(abs(xx-s1),abs(xx-t1))) ans.append ans append abs(s1-t1)+min(abs(xx-s1),abs(xx-t1)) abs(s1-t1) abs s1-t1 s1 t1 min(abs(xx-s1),abs(xx-t1)) min abs(xx-s1) abs xx-s1 xx s1 abs(xx-t1) abs xx-t1 xx t1 ans.append(abs(s1-t2)+min(abs(xx-s1),abs(xx-t2))) ans.append ans append abs(s1-t2)+min(abs(xx-s1),abs(xx-t2)) abs(s1-t2) abs s1-t2 s1 t2 min(abs(xx-s1),abs(xx-t2)) min abs(xx-s1) abs xx-s1 xx s1 abs(xx-t2) abs xx-t2 xx t2 ans.append(abs(s2-t1)+min(abs(xx-s2),abs(xx-t1))) ans.append ans append abs(s2-t1)+min(abs(xx-s2),abs(xx-t1)) abs(s2-t1) abs s2-t1 s2 t1 min(abs(xx-s2),abs(xx-t1)) min abs(xx-s2) abs xx-s2 xx s2 abs(xx-t1) abs xx-t1 xx t1 ans.append(abs(s2-t2)+min(abs(xx-s2),abs(xx-t2))) ans.append ans append abs(s2-t2)+min(abs(xx-s2),abs(xx-t2)) abs(s2-t2) abs s2-t2 s2 t2 min(abs(xx-s2),abs(xx-t2)) min abs(xx-s2) abs xx-s2 xx s2 abs(xx-t2) abs xx-t2 xx t2 print(min(ans)) print min(ans) min ans b,q=map(int,input().split()) map(int,input().split()) b a,b,q=map(int,input().split()) map(int,input().split()) a s2=s[bisect_right(s,xx)] s[bisect_right(s,xx)] s2 q=map(int,input().split()) map(int,input().split()) q t2=t[bisect_right(t,xx)] t[bisect_right(t,xx)] t2 s1=s[bisect_right(s,xx)-1] s[bisect_right(s,xx)-1] s1 t1=t[bisect_right(t,xx)-1] t[bisect_right(t,xx)-1] t1 ans=[] [] ans t=[-10**30]+[int(input())for _ in range(b)]+[10**30] [-10**30]+[int(input())for _ in range(b)]+[10**30] t x=[int(input())for _ in range(q)] [int(input())for _ in range(q)] x s=[-10**30]+[int(input())for _ in range(a)]+[10**30] [-10**30]+[int(input())for _ in range(a)]+[10**30] s
a,b,q=map(int,input().split())
s=[-10**30]+[int(input())for _ in range(a)]+[10**30]
t=[-10**30]+[int(input())for _ in range(b)]+[10**30]
x=[int(input())for _ in range(q)]
from bisect import bisect_left,bisect_right
for xx in x:
  s1=s[bisect_right(s,xx)-1]
  s2=s[bisect_right(s,xx)]
  t1=t[bisect_right(t,xx)-1]
  t2=t[bisect_right(t,xx)]
  ans=[]
  ans.append(abs(s1-t1)+min(abs(xx-s1),abs(xx-t1)))
  ans.append(abs(s1-t2)+min(abs(xx-s1),abs(xx-t2)))
  ans.append(abs(s2-t1)+min(abs(xx-s2),abs(xx-t1)))
  ans.append(abs(s2-t2)+min(abs(xx-s2),abs(xx-t2)))
  print(min(ans))