a,b,q=gets.split.map(&:to_i)
#a = [[0,1]]
s = [-1e15] + a.times.map{gets.to_i} << 1e15
t = [-1e16] + b.times.map{gets.to_i} << 1e16
#s = 0; a=[[0,1e15]] << a.times.map{tmp = s;s=gets.to_i;[s,s-tmp]} << [[1e15,1e15]]
#t = 0; b=[[0,1e15]] << b.times.map{tmp = t;t=gets.to_i;[t,t-tmp]} << [[1e15,1e15]]

#p a

q.times{
        x = gets.to_i
        idxs = s.bsearch_index{|y| y >= x}
        idxt = t.bsearch_index{|y| y >= x}

        sr = s[idxs] ; sl = s[idxs-1]
        tr = t[idxt] ; tl = t[idxt-1]
        p       [[sr,tr].max - x, x - [sl,tl].min ,sr*2-x-tl,sr+x-tl*2,tr*2-x-sl,tr+x-sl*2].min
}