const Main = input => {
    input = input.split("\n");
    const n = parseInt(input[0], 10);
    input.shift();
    const s = input;

    let ac = 0;
    let wa = 0;
    let tle = 0;
    let re = 0;

    for(let i = 0; i < n; i++) {
        switch(s[i]) {
            case "AC":
                ac++;
                break;
            case "WA":
                wa++;
                break;
            case "TLE":
                tle++;
                break;
            case "RE":
                re++;
                break;
            default:
                break;
        }
    }

    console.log(`AC x ${ac}
WA x ${wa}
TLE x ${tle}
RE x ${re}`);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));


function Main(input) {
    let array = input.split("\n");
    let item = parseInt(array[0]);

    let countAC = 0;
    let countWA = 0;
    let countTLE = 0;
    let countRE = 0;
    for (let i =1;i<=item;i++){
        if (array[i] == "AC"){
            countAC++;
        } else if (array[i] == "WA"){
            countWA++;
        } else if (array[i] == "TLE"){
            countTLE++;
        } else if (array[i] == "RE"){
            countRE++;
        }
    }
    console.log("AC x "+countAC);
    console.log("WA x "+countWA);
    console.log("TLE x "+countTLE);
    console.log("RE x "+countRE);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


function main(lines) {
  const input = lines.split('\n')

  let AC = 0;
  let WA = 0;
  let TLE = 0;
  let RE = 0;

  for(let i=1; i<input.length; i++){
      if(input[i] === 'AC') AC++
      if(input[i] === 'WA') WA++
      if(input[i] === 'TLE') TLE++
      if(input[i] === 'RE') RE++
  }
  console.log('AC' + ' x ' + AC)
  console.log('WA' + ' x ' + WA)
  console.log('TLE' + ' x ' + TLE)
  console.log('RE' + ' x ' + RE)
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));


function Main(input) {
   var tmp = input.split("\n");
   var num = parseInt(tmp[0]);
   var ary = [];
   var pst = 0;
   var numAC = 0;
   var numWA = 0;
   var numTLE = 0;
   var numRE = 0;

   for(pst=1; pst<=num; pst++){
       ary.push(tmp[pst]);
   }
   for(pst=0; pst<ary.length; pst++){
       if(ary[pst]==="AC"){
           numAC+=1;
       }else if(ary[pst]==="WA"){
           numWA+=1;
       }else if(ary[pst]==="TLE"){
           numTLE+=1;
       }else if(ary[pst]==="RE"){
           numRE+=1;
       }
   }

   console.log("AC　×　"+numAC);
   console.log("WA　×　"+numWA);
   console.log("TLE　×　"+numTLE);
   console.log("RE　×　"+numRE);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


function Main(input) {
   var tmp = input.split("\n");
   var num = parseInt(tmp[0]);
   var ary = [];
   var pst = 0;
   var numAC = 0;
   var numWA = 0;
   var numTLE = 0;
   var numRE = 0;

   for(pst=1; pst<=num; pst++){
       ary.push(tmp[pst]);
   }
   for(pst=0; pst<ary.length; pst++){
       if(ary[pst]==="AC"){
           numAC+=1;
       }else if(ary[pst]==="WA"){
           numWA+=1;
       }else if(ary[pst]==="TLE"){
           numTLE+=1;
       }else if(ary[pst]==="RE"){
           numRE+=1;
       }
   }

   console.log("AC × "+numAC);
   console.log("WA × "+numWA);
   console.log("TLE × "+numTLE);
   console.log("RE × "+numRE);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


function Main(input) {
   var tmp = input.split("\n");
   tmp[0] = parseInt(tmp[0]);
   var ary = [];
   var pst;
   var numAC = 0;
   var numWA = 0;
   var numTLE = 0;
   var numRE = 0;

   for(pst=1; pst<=tmp[0]; pst++){
       ary.push(tmp[pst]);
   }

   for(pst=0; pst<ary.length; pst++){
       if(ary[pst]==="AC"){
           numAC+=1;
       }else if(ary[pst]==="WA"){
           numWA+=1;
       }else if(ary[pst]==="TLE"){
           numTLE+=1;
       }else if(ary[pst]==="RE"){
           numRE+=1;
       }
   }

   console.log("AC × "+numAC);
   console.log("WA × "+numWA);
   console.log("TLE × "+numTLE);
   console.log("RE × "+numRE);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {

	scanner := bufio.NewScanner(os.Stdin)
	var n, ac, wa, tle, re int
	scanner.Scan()
	fmt.Sscan(scanner.Text(), &n)
	for i := 0; i < n; i++ {
		scanner.Scan()
		switch scanner.Text() {
		case "AC":
			ac++
		case "WA":
			wa++
		case "TLE":
			tle++
		case "RE":
			re++
		}
	}
	fmt.Printf("AC x %d\n", ac)
	fmt.Printf("WA x %d\n", wa)
	fmt.Printf("TLE x %d\n", tle)
	fmt.Printf("RE x %d\n", re)
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	var n, ac, wa, tle, re int
	scanner.Scan()
	fmt.Sscan(scanner.Text(), &n)

	for i := 0; i < n; i++ {
		scanner.Scan()
		switch scanner.Text() {
		case "AC":
			ac++
		case "WA":
			wa++
		case "TLE":
			tle++
		default:
			re++
		}
	}

	fmt.Println("AC x", ac)
	fmt.Println("WA x", wa)
	fmt.Println("TLE x", tle)
	fmt.Println("RE x", re)
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	var N int
	var AC, WA, TLE, RE int
	scanner.Scan()
	fmt.Sscan(scanner.Text(), &N)

	for i := 0; i < N; i++ {
		scanner.Scan()
		switch scanner.Text() {
		case "AC":
			AC++
		case "WA":
			WA++
		case "TLE":
			TLE++
		default:
			RE++
		}
	}
	line := `AC x %d
WA x %d
TLE x %d
RE x %d
`
	fmt.Printf(line, AC, WA, TLE, RE)
}


ackage main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func scanInt() int {
	sc.Scan()
	a, err := strconv.Atoi(sc.Text())
	if err != nil {
		fmt.Println(err)
	}
	return a
}
func scanText() string {
	sc.Scan()
	return sc.Text()
}
func main() {
	sc.Split(bufio.ScanWords)

	N := scanInt()

	var (
		ACi  int
		WAi  int
		TLEi int
		REi  int
	)
	for i := 0; i < N; i++ {
		str := scanText()
		switch str {
		case "AC":
			ACi++
		case "WA":
			WAi++
		case "TLE":
			TLEi++
		default:
			REi++
		}
	}
	fmt.Printf("AC x %v\n", ACi)
	fmt.Printf("WA x %v\n", WAi)
	fmt.Printf("TLE x %v\n", TLEi)
	fmt.Printf("RE x %v\n", REi)
}


package main

import "fmt"

func main() {
  var n int
  _, err := fmt.Scanf("%d", &n)
  if err != nil {
    panic("error")
  }

  s := map[string]int{
    "AC":  0,
    "WA":  0,
    "TLE": 0,
    "RE":  0,
  }

  for i := 0; i < n; i++ {
    var cs string
    _, err := fmt.Scanf("%s", &cs)
    if err != nil {
      panic("error2")
    }
    if cs == "AC" {
      s["AC"] = s["AC"] + 1
    } else if cs == "WA" {
      s["WA"] = s["WA"] + 1
    } else if cs == "TLE" {
      s["TLE"] = s["TLE"] + 1
    } else if cs == "RE" {
      s["RE"] = s["RE"] + 1
    }
  }

  fmt.Printf("AC x %d\n", s["AC"])
  fmt.Printf("WA x %d\n", s["WA"])
  fmt.Printf("TLE x %d\n", s["TLE"])
  fmt.Printf("RE x %d\n", s["RE"])
}
~


AC
package main

import "fmt"

func main() {
  var n int
  _, err := fmt.Scanf("%d", &n)
  if err != nil {
    panic("error")
  }

  s := map[string]int{
    "AC":  0,
    "WA":  0,
    "TLE": 0,
    "RE":  0,
  }

  for i := 0; i < n; i++ {
    var cs string
    _, err := fmt.Scanf("%s", &cs)
    if err != nil {
      panic("error2")
    }
    if cs == "AC" {
      s["AC"] = s["AC"] + 1
    } else if cs == "WA" {
      s["WA"] = s["WA"] + 1
    } else if cs == "TLE" {
      s["TLE"] = s["TLE"] + 1
    } else if cs == "RE" {
      s["RE"] = s["RE"] + 1
    }
  }

  fmt.Printf("AC x %d\n", s["AC"])
  fmt.Printf("WA x %d\n", s["WA"])
  fmt.Printf("TLE x %d\n", s["TLE"])
  fmt.Printf("RE x %d\n", s["RE"])
}


h=$<.tally
%w(AC WA TLE RE).map{puts"#{_1} x #{h[_1+?\n]||0}"}


gets
S = $<.read.split.tally
%w(AC WA TLE RE).each {|c| puts "#{c} x #{S[c]||0}"}


gets
h = $<.tally
["AC\n", "WA\n", "TLE\n", "RE\n"].each{|k|
	puts"#{k.chomp} x #{h[k]||0}"
}


n = gets.to_i
i = 0
s = []

while i < n
  s << gets
  i += 1
end

ac = s.count("AC")
wa = s.count("WA")
tle = s.count("TLE")
re = s.count("RE")

puts "AC x #{ac}"
puts "WA x #{wa}"
puts "TLE x #{tle}"
puts "RE x #{re}"


n = gets.chomp.to_i
#p n
s = readlines.map(&:chomp)
#p s
ac = 0
wa = 0
tle = 0
re = 0
n.times{ |i|
	if s[i] == 'AC'
		ac += 1
	elsif s[i] == 'WA'
		wa +=1
	elsif s[i] == 'TLE'
		tle += 1
	elsif s[i] == 'RE'
		re += 1
	end
}
p "AC x #{ac}"
p "WA x #{wa}"
p "TLE x #{tle}"
p "RE x #{re}"


a={}
%w!AC WA TLE RE!.map{a[-1]=0}
gets.to_i{
  a[gets.chomp]+=1
  }

%w!AC WA TLE RE!.each do |n|
  puts "#{n} × #{a[n]}"
end


#[allow(unused_macros)]
macro_rules! my_write {
  ($writer:expr, $args:expr) => {
    $writer.write($args).unwrap()
  };
  ($writer:expr, $($args:expr),*) => {
    {
      let mut buf = Vec::new();
      $(buf.write($args).unwrap();)*
      $writer.write(&buf).unwrap()
    }
  };
}

use std::io::{ stdin, stdout, Write };

#[inline(always)]
fn abc173_b() {
  let stdin  = stdin();
  let stdout = stdout();
  let mut scanner = my::Scanner::with_capacity(12, stdin.lock());
  let mut writer  = stdout.lock();
  let mut itoa    = my::ItoA::with_capacity(10);

  let n = my::atoi::<usize>(scanner.read_until(my::LF));
  let mut vec = Vec::with_capacity(4);
  vec.resize(4, 0);

  scanner.for_each(n, my::LF, | s | {
    match s[0] {
      b'A' => vec[0] += 1,
      b'W' => vec[1] += 1,
      b'T' => vec[2] += 1,
      _    => vec[3] += 1,
    }
  });

  my_write!(writer,
    b"AC x ",  itoa.from_usize(vec[0]), b"\n",
    b"WA x ",  itoa.from_usize(vec[1]), b"\n",
    b"TLE x ", itoa.from_usize(vec[2]), b"\n",
    b"RE x ",  itoa.from_usize(vec[3]), b"\n");
  writer.flush().unwrap();
}

fn main() {
  abc173_b();
}

//------------------------------------------------------------------------
mod my {
  use std::ops::{ Add, Sub, Mul };

  #[allow(dead_code)]
  pub const SP: u8 = b' ';
  #[allow(dead_code)]
  pub const LF: u8 = b'\n';

  //----------------------------------------------------------------------
  #[allow(dead_code)]
  pub fn atoi<T>(s: &[u8]) -> T
    where T: Add<Output=T> +
             Sub<Output=T> +
             Mul<Output=T> +
             Default +
             From<u8> +
             ::std::fmt::Debug
  {
    let mut n = T::default();

    if s.is_empty() {
      return n;
    }

    match s[0] {
      b'+' => for b in &s[1..] { n = (n * T::from(10)) + T::from(b - b'0'); },
      b'-' => for b in &s[1..] { n = (n * T::from(10)) - T::from(b - b'0'); },
      _    => for b in &s[0..] { n = (n * T::from(10)) + T::from(b - b'0'); },
    }

    n
  }

  //----------------------------------------------------------------------
  macro_rules! pub_fn_ItoA_from_ty {
    ($($name:ident => $_type:ty),*) => {$(
      #[allow(dead_code)]
      #[allow(unused_comparisons)]
      #[inline(always)]
      pub fn $name(&mut self, mut n: $_type) -> &[u8] {
        self.buf.clear();
        if n == 0 {
          self.buf.push(b'0');
          return self.buf.as_slice();
        }

        let mut is_negative = false;
        if n < 0 {
          is_negative = true;
          n = !n + 1;
        }

        while n > 0 {
          self.buf.push((n % 10) as u8 + b'0');
          n /= 10;
        }
        if is_negative {
          self.buf.push(b'-');
        }
        self.buf.reverse();
        self.buf.as_slice()
      }
    )*};
  }

  #[derive(Debug)]
  pub struct ItoA {
    buf: Vec<u8>,
  }

  impl ItoA {
    #[allow(dead_code)]
    #[inline(always)]
    pub fn with_capacity(cap: usize) -> Self {
      ItoA {
        buf: Vec::with_capacity(cap),
      }
    }

    pub_fn_ItoA_from_ty!(
      from_usize => usize,
      from_u8    => u8,
      from_u16   => u16,
      from_u32   => u32,
      from_u64   => u64,
      from_isize => isize,
      from_i8    => i8,
      from_i16   => i16,
      from_i32   => i32,
      from_i64   => i64
    );
  } // impl ItoA

  //----------------------------------------------------------------------
  #[derive(Debug)]
  pub struct Scanner<R> {
    reader: R,
    buf   : Vec<u8>,
  }

  impl<R> Scanner<R>
    where R: ::std::io::BufRead
  {
    #[allow(dead_code)]
    #[inline(always)]
    pub fn with_capacity(cap: usize, reader: R) -> Self {
      Scanner {
        reader: reader,
        buf   : Vec::with_capacity(cap),
      }
    }

    #[allow(dead_code)]
    #[inline(always)]
    pub fn read_until(&mut self, delim: u8) -> &[u8] {
      self.buf.clear();
      let mut len = self.reader.read_until(delim, &mut self.buf).unwrap();
      if len == 0 {
        return self.buf.as_slice();
      }

      len -= 1;
      if self.buf[len] == delim {
        self.buf.truncate(len);
      }
      self.buf.as_slice()
    }

    #[allow(dead_code)]
    #[inline(always)]
    pub fn for_each<F>(&mut self, n: usize, delim: u8, mut func: F)
      where F: FnMut(&[u8])
    {
      for _ in 0..n - 1 {
        func(self.read_until(delim));
      }
      func(self.read_until(LF))
    }

    #[allow(dead_code)]
    #[inline(always)]
    pub fn fold<B, F>(&mut self, n: usize, delim: u8, mut init: B, mut func: F) -> B
      where F: FnMut(B, &[u8]) -> B
    {
      for _ in 0..n - 1 {
        init = func(init, self.read_until(delim));
      }
      func(init, self.read_until(LF))
    }
  } // impl<R> Scanner<R>

} // mod my


use std::io::*;
use utils::*;

pub fn main() {
    let i = stdin();
    let mut o = Vec::new();
    run(i.lock(), &mut o).unwrap();
    stdout().write_all(&o).unwrap();
}

pub fn run(i: impl BufRead, o: &mut impl Write) -> std::io::Result<()> {
    let mut i = CpReader::new(i);
    let n = i.read::<usize>();
    let (mut ac, mut wa, mut tle, mut re) = (0, 0, 0, 0);
    for _ in 0..n {
        match i.read_line_str() {
            "AC" => ac += 1,
            "WA" => wa += 1,
            "TLE" => tle += 1,
            "RE" => re += 1,
            _ => unreachable!(),
        }
    }
    writeln!(o, "AC x {}", ac)?;
    writeln!(o, "WA x {}", wa)?;
    writeln!(o, "TLE x {}", tle)?;
    writeln!(o, "RE x {}", re)?;
    Ok(())
}

pub mod utils {
    use super::*;

    pub struct CpReader<R: BufRead> {
        r: R,
        b: Vec<u8>,
    }
    impl<R: BufRead> CpReader<R> {
        pub fn new(r: R) -> Self {
            CpReader {
                r: r,
                b: Vec::new(),
            }
        }
        pub fn read_word(&mut self) -> &[u8] {
            self.b.clear();
            let mut consume = 0;
            loop {
                self.r.consume(consume);
                let b = self.r.fill_buf().unwrap();
                assert!(b.len() != 0);
                if let Some(p) = b.iter().position(|&x| x == b' ' || x == b'\n') {
                    self.b.extend_from_slice(&b[..p]);
                    consume = p + 1;
                    break;
                }
                self.b.extend_from_slice(b);
                consume = b.len();
            }
            self.r.consume(consume);
            &self.b
        }
        pub fn read_word_str(&mut self) -> &str {
            unsafe { std::str::from_utf8_unchecked(self.read_word()) }
        }

        pub fn read_line(&mut self) -> &[u8] {
            self.b.clear();
            self.r.read_until(b'\n', &mut self.b).unwrap();
            if self.b.last() == Some(&b'\n') {
                &self.b[..self.b.len() - 1]
            } else {
                &self.b
            }
        }
        pub fn read_line_str(&mut self) -> &str {
            unsafe { std::str::from_utf8_unchecked(self.read_line()) }
        }

        pub fn read<T: CpIn>(&mut self) -> T {
            T::read_from(self)
        }

        pub fn read_vec<T: CpIn>(&mut self, n: usize) -> Vec<T> {
            (0..n).map(|_| self.read()).collect()
        }
        pub fn read_iter<'a, T: CpIn>(&'a mut self, n: usize) -> CpIter<'a, R, T> {
            CpIter {
                r: self,
                n: n,
                _pd: Default::default(),
            }
        }
    }
    pub struct CpIter<'a, R: BufRead + 'a, T> {
        r: &'a mut CpReader<R>,
        n: usize,
        _pd: std::marker::PhantomData<fn() -> T>,
    }
    impl<'a, R: BufRead, T: CpIn> Iterator for CpIter<'a, R, T> {
        type Item = T;
        fn next(&mut self) -> Option<T> {
            if self.n == 0 {
                None
            } else {
                self.n -= 1;
                Some(self.r.read())
            }
        }
    }

    pub trait CpIn {
        fn read_from<R: BufRead>(r: &mut CpReader<R>) -> Self;
    }

    impl CpIn for u64 {
        fn read_from<R: BufRead>(r: &mut CpReader<R>) -> Self {
            read_u64_fast(&mut r.r)
        }
    }
    impl CpIn for i64 {
        fn read_from<R: BufRead>(r: &mut CpReader<R>) -> Self {
            read_i64_fast(&mut r.r)
        }
    }
    impl CpIn for char {
        fn read_from<R: BufRead>(r: &mut CpReader<R>) -> Self {
            let b = r.r.fill_buf().unwrap()[0] as char;
            r.r.consume(1);
            let s = r.r.fill_buf().unwrap()[0];
            assert!(s == b' ' || s == b'\n');
            r.r.consume(1);
            b
        }
    }

    macro_rules! cpin_tuple {
        ($($t:ident),*) => {
            impl<$($t: CpIn),*> CpIn for ($($t),*) {
                fn read_from<R: BufRead>(r: &mut CpReader<R>) -> Self {
                    ($($t::read_from(r)),*)
                }
            }
        };
    }

    macro_rules! cpin_cast {
        ($t_self:ty, $t_read:ty) => {
            impl CpIn for $t_self {
                fn read_from<R: BufRead>(r: &mut CpReader<R>) -> Self {
                    <$t_read>::read_from(r) as $t_self
                }
            }
        };
    }
    macro_rules! cpin_parse {
        ($t:ty) => {
            impl CpIn for $t {
                fn read_from<R: BufRead>(r: &mut CpReader<R>) -> Self {
                    r.read_word_str().parse().unwrap()
                }
            }
        };
    }
    cpin_cast!(usize, u64);
    cpin_cast!(u32, u64);
    cpin_cast!(u16, u64);
    cpin_cast!(i32, i64);
    cpin_cast!(i16, i64);
    cpin_cast!(i8, i64);

    cpin_parse!(f64);

    cpin_tuple!(T1, T2);
    cpin_tuple!(T1, T2, T3);
    cpin_tuple!(T1, T2, T3, T4);
    cpin_tuple!(T1, T2, T3, T4, T5);

    fn read_u64_fast<R: BufRead>(r: &mut R) -> u64 {
        let mut value = 0;
        loop {
            let mut idx = 0;
            let buf_len;
            {
                let buf = r.fill_buf().unwrap();
                buf_len = buf.len();
                assert!(buf_len != 0);
                while idx < buf_len && b'0' <= buf[idx] && buf[idx] <= b'9' {
                    value = value * 10 + (buf[idx] - b'0') as u64;
                    idx += 1;
                }
            }
            if idx < buf_len {
                r.consume(idx + 1);
                return value;
            }
            r.consume(idx);
        }
    }
    fn read_i64_fast<R: BufRead>(r: &mut R) -> i64 {
        let (consume, sign) = match r.fill_buf().unwrap()[0] {
            b'+' => (true, 1),
            b'-' => (true, -1),
            _ => (false, 1),
        };
        if consume {
            r.consume(1);
        }
        read_u64_fast(r) as i64 * sign
    }
}


use std::io::Read;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();

    let answer = solve(&buf);

    println!("{}", answer);
}

fn solve(input: &str) -> String {
    let mut iterator = input.split_whitespace();

    let n: usize = iterator.next().unwrap().parse().unwrap();

    let mut ac: usize = 0;
    let mut wa: usize = 0;
    let mut tle: usize = 0;
    let mut re: usize = 0;
    for _ in 0..n {
        let s = iterator.next().unwrap();
        if s == "AC" {
            ac += 1;
        } else if s == "WA" {
            wa += 1;
        } else if s == "TLE" {
            tle += 1;
        } else if s == "RE" {
            re += 1;
        }
    }

    return format!("AC x {}\nWA x {}\nTLE x {}\nRE x {}", ac, wa, tle, re);
}


#![allow(unused_imports, dead_code, unused_variables, unused_mut)]
use std::cmp;
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
use std::mem::swap;
use permutohedron::LexicalPermutation;
const INF: i32 = std::i32::MAX;
const MOD: i32 = 1e9 as i32 + 7;

struct Get<R: std::io::BufRead> {
    stdin: R,
    v: Vec<String>,
    i: usize,
}
impl<R: std::io::BufRead> Get<R> {
    pub fn new(stdin: R) -> Self {
        Get {
            stdin: stdin,
            v: Vec::new(),
            i: 0,
        }
    }
    fn split_line(&mut self) {
        self.i = 0;
        self.v.clear();
        let mut buf = String::new();
        self.stdin.read_line(&mut buf).unwrap();
        let buf = buf.trim().to_owned();
        let mut ws = buf.split_whitespace();
        loop {
            let x = ws.next();
            if x.is_none() {
                break;
            }
            let x = x.unwrap().to_owned();
            self.v.push(x);
        }
    }
    #[allow(dead_code)]
    pub fn once<T: std::str::FromStr>(&mut self) -> T {
        if self.i == self.v.len() {
            self.split_line();
        }
        let elem = &self.v[self.i];
        self.i += 1;
        elem.parse().unwrap_or_else(|_| panic!())
    }
    #[allow(dead_code)]
    pub fn line<T: std::str::FromStr>(&mut self) -> String {
        self.i = 0;
        self.v.clear();
        let mut buf = String::new();
        self.stdin.read_line(&mut buf).unwrap();
        let buf = buf.trim().to_owned();
        buf
    }
}

fn main() {
    let stdin = std::io::stdin();
    let stdin = std::io::BufReader::new(stdin.lock());
    let get = Get::new(stdin);
    solve(get);
}

fn solve<R: std::io::BufRead>(mut get: Get<R>) {
    let n: usize = get.once();
    let mut map = HashMap::new();
    map.insert("AC".to_string(), 0);
    map.insert("WA".to_string(), 0);
    map.insert("TLE".to_string(), 0);
    map.insert("RE".to_string(), 0);
    for i in 0..n {
        let s: String = get.once();
        *map.entry(s).or_insert_with(|| 0) += 1;
    }
    print!("AC\nx\n{}", map.get("AC").unwrap());
    print!("WA x {}", map.get("WA").unwrap());
    print!("TLE x {}", map.get("TLE").unwrap());
    print!("RE x {}", map.get("RE").unwrap());
}


use proconio::input;

fn main() {
    input! {
        n: usize,
        s: [String; n],
    }

    let ac = 0;
    let wa = 1;
    let tle = 2;
    let re = 3;
    let mut ans = vec![0i64; 4];
    for s_i in s {
        match s_i.as_str() {
            "AC" => ans[ac] += 1,
            "WA" => ans[wa] += 1,
            "TLE" => ans[tle] += 1,
            "RE" => ans[tle] += 1,
            _ => unreachable!(),
        }
    }

    println!("AC x {}", ans[ac]);
    println!("WA x {}", ans[wa]);
    println!("TLE x {}", ans[tle]);
    println!("RE x {}", ans[re]);
}


use proconio::input;

fn main() {
    abc173_b()
}

#[warn(dead_code)]
fn abc173_b() {
    input!(n: u16);
    let mut ac = 0;
    let mut wa = 0;
    let mut tle = 0;
    let mut re = 0;
    for _ in 1..n {
        input!(s: String);
        match &*s {
            "AC" => ac += 1,
            "WA" => wa += 1,
            "TLE" => tle += 1,
            "RE" => re += 1,
            _ => (),
        }
    }
    println!("AC x {}", ac);
    println!("WA x {}", wa);
    println!("TLE x {}", tle);
    println!("RE x {}", re);
}


func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

func main() {
    let n = Int(readLine()!)!
    var ac = 0
    var wa = 0
    var tle = 0
    var re = 0
    for _ in 0..<n {
        let s = readLine()!
        if s == "AC" {
            ac += 1
        } else if s == "WA" {
            wa += 1
        } else if s == "TLE" {
            tle += 1
        } else {
            re += 1
        }
    }
    print("AC x", ac)
    print("WA x", wa)
    print("TLE x", tle)
    print("RE x", re)
}

main()


func readInt() -> Int {
    return Int(readLine()!)!
}

func mainB() {
    let N = readInt()

    var counts = [0, 0, 0, 0]
    let results = ["AC", "WA", "TLE", "RE"]
    (0..<N).forEach { _ in
        let result = readLine()!
        counts[results.firstIndex(of: result)!] += 1
    }

    (0...3).forEach { n in
        print(results[n], "x", counts[n])
    }
}

mainB()


let N = Int(readLine()!)!
var res: [Int] = Array(repeating: 0, count: 4)

for _ in 1...N {
    let S: String = readLine()!
    if S == "AC" {
        res[0] += 1
    } else if S == "WA" {
        res[1] += 1
    } else if S == "TLE" {
        res[2] += 1
    } else {
        res[3] += 1
    }
}

print("""
AC x \(res[0])
WA x \(res[1])
TLE x \(res[2])
RE x \(res[3])
""")    // (๑•ૅㅁ•๑)


import Foundation

struct Mojiretu: Equatable {
    var characters: [Int]

    init(characters: [Int]) {

        self.characters = characters
    }
    init(_ slice: ArraySlice<Int>) {

        self.characters = Array(slice)
    }
}

extension Mojiretu {
    struct KeyCode {
        static let space = 0x20
        static let lf = 0x0A
    }

    static func readLine() -> Mojiretu {
        .init(characters:
            (0...)
                .lazy
                .map { _ in Int(getchar()) }
                .prefix { $0 != KeyCode.lf }
        )
    }

    static func readToken() -> Mojiretu {
        .init(characters:
            (0...)
                .lazy
                .map { _ in Int(getchar()) }
                .prefix { $0 != KeyCode.lf && $0 != KeyCode.space }
        )
    }

    var tokens: [Mojiretu] {
        characters
            .split { $0 == KeyCode.lf || $0 == KeyCode.space }
            .map(Mojiretu.init)
    }
}

struct MojiretuCharacterIterator: IteratorProtocol {
    private var iter: IndexingIterator<Array<Int>>

    init(_ Mojiretu: Mojiretu) {
        iter = Mojiretu.characters.makeIterator()
    }

    mutating func next() -> Character? {
        guard let i = iter.next() else { return nil }

        return Unicode.Scalar(i).map(Character.init)
    }
}

extension Mojiretu: Sequence {

    func makeIterator() -> MojiretuCharacterIterator {
        MojiretuCharacterIterator(self)
    }
}

extension Mojiretu {
    var integer: Int {
        characters
            .lazy
            .map { $0 - Int("0".utf8.first!) }
            .prefix { (0...9) ~= $0 }
            .reduce(0) { r, i in r * 10 + i }
    }

    var string: String {
        .init(
            characters
                .compactMap(Unicode.Scalar.init)
                .map(Character.init)
        )
    }
}

extension Mojiretu {

    static func == (lhs: Mojiretu, rhs: String) -> Bool {
        lhs.string == rhs
    }

    static func == (lhs: String, rhs: Mojiretu) -> Bool {
        lhs == rhs.string
    }

    static func ~= (lhs: Mojiretu, rhs: String) -> Bool {
        lhs == rhs
    }

    static func ~= (lhs: String, rhs: Mojiretu) -> Bool {
        lhs == rhs
    }
}

let n = Mojiretu.readLine().integer

let judge = (1...n)
  .map { _ in Mojiretu.readLine() }
  .reduce((0, 0, 0, 0)) { r, m in
    switch m {
      case "AC": return (r.0 + 1, r.1, r.2, r.3)
      case "WA": return (r.0, r.1 + 1, r.2, r.3)
      case "TLE": return (r.0, r.1, r.2 + 1, r.3)
      case "RE": return (r.0, r.1, r.2, r.3 + 1)
      default: return (r.0, r.1, r.2, r.3)
    }
  }

print("AC x", judge.0)
print("WA x", judge.1)
print("TEL x", judge.2)
print("RE x", judge.3)


import Foundation

struct Mojiretu: Equatable {
    var characters: [Int]

    init(characters: [Int]) {

        self.characters = characters
    }
    init(_ slice: ArraySlice<Int>) {

        self.characters = Array(slice)
    }
}

extension Mojiretu {
    struct KeyCode {
        static let space = 0x20
        static let lf = 0x0A
    }

    static func readLine() -> Mojiretu {
        .init(characters:
            (0...)
                .lazy
                .map { _ in Int(getchar()) }
                .prefix { $0 != KeyCode.lf }
        )
    }

    static func readToken() -> Mojiretu {
        .init(characters:
            (0...)
                .lazy
                .map { _ in Int(getchar()) }
                .prefix { $0 != KeyCode.lf && $0 != KeyCode.space }
        )
    }

    var tokens: [Mojiretu] {
        characters
            .split { $0 == KeyCode.lf || $0 == KeyCode.space }
            .map(Mojiretu.init)
    }
}

struct MojiretuCharacterIterator: IteratorProtocol {
    private var iter: IndexingIterator<Array<Int>>

    init(_ Mojiretu: Mojiretu) {
        iter = Mojiretu.characters.makeIterator()
    }

    mutating func next() -> Character? {
        guard let i = iter.next() else { return nil }

        return Unicode.Scalar(i).map(Character.init)
    }
}

extension Mojiretu: Sequence {

    func makeIterator() -> MojiretuCharacterIterator {
        MojiretuCharacterIterator(self)
    }
}

extension Mojiretu {
    var integer: Int {
        characters
            .lazy
            .map { $0 - Int("0".utf8.first!) }
            .prefix { (0...9) ~= $0 }
            .reduce(0) { r, i in r * 10 + i }
    }

    var string: String {
        .init(
            characters
                .compactMap(Unicode.Scalar.init)
                .map(Character.init)
        )
    }
}

extension Mojiretu {

    static func == (lhs: Mojiretu, rhs: String) -> Bool {
        lhs.string == rhs
    }

    static func == (lhs: String, rhs: Mojiretu) -> Bool {
        lhs == rhs.string
    }

    static func ~= (lhs: Mojiretu, rhs: String) -> Bool {
        lhs == rhs
    }

    static func ~= (lhs: String, rhs: Mojiretu) -> Bool {
        lhs == rhs
    }
}

let n = Mojiretu.readLine()

let judge = (1...n)
  .map { _ in Mojiretu.readLine() }
  .reduce((0, 0, 0, 0)) { r, m in
    switch m {
      case "AC": return (r.0 + 1, r.1, r.2, r.3)
      case "WA": return (r.0, r.1 + 1, r.2, r.3)
      case "TLE": return (r.0, r.1, r.2 + 1, r.3)
      case "RE": return (r.0, r.1, r.2, r.3 + 1)
      default: return (r.0, r.1, r.2, r.3)
    }
  }

print("AC x", judge.0)
print("WA x", judge.1)
print("TEL x", judge.2)
print("RE x", judge.3)


import Foundation

extension String {
    func wordsMap<T>(_ f: (Substring) -> T?) -> [T] {
        return self.split(separator: " ").compactMap(f)
    }
}

private func readWords<T>(_ f: (Substring) -> T?) -> [T] {
    return readLine()!.wordsMap(f)
}

extension Optional {
    func pleaseAC(){
        print(self!)
    }
}

readLine().map { line -> Any in
    let n = Int(line)!
    var ans = [String:Int]()

    for _ in 1...n {
        let s = readLine()!
        ans[s, default: 0] += 1
    }

    for s in ["AC","WA","TLE","RE"] {
        print("\(s) x　\(ans[s] ?? 0)")
    }

    return ""
}
.pleaseAC()


{
  const run = (input: string) => {
    const split = input.trim().split("\n")
    const n = parseInt(split[0])

    let ac = 0
    let wa = 0
    let tle = 0
    let re = 0
    for (let i = 1; i <= n; i++) {
      if (split[i] === 'AC') {
        ac++
      } else if (split[i] === 'WA') {
        wa++
      } else if (split[i] === 'TLE') {
        tle++
      } else if (split[i] === 'RE') {
        re++
      }
    }

    return `AC x ${ac}
WA x ${wa}
TLE x ${tle}
RE x ${re}`
  }

  const Main = (input: string) => {
    console.log(run(input))
  };

  Main(require("fs").readFileSync("/dev/stdin", "utf8"));
}


import * as fs from 'fs';

// main
function main(input: string[]) {
    // param
    var n: number;
    var sn: string[];
    var ans_ac: number = 0;
    var ans_wa: number = 0;
    var ans_tle: number = 0;
    var ans_re: number = 0;
    // init
    n = Number(input.shift());
    sn = input;
    // solve
    for (var snx=0; snx < sn.length; snx++) {
        if (sn[snx] == "AC") ans_ac ++;
        else if (sn[snx] == "WA") ans_wa ++;
        else if (sn[snx] == "TLE") ans_tle ++;
        else if (sn[snx] == "RE") ans_re ++;
    }
    // answer
    console.log(`AC x ${ans_ac}`);
    console.log(`WA x ${ans_wa}`);
    console.log(`TLE x ${ans_tle}`);
    console.log(`RE x ${ans_re}`);
}

// graph lib
/*
function GRAPH_enumPattern(cur: number[], pat: number[][]): number[][] {
    var arr = [];
    for (var patx = 0; patx < pat.length; patx++) {
        var pos = [cur[0] + pat[patx][0], cur[1] + pat[patx][1]];
        arr.push(pos);
    }
    return arr;
}
*/

// math lib
/*
function Math_max(arr: number[]): number { return arr.reduce((x, y) => Math.max(x, y)); }
function Math_min(arr: number[]): number { return arr.reduce((x, y) => Math.min(x, y)); }
function Math_gcd(): number {
    var ans = arguments[0];
    var f = (a: number, b: number): number => b ? f(b, a % b) : a
    for (var i = 1; i < arguments.length; i++) {
        ans = f(ans, arguments[i]);
    }
    return ans
};
function Math_gcdArray(values: number[]): number {
    var ans = values[0];
    var f = (a: number, b: number): number => b ? f(b, a % b) : a
    for (var i = 1; i < values.length; i++) {
        ans = f(ans, values[i]);
    }
    return ans
};
function Math_lcm(): number {
    var a = arguments
    var g = (n: number, m: number): number => m ? g(m, n % m) : n
    var l = (n: number, m: number): number => n * m / g(n, m)
    var ans = a[0]
    for (var i = 1; i < a.length; i++) {
        ans = l(ans, a[i])
    }
    return ans
}
function Math_lcmArray(values: number[]): number {
    var a = values
    var g = (n: number, m: number): number => m ? g(m, n % m) : n
    var l = (n: number, m: number): number => n * m / g(n, m)
    var ans = a[0]
    for (var i = 1; i < a.length; i++) {
        ans = l(ans, a[i])
    }
    return ans
}
function Math_primeList(value: number): number[] {
    var ans = [];
    var arr = new Array(value).fill(0);
    for (var i = 2; i < value; i++) {
        if (arr[i] == 0) {
            for (var j = i; j < value; j += i) {
                if (arr[j] == 0) arr[j] = i;
            }
        }
    }
    for (var i = 2; i < value; i++) {
        if (arr[i] == i) ans.push(i);
    }
    return ans;
}
function Math_primeFactor(p: number[], value: number): number[][] {
    var ans: number[][] = [];
    var valmax = value / 2;;
    for (var i = 0; i < p.length; i++) {
        var prime = p[i];
        if (valmax < prime) break;
        var count = 0;
        while (value % prime == 0) {
            value /= prime;
            count++;
        }
        if (count != 0) {
            ans.push([prime, count]);
        }
        if (value == 1) break;
    }
    return ans;
}
*/

// union-find lib
/*
var g_uf_root: number[];
var g_uf_count: number[];
function UF_initRoot(num: number) {
    g_uf_root = new Array(num).fill(-1);
    g_uf_count = new Array(num).fill(1);
}
function UF_getRoot(index: number) {
    if (g_uf_root[index] < 0) {
        return index;
    } else {
        var work0: number = UF_getRoot(g_uf_root[index]);
        g_uf_root[index] = work0;
        return work0
    }
}
function UF_mergeRoot(a: number, b: number) {
    var root0: number = UF_getRoot(a);
    var root1: number = UF_getRoot(b);
    if (root0 == root1) return;
    if (root0 > root1) [root0, root1] = [root1, root0];
    g_uf_count[root0] += g_uf_count[root1];
    g_uf_count[root1] = 0;
    g_uf_root[root1] = root0;
}
*/

// entrypoint
function entrypoint() {
    try {
        // linux
        var input = fs.readFileSync("/dev/stdin", "utf8").trim().split("\n");
        console.debug = function () { };
        main(input);
    }
    catch (ex) {
        // windows
        const lines: string[] = [];
        // @ts-ignore
        const reader = require('readline').createInterface({
            // @ts-ignore
            input: process.stdin,
            // @ts-ignore
            output: process.stdout
        });
        reader.on('line', function (line: string) {
            lines.push(line);
        });
        reader.on('close', function () {
            input = lines;
            main(input);
        });
    }
}
entrypoint();


"use strict";
const Main = (input) =>{
   let xs = input.trim().split('\n');
   let N = parseInt(xs[0]);
   let AC = 0;
   let TLE = 0;
   let WA = 0;
   let RE = 0;
   for(let i=0; i<=N; i++){
     let tmp = xs[i];
     if(tmp=='TLE'){
       TLE++;
     }else if(tmp=='AC'){
       AC++;
     }else if(tmp=='WA'){
       WA++;
     }else if(tmp=='RE'){
       RE++;
     }
   }
   console.log('AC x '+AC);
   console.log('WA x '+WA);
   console.log('TLE x '+TLE);
   console.log('RE x '+RE);
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));


import * as fs from "fs"
const inp:string[] = fs.readFileSync('/dev/stdin', 'utf8').trim().split('\n')
export const res = (inp) =>{

    interface obj {
        AC: number,
        WA: number,
        TLE: number,
        RE: number
    }

    let obj:obj = {
        AC: 0,
        WA: 0,
        TLE: 0,
        RE: 0
    }
    inp.shift()
    for (let element of inp){
        if (element === 'AC'){
            obj.AC += 1
        } else if (element === 'WA'){
            obj.WA += 1
        } else if (element === 'TLE'){
            obj.TLE += 1
        } else if (element === 'RE'){
            obj.RE += 1
        }
    }
    console.log(`AC × ${obj.AC}\nWA × ${obj.WA}\nTLE × ${obj.TLE}\nRE × ${obj.RE}`)
}
res(inp)


import * as fs from "fs"
const inp:string[] = fs.readFileSync('/dev/stdin', 'utf8').trim().split('\n')

interface obj {
    AC: number,
    WA: number,
    TLE: number,
    RE: number
}

let obj:obj = {
    AC: 0,
    WA: 0,
    TLE: 0,
    RE: 0
}

inp.shift()
for (let element of inp){
    if (element === 'AC'){
        obj.AC += 1
    } else if (element === 'WA'){
        obj.WA += 1
    } else if (element === 'TLE'){
        obj.TLE += 1
    } else if (element === 'RE'){
        obj.RE += 1
    }
}
console.log(`AC × ${obj.AC}`)
console.log(`WA × ${obj.WA}`)
console.log(`TLE × ${obj.TLE}`)
console.log(`RE × ${obj.RE}`)


# ABC109C - Skip
def gcd(a: int, b: int) -> int:
    while a:
        a, b = b % a, a
    return b

def main():
    N, X, *A = map(int, open(0).read().split())
    ans = abs(X - A[0])
    for i in A:
        dif = abs(X - i)
        if dif % ans:
            ans = gcd(ans, dif)
    print(ans)

if __name__ == "__main__":
    main()


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def main():
    N, X, *xn = map(int, open(0).read().split())
    ans = abs(X - xn[0])
    for x in xn:
        div = abs(X - x)
        if div % ans:
            ans = gcd(ans, div)
    print(ans)
    return

main()


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def main():
    N, X, *xn = map(int, open(0).read().split())
    ans = None
    for x in xn:
        if ans is None:
            ans = abs(X - xn[0])
        elif abs(X - x) % ans:
            ans = gcd(ans, abs(X - x))
    print(ans)
    return

main()


import math
N, X = [int(i) for i in input().split()]
x = [int(i) for i in input().split()]
x.append(X)
x.sort()

xdst = [x[i+1] - x[i] for i in range(N)]
print(xdst)

ans = 10**10
if len(xdst) == 1:
    #print(xdst[0])
    exit()

for i in range(N-1):
    ans = min(math.gcd(xdst[i], xdst[i+1]),ans)
print(ans)


n,x=map(int, input().split())
x_list=[int(i) for i in input().split()]

x_list.append(x)
x_list.sort()
sa=[]
for i in range(n):
    sa.append(x_list[i+1]-x_list[i])

print(min(sa))


from math import gcd
n, x = map(int, input().split())
ls = sorted(list(map(int, input().split())))
if x == 1:
    print(abs(x-ls[0]))
    exit()
distant = []
for i in range(n):
    diff = abs(ls[i]-x)
    distant.append(diff)
distant.sort()
a = distant[0]
for i in distant:
    g = gcd(a, i)
print(g)


import java.io.*;
import java.util.*;

class Main {
    public static void main(String args[]) throws IOException {
        Scan sc = new Scan();
        int n = sc.scanInt();
        long x = sc.scanLong();
        long g = 0;
        for(int i = 0; i < n; ++i){
            long curr = sc.scanLong();
            g = gcd(g, Math.abs(curr-x));
        }
        System.out.println(g);
    }

    static long gcd(long a, long b){
        if(b == 0)
            return a;
        return gcd(b, a%b);
    }
}

class Scan
{
    private byte[] buf=new byte[1024];
    private int index;
    private InputStream in;
    private int total;
    public Scan()
    {
        in=System.in;
    }
    public int scan()throws IOException
    {
        if(total<0)
        throw new InputMismatchException();
        if(index>=total)
        {
            index=0;
            total=in.read(buf);
            if(total<=0)
            return -1;
        }
        return buf[index++];
    }
    public int scanInt()throws IOException
    {
        int integer=0;
        int n=scan();
        while(isWhiteSpace(n))
        n=scan();
        int neg=1;
        if(n=='-')
        {
            neg=-1;
            n=scan();
        }
        while(!isWhiteSpace(n))
        {
            if(n>='0'&&n<='9')
            {
                integer*=10;
                integer+=n-'0';
                n=scan();
            }
            else throw new InputMismatchException();
        }
        return neg*integer;
    }
    public long scanLong() throws IOException {
        long integer=0;
        int n=scan();
        while(isWhiteSpace(n))
        n=scan();
        int neg=1;
        if(n=='-')
        {
            neg=-1;
            n=scan();
        }
        while(!isWhiteSpace(n))
        {
            if(n>='0'&&n<='9')
            {
                integer*=10;
                integer+=n-'0';
                n=scan();
            }
            else throw new InputMismatchException();
        }
        return neg*integer;
    }
    public double scanDouble()throws IOException
    {
        double doub=0;
        int n=scan();
        while(isWhiteSpace(n))
        n=scan();
        int neg=1;
        if(n=='-')
        {
            neg=-1;
            n=scan();
        }
        while(!isWhiteSpace(n)&&n!='.')
        {
            if(n>='0'&&n<='9')
            {
                doub*=10;
                doub+=n-'0';
                n=scan();
            }
            else throw new InputMismatchException();
        }
        if(n=='.')
        {
            n=scan();
            double temp=1;
            while(!isWhiteSpace(n))
            {
                if(n>='0'&&n<='9')
                {
                    temp/=10;
                    doub+=(n-'0')*temp;
                    n=scan();
                }
                else throw new InputMismatchException();
            }
        }
        return doub*neg;
    }
    public String scanString()throws IOException
    {
        StringBuilder sb=new StringBuilder();
        int n=scan();
        while(isWhiteSpace(n))
        n=scan();
        while(!isWhiteSpace(n))
        {
            sb.append((char)n);
            n=scan();
        }
        return sb.toString();
    }
    private boolean isWhiteSpace(int n)
    {
        if(n==' '||n=='\n'||n=='\r'||n=='\t'||n==-1)
        return true;
        return false;
    }
}


import java.util.*;
import java.io.*;
import java.lang.*;
import java.math.*;

class Main implements Runnable {

	long gcd(long a,long b)
    {
    	if(a==0)
    		return b;
    	else
    		return gcd(b%a,a);
    }

	public void run(){

		InputReader in =  new InputReader(System.in);
		PrintWriter w = new PrintWriter(System.out);
		int n=in.nextInt();
		long x=in.nextLong();
		long[] a=new long[n];

		long last=0;

		for(int i=0;i<n;i++)
			a[i]=in.nextLong();

		for(int i=0;i<n;i++)
			last=gcd(last,(long)Math.abs(a[i]-x));

		w.println(last);
		w.close();
	}

	static class InputReader {

		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;
		private SpaceCharFilter filter;

		public InputReader(InputStream stream)
		{
			this.stream = stream;
		}

		public int read()
		{
			if (numChars==-1)
				throw new InputMismatchException();

			if (curChar >= numChars)
			{
				curChar = 0;
				try
				{
					numChars = stream.read(buf);
				}
				catch (IOException e)
				{
					throw new InputMismatchException();
				}

				if(numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public String nextLine()
		{
			BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
			String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
		}
		public int nextInt()
		{
			int c = read();

			while(isSpaceChar(c))
				c = read();

			int sgn = 1;

			if (c == '-')
			{
				sgn = -1;
				c = read();
			}

			int res = 0;
			do
			{
				if(c<'0'||c>'9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			while (!isSpaceChar(c));

			return res * sgn;
		}

		public long nextLong()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-')
			{
				sgn = -1;
				c = read();
			}
			long res = 0;

			do
			{
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			while (!isSpaceChar(c));
				return res * sgn;
		}

		public double nextDouble()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-')
			{
				sgn = -1;
				c = read();
			}
			double res = 0;
			while (!isSpaceChar(c) && c != '.')
			{
				if (c == 'e' || c == 'E')
					return res * Math.pow(10, nextInt());
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			if (c == '.')
			{
				c = read();
				double m = 1;
				while (!isSpaceChar(c))
				{
					if (c == 'e' || c == 'E')
						return res * Math.pow(10, nextInt());
					if (c < '0' || c > '9')
						throw new InputMismatchException();
					m /= 10;
					res += (c - '0') * m;
					c = read();
				}
			}
			return res * sgn;
		}

		public String readString()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do
			{
				res.appendCodePoint(c);
				c = read();
			}
			while (!isSpaceChar(c));

			return res.toString();
		}

		public boolean isSpaceChar(int c)
		{
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public String next()
		{
			return readString();
		}

		public interface SpaceCharFilter
		{
			public boolean isSpaceChar(int ch);
		}
	}

	public static void main(String args[]) throws Exception
	{
		new Thread(null, new Main(),"Main",1<<26).start();
	}
 }


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Pradyumn
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, FastReader in, PrintWriter out) {
            int n = in.nextInt();
            long x = in.nextInt();
            long[] a = in.nextLongArray(n);
            long[] diff = new long[n];
            for (int i = 0; i < n; ++i) diff[i] = Math.abs(a[i] - x);
            out.println(NT.gcdOfArray(diff));
        }

    }

    static class NT {
        public static long gcd(long a, long b) {
            a = Math.abs(a);
            b = Math.abs(b);
            while (b > 0) {
                long c = a;
                a = b;
                b = c % b;
            }
            return a;
        }

        public static long gcdOfArray(long[] a) {
            int n = a.length;
            long gcdn = a[0];
            for (int i = 1; i < n; i++) {
                gcdn = gcd(gcdn, a[i]);
            }
            return gcdn;
        }

    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar;
        private int pnumChars;

        public FastReader(InputStream stream) {
            this.stream = stream;
        }

        private int pread() {
            if (pnumChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= pnumChars) {
                curChar = 0;
                try {
                    pnumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (pnumChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = pread();
            while (isSpaceChar(c))
                c = pread();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = pread();
            }
            int res = 0;
            do {
                if (c == ',') {
                    c = pread();
                }
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = pread();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = pread();
            while (isSpaceChar(c))
                c = pread();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = pread();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = pread();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long[] nextLongArray(int n) {
            long[] array = new long[n];
            for (int i = 0; i < n; i++) {
                array[i] = nextLong();
            }
            return array;
        }

        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    }
}


import java.io.*;
import java.util.*;

public class Main {
	static InputReader scn = new InputReader(System.in);
	static OutputWriter out = new OutputWriter(System.out);

	public static void main(String[] args) {
		int t = 1;
		while (t-- > 0)
			solve();
		out.close();
	}

	static int mod = (int) (1e9 + 7);

	public static void solve() {
		int n = scn.nextInt();
		int x = scn.nextInt();
		int[] arr = scn.readArrays(n);
		int val = Integer.MAX_VALUE;
		for (int i = 0; i < n; i++) {
			int a = Math.abs(x - arr[i]);
			val = Math.min(val, a);
		}
		out.println(val);
	}

	public static HashMap<Integer, Integer> CountFrequencies(int[] arr) {
		HashMap<Integer, Integer> map = new HashMap<>();
		for (int i = 0; i < arr.length; i++) {
			int a = arr[i];
			if (map.containsKey(a)) {
				map.put(a, map.get(a) + 1);
			} else {
				map.put(a, 1);
			}
		}
		return map;
	}

	public static int countPrimeFactors(int n) {
		int count = 0;
		while (n % 2 == 0) {
			n = n / 2;
			count++;
		}
		for (int i = 3; i <= Math.sqrt(n); i = i + 2) {
			while (n % i == 0) {
				n = n / i;
				count++;
			}
		}
		if (n > 2)
			count++;
		return (count);
	}

	public static int max(int a, int b) {
		if (a >= b)
			return a;
		return b;
	}

	public static int min(int a, int b) {
		if (a <= b)
			return a;
		return b;
	}

	public static long gcd(long a, long b) {
		if (a == 0)
			return b;
		return gcd(b % a, a);
	}

	public static long lcm(long a, long b) {
		return (a * b) / gcd(a, b);
	}

	public static boolean isPrime(long n) {
		if (n < 2)
			return false;
		if (n == 2 || n == 3)
			return true;
		if (n % 2 == 0 || n % 3 == 0)
			return false;
		long sqrtN = (long) Math.sqrt(n) + 1;
		for (long i = 6L; i <= sqrtN; i += 6) {
			if (n % (i - 1) == 0 || n % (i) + 1 == 0)
				return false;
		}
		return true;
	}

	public static int[] SieveOfEratosthenes(int[] arr) {
		int n = arr.length;
		for (long i = 3; i < n; i = i + 2) {
			arr[(int) i] = 1;
		}
		for (long i = 3; i < n; i = i + 2) {
			if (arr[(int) i] == 1) {
				for (long j = (long) i * i; j < n; j = j + i) {
					arr[(int) j] = 0;
				}
			}
		}
		arr[2] = 1;
		arr[0] = arr[1] = 0;
		return arr;
	}

	static void sort(int[] a) {
		ArrayList<Integer> l = new ArrayList<>();
		for (int i : a) {
			l.add(i);
		}
		Collections.sort(l);
		for (int i = 0; i < a.length; i++) {
			a[i] = l.get(i);
		}
	}

	public static ArrayList<String> printPermutn(String str, String ans, ArrayList<String> list) {
		if (str.length() == 0) {
			list.add(ans);
		}
		for (int i = 0; i < str.length(); i++) {
			char ch = str.charAt(i);
			String ros = str.substring(0, i) + str.substring(i + 1);
			printPermutn(ros, ans + ch, list);
		}
		return list;
	}

	public static int binarySearch(int arr[], int l, int r, int x) {
		if (r >= l) {
			int mid = l + (r - l) / 2;
			if (arr[mid] == x)
				return mid;
			if (arr[mid] > x)
				return binarySearch(arr, l, mid - 1, x);
			return binarySearch(arr, mid + 1, r, x);
		}
		return -1;
	}

	public static int firstOccurence(int array1[], int low, int high, int x, int n) {
		if (low <= high) {
			int mid = low + (high - low) / 2;
			if ((mid == 0 || x > array1[mid - 1]) && array1[mid] == x)
				return mid;
			else if (x > array1[mid])
				return firstOccurence(array1, (mid + 1), high, x, n);
			else
				return firstOccurence(array1, low, (mid - 1), x, n);
		}
		return -1;
	}

	public static int lastOccurence(int array2[], int low, int high, int x, int n) {
		if (low <= high) {
			int mid = low + (high - low) / 2;
			if ((mid == n - 1 || x < array2[mid + 1]) && array2[mid] == x)
				return mid;
			else if (x < array2[mid])
				return lastOccurence(array2, low, (mid - 1), x, n);
			else
				return lastOccurence(array2, (mid + 1), high, x, n);
		}
		return -1;
	}

	static final Random random = new Random();

	static void ruffleSort(int[] a) {
		int n = a.length;// shuffle, then sort
		for (int i = 0; i < n; i++) {
			int oi = random.nextInt(n), temp = a[oi];
			a[oi] = a[i];
			a[i] = temp;
		}
		Arrays.sort(a);
	}

	static class InputReader {
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;
		private SpaceCharFilter filter;

		public InputReader(InputStream stream) {
			this.stream = stream;
		}

		public int[] readArrays(int n) {
			int[] arr = new int[n];
			for (int i = 0; i < n; i++) {
				arr[i] = scn.nextInt();
			}
			return arr;
		}

		public int read() {
			if (numChars == -1)
				throw new InputMismatchException();
			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public int nextInt() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public long nextLong() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public String nextLine() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public String next() {
			return nextLine();
		}

		public interface SpaceCharFilter {
			public boolean isSpaceChar(int ch);
		}
	}

	static class OutputWriter {
		private final PrintWriter writer;

		public OutputWriter(OutputStream outputStream) {
			writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
		}

		public OutputWriter(Writer writer) {
			this.writer = new PrintWriter(writer);
		}

		public void print(Object... objects) {
			for (int i = 0; i < objects.length; i++) {
				if (i != 0) {
					writer.print(' ');
					// writer.print(1);
				}
				writer.print(objects[i]);
			}
		}

		public void println(Object... objects) {
			print(objects);
			writer.println();
		}

		public void close() {
			writer.close();
		}
	}

}


import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long x = sc.nextInt();
        ArrayList<Long> list = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            list.add(sc.nextLong());
        }
        list.add(x);
        Collections.sort(list);
        ArrayList<Long> list2 = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            list2.add(list.get(i + 1) - list.get(i));
        }
        long ans = list2.get(0);
        for (int i = 1; i < list2.size() - 1; i++) {
            ans = gcd(ans, list2.get(i));
        }
        System.out.println(ans);
    }

    public static final long gcd(long a, long b) {
        if( b == 0 ) return a;
        return gcd(b, a % b);
    }
}


import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long x = sc.nextInt();
        ArrayList<Long> list = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            list.add(sc.nextLong());
        }
        list.add(x);
        Collections.sort(list);
        ArrayList<Long> list2 = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            list2.add(Math.abs(list.get(i + 1) - list.get(i)));
        }
        long ans = list2.get(0);
        for (int i = 1; i < list2.size() - 1; i++) {
            ans = gcd(ans, list2.get(i));
        }
        System.out.println(ans);
    }

    public static final long gcd(long a, long b) {
        if( b == 0 ) return a;
        return gcd(b, a % b);
    }
}


//#include<bits/stdc++.h>
#include<cstdio>
#include<algorithm>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please

const int cm = 1 << 17;
char cn[cm], * ci = cn + cm, ct;
inline char getcha() {
	if (ci - cn == cm) { fread(cn, 1, cm, stdin); ci = cn; }
	return *ci++;
}
inline int getint() {
	int A = 0;
	if (ci - cn + 16 > cm) while ((ct = getcha()) >= '0') A = A * 10 + ct - '0';
	else while ((ct = *ci++) >= '0') A = A * 10 + ct - '0';
	return A;
}

int main() {
	//cin.tie(0);
	//ios::sync_with_stdio(false);

	int N = getint(), X = getint();

	int kotae = abs(getint() - X);
	rep(i, N - 1) {
		kotae = __gcd(kotae, abs(getint() - X));
	}
	printf("%d", kotae);

	Would you please return 0;
}


#include <bits/stdc++.h>

class kin{
public:
	inline void open(FILE *,int);
	inline void close(void);
	inline void scan(void);
	inline kin &operator>(char &);
	inline kin &operator>(int &);
	inline kin &operator>(long long &);
	inline kin &operator>(double &);
	inline kin &operator>(long double &);
	inline kin &operator>(char *);
	template<class T>
	inline void get(T *,int);
private:
	FILE *fp;
	char *buf;
	int siz;
	int idx;
}in;

class kout{
public:
	inline void open(FILE *,int);
	inline void close(void);
	inline void print(void);
	inline kout &operator<(char);
	inline kout &operator<(int);
	inline kout &operator<(long long);
	inline kout &operator<(double);
	inline kout &operator<(long double);
	inline kout &operator<(const char *);
	template<class T>
	inline void put(T *,int,char,char);
private:
	FILE *fp;
	char *buf;
	int siz;
	int idx;
}out;

inline int gcd(int x,int y){
	int p=x>y?x:y,q=x<y?x:y;
	if(q==0) return p;
	int r=p%q;
	while(r){
		p=q;
		q=r;
		r=p%q;
	}
	return q;
}

int main(int argc,char **argv){
	in.open(stdin,512);
	out.open(stdout,512);
	in.scan();
	int n,s;
	in>n>s;
	int ans=0;
	for(int i=0;i<n;++i){
		int x;
		in>x;
		x=std::abs(x-s);
		ans=gcd(x,ans);
	}
	out<ans<'\n';
	out.print();
	in.close();
	out.close();
	return 0;
}

inline void kin::open(FILE *fparg,int sizarg){
	fp=fparg;
	buf=new char[sizarg];
	siz=sizarg;
	idx=0;
	return;
}
inline void kin::close(void){
	fp=nullptr;
	delete[] buf;
	buf=nullptr;
	siz=0;
	idx=0;
	return;
}
inline void kin::scan(void){
	int readsiz=(int)std::fread((void *)buf,(std::size_t)1,(std::size_t)siz,fp);
	if(readsiz!=siz) buf[readsiz]='\x00';
	idx=0;
	return;
}
inline kin &kin::operator>(char &var){
	if(!buf[idx]){
		var='\x00';
		return *this;
	}
	var=buf[idx];
	if(++idx==siz) scan();
	if(++idx==siz) scan();
	return *this;
}
inline kin &kin::operator>(int &var){
	if(!buf[idx]){
		var=0;
		return *this;
	}
	int sign=-1;
	if(buf[idx]=='-'){
		sign=1;
		if(++idx==siz) scan();
	}
	var=0;
	while(buf[idx]>='0'){
		var=var*10-(int)(buf[idx]-'0');
		if(++idx==siz) scan();
	}
	var*=sign;
	if(++idx==siz) scan();
	return *this;
}
inline kin &kin::operator>(long long &var){
	if(!buf[idx]){
		var=0LL;
		return *this;
	}
	long long sign=-1LL;
	if(buf[idx]=='-'){
		sign=1LL;
		if(++idx==siz) scan();
	};
	var=0LL;
	while(buf[idx]>='0'){
		var=var*10LL-(long long)(buf[idx]-'0');
		if(++idx==siz) scan();
	}
	var*=sign;
	if(++idx==siz) scan();
	return *this;
}
inline kin &kin::operator>(double &var){
	if(!buf[idx]){
		var=0.0;
		return *this;
	}
	double sign=-1.0;
	if(buf[idx]=='-'){
		sign=1.0;
		if(++idx==siz) scan();
	}
	var=0.0;
	while(buf[idx]>='0'){
		var=var*10.0-(double)(buf[idx]-'0');
		if(++idx==siz) scan();
	}
	if(buf[idx]=='.'){
		if(++idx==siz) scan();
		double dig=1.0;
		while(buf[idx]>='0'){
			var-=(double)(buf[idx]-'0')*(dig/=10.0);
			if(++idx==siz) scan();
		}
	}
	var*=sign;
	if(++idx==siz) scan();
	return *this;
}
inline kin &kin::operator>(long double &var){
	if(!buf[idx]){
		var=0.0L;
		return *this;
	}
	long double sign=-1.0L;
	if(buf[idx]=='-'){
		sign=1.0L;
		if(++idx==siz) scan();
	}
	var=0.0L;
	while(buf[idx]>='0'){
		var=var*10.0L-(long double)(buf[idx]-'0');
		if(++idx==siz) scan();
	}
	if(buf[idx]=='.'){
		if(++idx==siz) scan();
		long double dig=1.0L;
		while(buf[idx]>='0'){
			var-=(long double)(buf[idx]-'0')*(dig/=10.0L);
			if(++idx==siz) scan();
		}
	}
	var*=sign;
	if(++idx==siz) scan();
	return *this;
}
inline kin &kin::operator>(char *str){
	if(!buf[idx]){
		str[0]='\x00';
		return *this;
	}
	int ptr=0;
	while(buf[idx]>='!'){
		str[ptr++]=buf[idx];
		if(++idx==siz) scan();
	}
	str[ptr]='\x00';
	if(++idx==siz) scan();
	return *this;
}
template<class T>
inline void kin::get(T *arr,int num){
	for(int i=0;i<num;++i) (*this)>arr[i];
	return;
}

inline void kout::open(FILE *fparg,int sizarg){
	fp=fparg;
	buf=new char[sizarg];
	siz=sizarg;
	idx=0;
	return;
}
inline void kout::close(void){
	fp=nullptr;
	delete[] buf;
	buf=nullptr;
	siz=0;
	idx=0;
	return;
}
inline void kout::print(void){
	std::fwrite((void *)buf,(std::size_t)1,(std::size_t)idx,fp);
	idx=0;
	return;
}
inline kout &kout::operator<(char val){
	buf[idx]=val;
	if(++idx==siz) print();
	return *this;
}
inline kout &kout::operator<(int val){
	if(val<0){
		buf[idx]='-';
		if(++idx==siz) print();
	}
	else val*=-1;
	char dig[10];
	int ptr=0;
	do{
		int tmp=val/10;
		dig[ptr++]=(char)-(val-tmp*10)+'0';
		val=tmp;
	}while(val);
	while(ptr--){
		buf[idx]=dig[ptr];
		if(++idx==siz) print();
	}
	return *this;
}
inline kout &kout::operator<(long long val){
	if(val<0LL){
		buf[idx]='-';
		if(++idx==siz) print();
	}
	else val*=-1LL;
	char dig[19];
	int ptr=0;
	do{
		long long tmp=val/10LL;
		dig[ptr++]=(char)-(val-tmp*10LL)+'0';
		val=tmp;
	}while(val);
	while(ptr--){
		buf[idx]=dig[ptr];
		if(++idx==siz) print();
	}
	return *this;
}
inline kout &kout::operator<(double val){
	if(val<0.0){
		buf[idx]='-';
		if(++idx==siz) print();
	}
	else val*=-1.0;
	double dig=1.0;
	while(val/dig<=-10.0) dig*=10.0;
	int tmp;
	while(dig>=1.0){
		buf[idx]=(char)-(tmp=(int)(val/dig))+'0';
		if(++idx==siz) print();
		val-=(double)tmp*dig;
		dig/=10.0;
	}
	buf[idx]='.';
	if(++idx==siz) print();
	for(int i=0;i<12;++i){
		buf[idx]=(char)-(tmp=(int)(val/dig))+'0';
		if(++idx==siz) print();
		val-=(double)tmp*dig;
		dig/=10.0;
	}
	return *this;
}
inline kout &kout::operator<(long double val){
	if(val<0.0L){
		buf[idx]='-';
		if(++idx==siz) print();
	}
	else val*=-1.0L;
	long double dig=1.0L;
	while(val/dig<=-10.0L) dig*=10.0L;
	int tmp;
	while(dig>=1.0L){
		buf[idx]=(char)-(tmp=(int)(val/dig))+'0';
		if(++idx==siz) print();
		val-=(long double)tmp*dig;
		dig/=10.0L;
	}
	buf[idx]='.';
	if(++idx==siz) print();
	for(int i=0;i<16;++i){
		buf[idx]=(char)-(tmp=(int)(val/dig))+'0';
		if(++idx==siz) print();
		val-=(long double)tmp*dig;
		dig/=10.0L;
	}
	return *this;
}
inline kout &kout::operator<(const char *str){
	for(int i=0;str[i];++i){
		buf[idx]=str[i];
		if(++idx==siz) print();
	}
	return *this;
}
template<class T>
inline void kout::put(T *arr,int num,char dlm,char end){
	--num;
	for(int i=0;i<num;++i) (*this)<arr[i]<dlm;
	(*this)<arr[num]<end;
	return;
}


#include<bits/stdc++.h>
using namespace std;
inline void rd(int &x){
  int k, m=0;
  x=0;
  for(;;){
    k = getchar_unlocked();
    if(k=='-'){
      m=1;
      break;
    }
    if('0'<=k&&k<='9'){
      x=k-'0';
      break;
    }
  }
  for(;;){
    k = getchar_unlocked();
    if(k<'0'||k>'9'){
      break;
    }
    x=x*10+k-'0';
  }
  if(m){
    x=-x;
  }
}
inline void wt_L(char a){
  putchar_unlocked(a);
}
inline void wt_L(int x){
  char f[10];
  int m=0, s=0;
  if(x<0){
    m=1;
    x=-x;
  }
  while(x){
    f[s++]=x%10;
    x/=10;
  }
  if(!s){
    f[s++]=0;
  }
  if(m){
    putchar_unlocked('-');
  }
  while(s--){
    putchar_unlocked(f[s]+'0');
  }
}
template<class T> inline T GCD_L(T a,T b){
  T r;
  while(a){
    r=b;
    b=a;
    a=r%a;
  }
  return b;
}
int N;
int X;
int A;
int main(){
  int Lj4PdHRW, res=0;
  rd(N);
  rd(X);
  for(Lj4PdHRW=0;Lj4PdHRW<N;Lj4PdHRW++){
    rd(A);
    res =GCD_L(res, abs(X-A));
  }
  wt_L(res);
  wt_L('\n');
  return 0;
}
// cLay varsion 20190721-1

// --- original code ---
// int N, X, A;
// {
//   int res = 0;
//   rd(N,X);
//   rep(N){
//     rd(A);
//     res = gcd(res, abs(X-A));
//   }
//   wt(res);
// }


#include <bits/stdc++.h>
using namespace std;
//最大公約数
long long GCD(long long a, long long b)
{
   if (a%b == 0)
   {
       return(b);
   }
   else
   {
       return(GCD(b, a%b));
   }
}
int main(){
  long long N,X;
  cin >> N >> X;
  if(N == 1){
    long long a;
    cin >> a;
    cout << a-X << endl;
    return 0;
  }
  vector<long long>vec(N+1);
  vec[N] = X;
  for(long long i=0; i<N; i++){
    cin >> vec[i];
  }
  sort(vec.begin(),vec.end());
  long long gccd = GCD(vec[2]-vec[1],vec[1]-vec[0]);
  for(long long i=0; i<N; i++){
    gccd = GCD(gccd,vec[i+1]-vec[i]);
  }
  cout << gccd << endl;
}


#include <bits/stdc++.h>
using namespace std;
//最大公約数
long long GCD(long long a, long long b)
{
   if (a%b == 0)
   {
       return(b);
   }
   else
   {
       return(GCD(b, a%b));
   }
}
int main(){
  long long N,X;
  cin >> N >> X;
  if(N == 1){
    long long a;
    cin >> a;
    cout << a-X << endl;
    return 0;
  }
  vector<long long>vec(N+1);
  vec[N] = X;
  for(long long i=0; i<N; i++){
    cin >> vec[i];
  }
  sort(vec.begin(),vec.end());
  long long gccd = GCD(vec[1]-vec[0]);
  for(long long i=0; i<N; i++){
    gccd = GCD(gccd,vec[i+1]-vec[i];
  }
  cout << gccd << endl;
}


#include <bits/stdc++.h>
using namespace std;
#define int long long
//最大公約数
long long GCD(long long a, long long b)
{
   if (a%b == 0)
   {
       return(b);
   }
   else
   {
       return(GCD(b, a%b));
   }
}
signed main(){
  int N,X;
  cin >> N >> X;
  if(N == 1){
    int a;
    cin >> a;
    cout << a-X << endl;
    return 0;
  }
  vector<int>vec(N+1);
  vec[N] = X;
  for(int i=0; i<N; i++){
    cin >> vec[i];
  }
  sort(vec.begin(),vec.end());
  int gccd = GCD(vec[1]-vec[0]);
  for(int i=0; i<N; i++){
    gccd = GCD(gccd,vec[i+1]-vec[i];
  }
  cout << gccd << endl;
}


#include <stdio.h>
#include <stdlib.h>
#pragma GCC optimize ("O3")

inline static int gl(void){
    int x = 0;
    for(;;){
        unsigned int c = getchar_unlocked() - 48;
        if(c < 10){
            x = x*10 + c;
        }else{
            break;
        }
    }
    return x;
}

inline static int gcd(int a, int b){
    if(a==0) return b;
    if(b==0) return a;
    do{
        int t=a%b;
        a=b;
        b=t;
    }while(b!=0);
    return a;
}

int main(void){
    int n=gl(), s=gl(), g=0, t;
    for(long i=0; i<n; i++){
        t = gl();
        g=gcd(abs(t-s), g);
    }
    printf("%d\n", g);
    return 0;
}


#include <stdio.h>
#include <stdlib.h>
#pragma GCC optimize ("O3")

inline long gl(void){
    long x = 0;
    for(;;){
        unsigned int c = getchar_unlocked() - 48;
        if(c < 10){
            x = x*10 + c;
        }else{
            break;
        }
    }
    return x;
}

long gcd(long a, long b){
    if(a==0) return b;
    if(b==0) return a;
    do{
        long t=a%b;
        a=b;
        b=t;
    }while(b!=0);
    return a;
}

int main(void){
    long n=gl(), s=gl();
    long g=0;
    for(long i=0; i<n; i++){
        long t = gl();
        g=gcd(labs(t-s), g);
    }
    printf("%ld\n", g);
    return 0;
}


#include <stdio.h>
#include <stdlib.h>

inline long gl(void){
    long x = 0;
    for(;;){
        int c=getchar_unlocked();
        if('0'<= c && c <='9'){
            x = x*10 + c-'0';
        }else{
            break;
        }
    }
    return x;
}

long gcd(long a, long b){
    if(a==0) return b;
    if(b==0) return a;
    do{
        long t=a%b;
        a=b;
        b=t;
    }while(b!=0);
    return a;
}

int main(void){
    long n=gl(), s=gl();
    long g=0;
    for(long i=0; i<n; i++){
        long t = gl();
        g=gcd(labs(t-s), g);
    }
    printf("%ld\n", g);
    return 0;
}


#include<stdio.h>
#include<math.h>
int main(){
  int n,x;
  int c[n];
  scanf("%d %d",&n,&x);
  for(int i = 0;i<n;i++){
      scanf("%d",&c[i]);
  }
  int m=abs(c[0]-x);
  for(int i = 0;i<n;i++){
    if(m >= abs(c[i]-x)){
       m = abs(c[i]-x);
    }
  }
  printf("%d",m);
  return 0;
}


#include<stdio.h>
#include<math.h>
int main(){
  int n,x;
  int c[n];
  for(int i = 0;i<n;i++){
      scanf("%d",&c[i]);
  }
  int m=abs(c[0]-x);
  for(int i = 1;i<n;i++){
    if(m > abs(c[i]-x)){
       m = abs(c[i]-x);
    }
  }
  printf("%d",m);
  return 0;
}


#include<stdio.h>
#include<math.h>
int main(){
  int n,x;
  int c[n];
  for(int i = 0;i<n;i++){
      scanf("%d",&c[i]);
  }
  int m=c[0];
  for(int i = 0;i<n;i++){
    scanf("%d",&c[i]);
    if(m > abs(c[i]-x)){
       m = abs(c[i]-x);
    }
  }
  printf("%d",m);
  return 0;
}


function Main(input){
    const arr = input.split('\n');
    const X = Number(arr[0].split(' ')[1]);
    const xi = arr[1].split(' ').map(Number);
    const xi_cal = xi.map(val => Math.abs(val-X));
    const GCD = (n, m) => {
        if(n % m === 0) return m;
        return GCD(m, n % m);
    }
    console.log(xi_cal.reduce((a,b) =>GCD(a,b)));
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


function Main(input){
	input = input.split("\n");
	var mem = input[0].split(" ").map(Number);
	var arr = input[1].split(" ").map(Number);
	var p = Math.abs(mem[1]-arr[0]);
	for(var i=1;i<arr.length;i++){
		p = gcd(p,Math.abs(arr[i]-mem[1]))
	}
	function gcd(a, b) {
    if (b === 0){
        return a
    }
    return gcd(b, a % b)
}
console.log(p)
}Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());


console.log((args=>{
  const [[N,X],x] = args.trim().split('\n').map( r=>r.split(' ').map(v=>v|0) );
  const gcd = (a,b) => {while(a)[a,b]=[b%a,a]; return b;};
  let d = Math.abs(x[0]-X);
  for ( let i = 1; i < N; i++ ) {
    d = gcd( d, Math.abs(x[i]-X) );
  }
  return `${d}`;
})(require('fs').readFileSync('/dev/stdin', 'utf8')));


var input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
var obj = {
  "list" : input,
  "index" : 0,
  "max" : input.length,
  "next" : function(){
    if(!this.hasNext()){throw "NoSuchElementException:次に要素は無いよ";}
    var returnObj = this.list[this.index];
    this.index++;
    return returnObj;
  },
  "hasNext" : function(){return (this.index < this.max);}
}
function next(){return obj.next();}
function nextInt(){return myconv(next(),1);}
function nextStrArray(){return myconv(next(),2);}//半角スペース分割
function nextIntArray(){return myconv(next(),4);}//半角スペース + 数値化
function nextCharArray(){return myconv(next(),6);}//1文字分割
function hasNext(){return obj.hasNext();}
function myout(t){console.log(t);}//標準出力
function myerr(t){console.error(t);}//標準エラー出力
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す　1:数値へ変換
//2:半角SPで分割 4:半角SPで分割し、数値配列へ
//6:1文字で分割  7:1文字で分割し、数値配列へ
//8:半角SPで結合 9:改行で結合 0:文字なしで結合
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}
Main();
function Main(){
  var one = nextIntArray();
  var N = one[0];
  var X = one[1];
  var list = nextIntArray();
  list.push(X);
  list.sort(function(a,b){
  	return a - b;
  });
  var output = 0;
  for(var i = 1; i < N; i++){
    if(i == 0){
       output = list[i] - list[i - 1];
    }else{
       output = gcd(list[i] - list[i - 1],output);
    }
  }
  myout(output);
}
function gcd(m, n) {return n != 0 ? gcd(n, m % n) : m;}


module.exports=function(r){var t={};function e(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return r[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=r,e.c=t,e.d=function(r,t,n){e.o(r,t)||Object.defineProperty(r,t,{enumerable:!0,get:n})},e.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},e.t=function(r,t){if(1&t&&(r=e(r)),8&t)return r;if(4&t&&"object"==typeof r&&r&&r.__esModule)return r;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:r}),2&t&&"string"!=typeof r)for(var o in r)e.d(n,o,function(t){return r[t]}.bind(null,o));return n},e.n=function(r){var t=r&&r.__esModule?function(){return r.default}:function(){return r};return e.d(t,"a",t),t},e.o=function(r,t){return Object.prototype.hasOwnProperty.call(r,t)},e.p="",e(e.s=0)}([function(r,t,e){e(1)(e(2).readFileSync("/dev/stdin","UTF-8").split("\n"))},function(r,t){function e(r,t){return function(r){if(Array.isArray(r))return r}(r)||function(r,t){var e=[],n=!0,o=!1,u=void 0;try{for(var i,f=r[Symbol.iterator]();!(n=(i=f.next()).done)&&(e.push(i.value),!t||e.length!==t);n=!0);}catch(r){o=!0,u=r}finally{try{n||null==f.return||f.return()}finally{if(o)throw u}}return e}(r,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}r.exports=function(r){var t=e(r[0].split(" ").map(function(r){return Number(r)}),2),n=t[0],o=t[1],u=r[1].split(" ").map(function(r){return Number(r)});u.push(o),u.sort(function(r,t){return r-t});var f=99999999999;for(i=0;i<n;i++)u[i+1]-u[i]<f&&(f=u[i+1]-u[i]);console.log(f)}},function(r,t){r.exports=require("fs")}]);


function main(input){
  input=input.split("\n");
  var first=input[0].split(" ");
  var N=first[0];
  var X=first[1];
  var xi=input[1].split(" ");

  var areArray=[];

  for(var i=0; i<N; i++){
    var temp;
    if(xi[i]-X>0){
      temp=xi[i]-X;
    }else{
      temp=(xi[i]-X)*(-1);
    };
    areArray.push(temp);
  };
  function gcd(pororon) {
    var f = (a, b) => b ? f(b, a % b) : a
    var ans = pororon[0]
    for (var i = 1; i < arguments.length; i++) {
        ans = f(ans, arguments[i]);
    }
    return ans
}
  console.log(gcd(areArray));
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));


package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
	"strings"
)

////////////////////////////////////////
///        templates                 ///
////////////////////////////////////////

var sc = bufio.NewScanner(os.Stdin)

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

var rdr = bufio.NewReaderSize(os.Stdin, 1000000)

func readBigLine() string {
	buf := make([]byte, 0, 1000000)
	for {
		l, p, e := rdr.ReadLine()
		if e != nil {
			panic(e)
		}
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}

func strSprit(str string) []string {
	cols := strings.Split(str, " ")
	return cols
}

func parseInt(str string) int {
	n, _ := strconv.Atoi(str)
	return n
}

func intSprit(str string) []int {
	strs := strSprit(str)
	cols := make([]int, len(strs))
	for i, v := range strs {
		cols[i] = parseInt(v)
	}
	return cols
}

func bitCount(n uint) int {

	x := uint64(n)

	const m = 1<<64 - 1
	const m0 = 0x5555555555555555
	const m1 = 0x3333333333333333
	const m2 = 0x0f0f0f0f0f0f0f0f

	x = x>>1&(m0&m) + x&(m0&m)
	x = x>>2&(m1&m) + x&(m1&m)
	x = (x>>4 + x) & (m2 & m)
	x += x >> 8
	x += x >> 16
	x += x >> 32

	return int(x) & (1<<7 - 1)
}

func bitExist(n, i int) bool {
	return ((n >> uint(i)) & 1) == 1
}

func setBit(d, n int) int {
	t := 1 << uint(n)
	return d | t
}

func intAbs(n int) int {
	return int(math.Abs(float64(n)))
}

////////////////////////////////////////
///        end templates             ///
////////////////////////////////////////
func gcd(a, b int) int {
	if a < b {
		a, b = b, a
	}
	for {
		if b == 0 {
			return a
		} else {
			a, b = b, a%b
		}
	}
}

func main() {
	line := readBigLine()

	spl := intSprit(line)
	N := spl[0]
	X := spl[1]

	x := intSprit(readBigLine())

	diffs := make([]int, N)

	for i, v := range x {
		diffs[i] = intAbs(v - X)
	}

	ret := diffs[0]
	for i := 1; i < len(diffs); i++ {
		ret = gcd(ret, diffs[i])
	}

	fmt.Println(ret)
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)

	n := scanInt(sc)
	prevX := scanInt(sc)
	x := scanInt(sc)

	d := abs(prevX - x)
	prevX = x

	for i := 1; i < n; i++ {
		x = scanInt(sc)
		d = gcd(d, abs(prevX-x))
		prevX = x
		if d == 1 {
			break
		}
	}
	fmt.Println(d)
}

func abs(n int) int {
	if n < 0 {
		return n * -1
	}
	return n
}

func gcd(a, b int) int {
	if a < b {
		a, b = b, a
	}
	r := a % b
	for r > 0 {
		a = b
		b = r
		r = a % b
	}
	return b
}

func scanInt(sc *bufio.Scanner) int {
	sc.Scan()
	v, _ := strconv.Atoi(sc.Text())
	return v
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

func gcd(x, y int) int {
	for y > 0 {
		x, y = y, x%y
	}
	return x
}

func gcdMulti(xs []int) int {
	ans := xs[0]
	for i := 1; i < len(xs); i++ {
		ans = gcd(ans, xs[i])
	}
	return ans
}

func main() {
	var N, X int
	fmt.Scan(&N, &X)
	ds := make([]int, N)
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	for i := range ds {
		sc.Scan()
		t, _ := strconv.Atoi(sc.Text())
		ds[i] = abs(X - t)
	}
	fmt.Println(gcdMulti(ds))
}


package main

import (
	"fmt"
	"sort"
)

func main() {
	var n, x int
	fmt.Scan(&n, &x)
	xs := make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Scan(&xs[i])
	}

	xs = append(xs, x)
	sort.Ints(xs)

	ds := make([]int, 0)
	for i := 1; i < len(xs); i++ {
		ds = append(ds, xs[i]-xs[i-1])
	}

	ans := ds[0]
	for i := 0; i < len(ds); i++ {
		ans = gcd(ans, ds[0])
	}
	fmt.Println(ans)
}

func gcd(a, b int) int {
	if b == 0 {
		return a
	}
	return gcd(b, a%b)
}


package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"sort"
	"strconv"
)

func main() {
	N := readi()
	X := readi()
	x := make([]int, N)
	for i := 0; i < N; i++ {
		x[i] = readi()
	}
	sort.Ints(x)

	ans := abs(X - x[0])
	for i := 1; i < N; i++ {
		tmp := abs(x[i] - x[i-1])
		if tmp < ans {
			if ans%tmp == 0 {
				ans = tmp
			}
		}
	}

	fmt.Println(ans)
}

/*-------------------utilities-------------------*/

func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

func min(x, y int) int {
	if x < y {
		return x
	}
	return y
}

func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func chmin(x *int, y int) bool {
	if *x > y {
		*x = y
		return true
	}
	return false
}

func chmax(x *int, y int) bool {
	if *x < y {
		*x = y
		return true
	}
	return false
}

func gcd(a, b int) int {
	if b == 0 {
		return a
	}
	return gcd(b, a%b)
}

func lcm(a, b int) int {
	return (a * b) / gcd(a, b)
}

func permutations(arr []int) [][]int {
	var helper func([]int, int)
	res := [][]int{}

	helper = func(arr []int, n int) {
		if n == 1 {
			tmp := make([]int, len(arr))
			copy(tmp, arr)
			res = append(res, tmp)
		} else {
			for i := 0; i < n; i++ {
				helper(arr, n-1)
				if n%2 == 1 {
					tmp := arr[i]
					arr[i] = arr[n-1]
					arr[n-1] = tmp
				} else {
					tmp := arr[0]
					arr[0] = arr[n-1]
					arr[n-1] = tmp
				}
			}
		}
	}
	helper(arr, len(arr))
	return res
}

func isPrime(n int) bool {
	if n == 1 {
		return false
	}
	for i := 2; i*i <= n; i++ {
		if n%i == 0 {
			return false
		}
	}
	return true
}

func divisor(n int) (res []int) {
	for i := 1; i*i <= n; i++ {
		if n%i == 0 {
			res = append(res, i)
			if i*i != n {
				res = append(res, n/i)
			}
		}
	}
	sort.Ints(res)
	return
}

/*-------------------init-------------------*/

const (
	INF = 1000000000000000000
	MOD = 1e9 + 7
)

var (
	readString func() string
)

func init() {
	readString = newReadString(os.Stdin)
}

/*-------------------inputs-------------------*/

func readi() int {
	return int(readi64())
}

func readi64() int64 {
	i, err := strconv.ParseInt(readString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func readf() float64 {
	f, err := strconv.ParseFloat(readString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}


package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"sort"
	"strconv"
)

func main() {
	N := readi()
	X := readi()
	x := make([]int, N)
	for i := 0; i < N; i++ {
		x[i] = readi()
	}
	sort.Ints(x)

	ans := abs(X - x[0])
	for i := 1; i < N; i++ {
		tmp := abs(x[i] - x[i-1])
		if tmp < ans {
			if ans%tmp == 0 {
				ans = tmp
			} else {
				ans = 1
			}
		}
	}

	fmt.Println(ans)
}

/*-------------------utilities-------------------*/

func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

func min(x, y int) int {
	if x < y {
		return x
	}
	return y
}

func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func chmin(x *int, y int) bool {
	if *x > y {
		*x = y
		return true
	}
	return false
}

func chmax(x *int, y int) bool {
	if *x < y {
		*x = y
		return true
	}
	return false
}

func gcd(a, b int) int {
	if b == 0 {
		return a
	}
	return gcd(b, a%b)
}

func lcm(a, b int) int {
	return (a * b) / gcd(a, b)
}

func permutations(arr []int) [][]int {
	var helper func([]int, int)
	res := [][]int{}

	helper = func(arr []int, n int) {
		if n == 1 {
			tmp := make([]int, len(arr))
			copy(tmp, arr)
			res = append(res, tmp)
		} else {
			for i := 0; i < n; i++ {
				helper(arr, n-1)
				if n%2 == 1 {
					tmp := arr[i]
					arr[i] = arr[n-1]
					arr[n-1] = tmp
				} else {
					tmp := arr[0]
					arr[0] = arr[n-1]
					arr[n-1] = tmp
				}
			}
		}
	}
	helper(arr, len(arr))
	return res
}

func isPrime(n int) bool {
	if n == 1 {
		return false
	}
	for i := 2; i*i <= n; i++ {
		if n%i == 0 {
			return false
		}
	}
	return true
}

func divisor(n int) (res []int) {
	for i := 1; i*i <= n; i++ {
		if n%i == 0 {
			res = append(res, i)
			if i*i != n {
				res = append(res, n/i)
			}
		}
	}
	sort.Ints(res)
	return
}

/*-------------------init-------------------*/

const (
	INF = 1000000000000000000
	MOD = 1e9 + 7
)

var (
	readString func() string
)

func init() {
	readString = newReadString(os.Stdin)
}

/*-------------------inputs-------------------*/

func readi() int {
	return int(readi64())
}

func readi64() int64 {
	i, err := strconv.ParseInt(readString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func readf() float64 {
	f, err := strconv.ParseFloat(readString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}


_,X=gets.split.map &:to_i;p gets.split.map{|i|i.to_i-X}.inject 0,:gcd


N, X = gets.split(' ').map(&:to_i)
x = gets.split(' ').map(&:to_i)

d = (X - x[0]).abs
1.upto(N - 1) do |i|
  d = d.gcd((X - x[i]))
end

puts d


module ArrayRefinement
  refine Array do
    # 配列に対する最小公倍数
    def lcm
      self.inject(:lcm)
    end

    # 配列に対する最大公約数
    def gcd
      self.inject(:gcd)
    end
  end
end

using ArrayRefinement

def main

  n, x = gets.split.map(&:to_i)

  nums = gets.split.map do |s|
    i = s.to_i
    i - x
  end

  puts nums.gcd.abs
end

if __FILE__ == $0
  main
end


n,x=gets.split.map &:to_i
s=gets.split.map &:to_i
s.sort!
ans=x-s[0]
for i in 1...n
  ans=ans.gcd(x-s[i])
end
puts ans


n,x=gets.split.map &:to_i
s=gets.split.map &:to_i
s.sort!
ans=x-s[0]
for i in 1...n
  ans=ans.gcd(s[i]-s[i-1])
end
puts ans


N, X = gets.chomp.split().map(&:to_i)

x = []
gets.chomp.split().each do |s|
  x << (X - s.oo_i).abs
end

ans = x.shift
x.each do |i|
  ans = ans.gcd(i)
end

puts ans