Polycarpus is an amateur businessman. Recently he was surprised to find out that the market for paper scissors is completely free! Without further ado, Polycarpus decided to start producing and selling such scissors.

Polycaprus calculated that the optimal celling price for such scissors would be p bourles. However, he read somewhere that customers are attracted by prices that say something like "Special Offer! Super price 999 bourles!". So Polycarpus decided to lower the price a little if it leads to the desired effect.

Polycarpus agrees to lower the price by no more than d bourles so that the number of nines at the end of the resulting price is maximum. If there are several ways to do it, he chooses the maximum possible price.

Note, Polycarpus counts only the trailing nines in a price.

Input

The first line contains two integers p and d (1 ≤ p ≤ 1018; 0 ≤ d < p) — the initial price of scissors and the maximum possible price reduction.

Please, do not use the %lld specifier to read or write 64-bit integers in С++. It is preferred to use cin, cout streams or the %I64d specifier.

Output

Print the required price — the maximum price that ends with the largest number of nines and that is less than p by no more than d.

The required number shouldn't have leading zeroes.

Examples

Input

1029 102


Output

999


Input

27191 17


Output

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



public class ProblemB {

	static class N implements Comparable<N> {
		public static ArrayList<N> values = new ArrayList<N>();
		public static Long p;
		public static Long d;
		
		public String valueStr;
		public Long value;
		public Integer score;
		
		public N(String v) {
			this.valueStr = v;
			
			this.score = 0;
			for (int i = v.length() - 1; i >= 0; i --) {
				if (v.charAt(i) == '9')
					this.score ++;
				else
					break;
			}
			
			if (v.length() > 0) {
				this.value = Long.parseLong(v);
				if (this.value <= p && Math.abs(p - this.value) <= d)
					values.add(this);
			}
		}
		
		@Override
		public int compareTo(N arg0) {
			if (this.score == arg0.score) {
				Long d1 = -Math.abs(p - this.value);
				Long d2 = -Math.abs(p - arg0.value);
				return d1.compareTo(d2);
			}
			return this.score.compareTo(arg0.score);
		}
		
		public String toString() {
			return this.valueStr + "(" + this.score + ")";
		}
		
	}
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);

		Long p = in.nextLong();
		Long d = in.nextLong();
		
		N.p = p;
		N.d = d;
		String p_str = p.toString();
		
		ArrayList<Long> values = new ArrayList<Long>();
		Long max_val = p;
		Long min_val = p - d;
		
		// add self
		new N(p.toString());
		
		for (int i = 0; i < max_val.toString().length(); i ++) {
			String nines = "";
			for (int j = 0; j < i; j ++) {
				nines += "9";
			}
			
			// try the nines on their own
			new N(nines);
			
			// try the nines appended to the start of the input, start of input + 1, and start of input minus 1
			String start_of_input_str = p_str.substring(0, p_str.length() - i);
			if (start_of_input_str.length() > 0) {
				Long start_of_input = Long.parseLong(start_of_input_str);
				new N(start_of_input.toString() + nines);
				new N(new Long(start_of_input - 1).toString() + nines);
			}

		}
		
		Collections.sort(N.values);
		System.out.println(N.values.get(N.values.size() - 1).value);
		
		

		/*
		
		// find number of digits p has
		long p_digits = Math.round(Math.ceil(Math.log10(p + d)));
		long digits = Math.round(Math.ceil(Math.log10(p + d)));

		// try the longest first
		for (long i = digits; i >= 0; i --) {
			long digitsNines = Math.round(Math.pow(10, i + 1) - 1);
			long final_result;
			if (i == 0) {
				double zeroFactorOfTen = Math.pow(10, digits - 1);
				long dWithZeroes = Math.round(Math.round(p / zeroFactorOfTen) * zeroFactorOfTen);
				final_result = dWithZeroes + digitsNines;
			} else if (i + 1 < p_digits) {
				double zeroFactorOfTen = Math.pow(10, digits - i);
				long dWithZeroes = Math.round(Math.round(p / zeroFactorOfTen) * zeroFactorOfTen);
				final_result = dWithZeroes + digitsNines;
				
				// also consider it by itself
				long other_final_result = digitsNines;
				if (Math.abs(other_final_result - p) <= Math.abs(final_result - p)) {
					final_result = other_final_result;
				}
				
			} else {
				final_result = digitsNines;
			}
			
			System.out.println("too far:" + final_result);
			
			if (Math.abs(final_result - p) <= d) {
				System.out.println(final_result);
				System.exit(0);
			}
		}

		System.out.println(p);
		*/
		
	}

}
