/* package whatever; // don't place package name! */

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

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int x = sc.nextInt();
		
		int[] a = new int[n];
		
		for(int i=0; i<n; i++){
			a[i] = sc.nextInt();
		}
		
		int lo = -1;
		int hi = n;
		
		while(lo +1 < hi){
			int mid = lo + ( hi - lo)/2;
			if(a[mid]==x){
				System.out.println("x already exists! " + x);
				return;
			}
			if(a[mid]<x){
				lo = mid;
			} else {
				hi = mid;
			}
		}
		if(lo == -1){
			System.out.println("Only greater values exist in array! "+ a[hi]);
			return;			
		}
		if(hi == n){
			System.out.println("Only smaller values exist in array! "+ a[lo]);
			return;			
		} 
		
		int ans = (x - a[lo] < a[hi] - x) ? a[lo] : a[hi];
		System.out.println("Closest value to "+ x +" is "+ ans);
		return;
	}
}