import java.io._
import java.util.StringTokenizer
import scala.util.control.Breaks.{breakable,break}

object Main extends App {
  val in = new InputReader(System.in)
  val pw = new PrintWriter(System.out)

  val A, B, Q = in.next().toInt
  val s = new Array[Long](A+1)
  val t = new Array[Long](B+1)
  val _x = new Array[(Long, Int)](Q+1)
  for(i <- 1 to A)
    s(i) = in.next().toLong
  for(i <- 1 to B)
    t(i) = in.next().toLong
  for(i <- 1 to Q)
    _x(i) = (in.next().toLong -> i)

  _x(0) = (0L -> 0)
  val x = _x.sorted
  

  //
  val dps = new Array[Long](A+1)
  var ind = 2
  for (i <- 1 to A) {
    val now = s(i)
    breakable {
      while (ind <= B)
        if (t(ind) > now)
          break
        else
          ind += 1
    }

    if (ind == B+1) {
      dps(i) = Math.abs(s(i) - t(ind-1))
    }
    else {
      dps(i) = Math.min(Math.abs(s(i) - t(ind-1)), Math.abs(s(i) - t(ind)))
    }
  }

  val dpt = new Array[Long](B+1)
  ind = 2
  for (i <- 1 to B) {
    val now = t(i)
    breakable {
      while (ind <= A)
        if (s(ind) > now)
          break
        else
          ind += 1
    }

    if (ind == A+1) {
      dpt(i) = Math.abs(t(i) - s(ind-1))
    }
    else {
      dpt(i) = Math.min(Math.abs(t(i) - s(ind-1)), Math.abs(t(i) - s(ind)))
    }
  }


  //////

  var si = 2
  var ti = 2

  val ans = new Array[Long](Q+1)
  for (i <- 1 to Q) {
    val now = x(i)._1

    breakable {
      while (si <= A)
        if (s(si) > now)
          break
        else
          si += 1
    }
    breakable {
      while (ti <= B)
        if (t(ti) > now)
          break
        else
          ti += 1
    }

    var tmp = 0L
    if (si == A+1)
      tmp = Math.abs(s(si-1) - now) + dps(si-1)
    else
      tmp = Math.min(Math.abs(s(si) - now) + dps(si), Math.abs(s(si-1) - now) + dps(si-1))

    if (ti == B+1)
      tmp = tmp min (Math.abs(t(ti-1) - now) + dpt(ti-1))
    else
      tmp = tmp min Math.min(Math.abs(t(ti) - now) + dpt(ti), Math.abs(t(ti-1) - now) + dpt(ti-1))

    ans(x(i)._2) = tmp
  }

  for(i <- 1 to Q)
    pw.println(ans(i))
  pw.flush()
}


class InputReader(stream: InputStream) {
  private val reader = new BufferedReader(new InputStreamReader(stream))
  private var tokenizer: StringTokenizer = new StringTokenizer(reader.readLine())
  def next(): String = {
    while (!tokenizer.hasMoreTokens()) {
      tokenizer = new StringTokenizer(reader.readLine())
    }
    tokenizer.nextToken()
  }
}
