static void check_answer(long x, long ans) {
		if (is_palindrome(x)) {
			assert ans == x;
			return;
		}
		long small = x - 1;
		while (is_palindrome(small) == false) {
			--small;
		}
		long big = x + 1;
		while (is_palindrome(big) == false) {
			++big;
		}
		if (x - small > big - x) {
			assert big - x == (ans > x ? ans - x : x - ans);
		} else {
			assert x - small == (ans > x ? ans - x : x - ans);
		}
	}