import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = println(solve(new Scanner(System.in)))

  def solve(in: String): String = solve(new Scanner(in))

  def gcd(seq: Seq[Int]): Int = {
    require(seq.nonEmpty)
    gcd(seq.head, seq.tail: _*)
  }

  def gcd(m: Int, ns: Int*): Int = m match {
    case 1 => m
    case _ =>
      ns match {
        case Nil => m.abs
        case n +: rest => gcd(gcd(m, n), rest: _*)
      }
  }

  def solve(sc: Scanner): String = {
    val N = sc.nextInt
    val X = sc.nextInt
    val x = (Array.fill(N)(sc.nextInt) :+ X).sorted

    val xd = for (i <- 1 to N) yield x(i) - x(i - 1)
    val result = gcd(xd)

    result.toString
  }
}
