jiahuimbzuai/CoQuIR huggingface dataset:
//  [ruby]
S = gets.chomp.split(//).map(&:to_s)
T = gets.chomp.split(//).map(&:to_s)
count = 0
S.each_with_index do |s, idx|
    count += 1 if s != T[idx]
end
puts count
//  [ruby]
S = gets.chomp.split(//)
T = gets.chomp.split(//)
count = 0
S.count.times{
  if S.shift != T.shift
    count += 1
  end
}
p count
//  [rust]
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char) 
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let s : &str = &read::<String>();  // &str型
    let t = &read::<String>();

    let mut count = 0;

    for i in 0..s.len()
    {
        eprintln!("({}): {:x}, {:x}", i, s.as_bytes()[i], t.as_bytes()[i]);

        if s.as_bytes()[i] != t.as_bytes()[i]
        {
            count+=1;
        }
    }

    println!("{}", count);
}
//  [rust]
#![allow(unused_macros)]
#![allow(dead_code)]
#![allow(unused_imports)]

use text_io::*;
use itertools::Itertools;

const U_INF: usize = 1 << 60;
const I_INF: isize = 1 << 60;

fn main() {
    let s: String = read!();
    let t: String = read!();

    let s = s.chars().collect_vec();
    let t = t.chars().collect_vec();

    let mut a = 0;
    for i in 0..s.len() {
        if s[i] != t[i] {
            a += 1;
        }
    }

    println!("{}", a)
}
//  [rust]
use text_io::*;
use std::process::exit;

fn main() {
    let a:String = read!();
    let b:String = read!();
    let mut va:Vec<char> = a.chars().collect();
    let mut vb:Vec<char> = b.chars().collect();
    let mut n:usize = 0;
    for i in 0..va.len() {
        if va[i] != vb[i] {
            n += 1;
        }
    }
    println!("{}",n);
}
//  [swift]
import Foundation

func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}
func main() {
    let S = Array(readLine()!)
    let T = Array(readLine()!)
    var ans = 0
    for i in stride(from: 0, to: S.count, by: 1){
        if S[i] != T[i]{
            ans += 1
        }
    }
    print(ans)
}
main()
//  [swift]
import Foundation

func readStr() -> [String] {
    readLine()!.map { String($0) }
}

func main(){
    let s = readStr()
    let t = readStr()
    var ans = 0
    
    for i in 0..<t.count {
        if s[i] != t[i] {
            ans += 1
        }
    }
    print(ans)
}
main()
//  [swift]
let S = readLine()!
let T = readLine()!
var times = 0
var s = Array(S)
var t = Array(T)
for i in 0..<s.count{
    if s[i] != t[i]{
        times += 1
    }
}
print(times)
//  [typescript]
import { readFileSync } from 'fs'

const zip = <T, U>(a: T[], b: U[]): [T, U][] =>
  a.map((v, i) => [v, b[i]])

function main(input: string) {
  const [s, t] = input.split('\n').map(v => v.split(''))

  const result = zip(s, t).filter(([a, b]) => a !== b)

  console.log(result.length)
}

main(readFileSync('/dev/stdin', 'utf8').trim())
//  [typescript]
import { readFileSync } from 'fs'

function main(input: string[]) {
  let ans = 0
  let s = input[0]
  let t = input[1]
  for (let i = 0; i < s.length; i++) {
    if (s[i] != t[i]) ans++
  }
  console.log(ans)
}

let lines: string[] = [];
const reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});

reader.on('line', function (line: string) {
  lines.push(line);
});
reader.on('close', function () {
  main(lines)
});
//  [typescript]
"use strict";
const Main = (input) =>{
   let xs = input.trim().split('\n');
   let S = xs[0].split('');
   let T = xs[1].split('');
   let count = 0;
   for(let i=0; i<S.length; i++){
     if(S[i]!=T[i]){
       count++
     }
   }
   console.log(count);
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));
//  [python]
# coding: utf-8
# submission # - User: herp_sy
# https://atcoder.jp/contests/
#
# lang: Python3 (3.4.3)

import math
import statistics
import numpy as np
import queue

n = int(input())
for a in range(1, 10):
  for b in range(1, 10):
    if(a * b == n):
      print('Yes')
      exit(0)
print('No')
//  [python]
import numpy as np
N = int(input())

n = np.array([[1,2,3,4,5,6,7,8,9]])
m = np.array([[1],[2],[3],[4],[5],[6],[7],[8],[9]])
l = (n*m).flatten()

if N in l:
    print("Yes")
else:
    print("No")
//  [python]
import numpy as np

n = int(input())
answer = [[i * j for j in range(1, 10)] for i in range(1, 10)]

flag = 0
for ans in answer:
  for a in ans:
    if a == n:
        flag=1
        break

if flag == 1:
    print('Yes')
else:
    print('No')
//  [java]
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		// Nの入力
		int N = sc.nextInt();
		
		// 九九の結果を格納したSetを作成
		Set<Integer> kuku = new TreeSet<>();
		for (int i = 1; i < 10; i++) {
			for (int j = 1; j < 10; j++) {
				kuku.add(i * j);
			}
		}
		
		// 結果の出力
		System.out.println(kuku.contains(N)? "Yes" : "No");
		
		sc.close();
	}

}
//  [java]
import java.util.Scanner;
import java.util.stream.Stream;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str  = sc.nextLine();
        String[] astr = str.split(" "); //状況に合わせて
        Boolean flag  = true;
        int[] in_data = Stream.of(astr).mapToInt(x->{
            try{
                return Integer.parseInt(x);
            }
            catch(Exception e){
                e.printStackTrace();
            }
            return 0;
        }).toArray();
        sc.close();
        int n = in_data[0];

        for(int i=1;i<10;i++){
            for(int j =0;j<10;j++){
                if(n == i*j){
                    System.out.println("Yes");
                    System.exit(0);
                }
            }
        }
        System.out.println("No");
    }

}
//  [java]
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {
    public static void main(String[] arg) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        if(IntStream.rangeClosed(1,9)
                .parallel()
                .filter(i->
                        IntStream.rangeClosed(1, 9)
                                .parallel()
                                .filter(j->i*j==N)
                                .findAny()
                                .isPresent()
                )
                .findAny()
                .isPresent()
        ){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
        return;
    }
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;

int main(){
  int n;
  cin >> n;
  bool res = false;
  for(int i=1; i<10; i++){
    if(n%i == 0){
      if(n/i < 10){
        cout << "Yes" << endl;
        res = true;
        break;
      }
    }
  }
  if(!res) cout << "No" << endl;
}
//  [c]
#include <stdio.h>

int main(void){
    int inp,i;
    scanf("%d",&inp);
    for(i=1;i<=9;i++)
        if((inp/i)>=1&&(inp/i)<=9)
            if(((float)inp/(float)i)-(inp/i)==0)
                break;
    if(i==10)
        printf("No");
    else
        printf("Yes");
    return 0;
}
//  [c]
#include <stdio.h>

int main()
{
 int N;
  int flag=0;
 scanf("%d",&N);
	for(int i=1;i<=9;i++)
    {
      for(int j=1;j<=9;j++)
      {
        if(i*j==N) 
        {
         flag=1;
         printf("Yes");
         break;
        }
      if(i==9&&j==9) printf("No");
      }
      if(flag==1)break;
    }
}
//  [c]
#include <stdio.h>

int main(){
  int N,c=0;
  scanf("%d",&N);
  for(int i=1;i<=9;i++){
    if(N%i==0 && N/i<=9) c=1;
  }
  if(c) printf("Yes\n");
  else printf("No\n");
  return 0;
}
//  [javascript]
module.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=0)}([function(t,e,r){"use strict";var n=r(1);r(2)(n.readFileSync("/dev/stdin","utf8"))},function(t,e){t.exports=require("fs")},function(t,e,r){"use strict";var n=r(3),i=r(5);t.exports=function(t){var e=new n(t);i(e)}},function(t,e,r){"use strict";var n=r(4);t.exports=class{constructor(t){var e=t.trim().split(/\s+/g);this.inp=new n(e)}inr(){return this.inp.deq()}in(){return parseInt(this.inp.deq(),10)}fin(){this.inp.clear()}}},function(t,e,r){"use strict";t.exports=class{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.size=t.length,this.items=t,this.ind=0}enq(t){this.size+=1,this.items.push(t)}deq(){var t=this.items[this.ind];return this.size-=1,this.ind+=1,t}clear(){this.items=[],this.size=0,this.ind=0}}},function(t,e,r){"use strict";t.exports=function(t){for(var e=t.in(),r=1;r<=9;r++)for(var n=0;n<=9;n++)if(r*n==e)return void console.log("Yes");console.log("No")}}]);
//  [javascript]

function Main(arg) {
 
    var N = arg.split("\n")[0]-0;
 
    var ans = "No";
    for (var i = 1; i <= 9; i++){
        for (var j = 1; j <= 9; j++){
            if (i * j === N) {
                ans = "Yes";
            }
        }
    }

    console.log(ans)

    return;
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
'use strict';

function answer(bool) {
  if (bool) console.log('Yes');
  else console.log('No');
}

function main(stdin) {
  const input = stdin.split(' ').map(v => parseInt(v, 10));
  const N = input[0];

  let ans = false;

  for (let i = 1; i <= 9; i++) {
    for (let j = 1; j <= 9; j++) {
      if (i * j == N) ans = true;
    }
  }

  answer(ans);
}

main(require('fs').readFileSync('/dev/stdin', 'utf8').trim());
//  [go]
package main

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

func main() {
	N := getStdinInt()

	for x := 1; x <= 9; x++ {
		for y := 1; y <= 9; y++ {
			if x*y == N {
				fmt.Printf("Yes\n")
				return
			}
		}
	}

	fmt.Printf("No\n")
}

var sc = bufio.NewReaderSize(os.Stdin, 1024*1024*10)

func getStdin() string {
	return readLine()
}
func getStdinInt() int {
	str := getStdin()
	rtn, _ := strconv.Atoi(str)
	return rtn
}
func getStdinInt2() (int, int) {
	list := getStdinIntArr()
	return list[0], list[1]
}
func getStdinInt3() (int, int, int) {
	list := getStdinIntArr()
	return list[0], list[1], list[2]
}
func getStdinInt64() int64 {
	str := getStdin()
	rtn, _ := strconv.ParseInt(str, 10, 64)
	return rtn
}
func getStdinIntU64() uint64 {
	str := getStdin()
	rtn, _ := strconv.ParseInt(str, 10, 64)
	return uint64(rtn)
}
func getStdinInt64_2() (int64, int64) {
	list := getStdinIntArr64()
	return list[0], list[1]
}
func getStdinInt64_3() (int64, int64, int64) {
	list := getStdinIntArr64()
	return list[0], list[1], list[2]
}
func getStdinIntArr() []int {
	str := getStdin()
	list := strings.Split(str, " ")
	rtn := make([]int, len(list))
	for idx, val := range list {
		rtn[idx], _ = strconv.Atoi(val)
	}
	return rtn
}
func getStdinIntArr64() []int64 {
	str := getStdin()
	list := strings.Split(str, " ")
	rtn := make([]int64, len(list))
	for idx, val := range list {
		rtn[idx], _ = strconv.ParseInt(val, 10, 64)
	}
	return rtn
}
func getStdinIntArrU64() []uint64 {
	str := getStdin()
	list := strings.Split(str, " ")
	rtn := make([]uint64, len(list))
	for idx, val := range list {
		r, _ := strconv.ParseInt(val, 10, 64)
		rtn[idx] = uint64(r)
	}
	return rtn
}
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func min64(a, b int64) int64 {
	if a < b {
		return a
	}
	return b
}
func max(a, b int) int {
	if a < b {
		return b
	}
	return a
}
func max64(a, b int64) int64 {
	if a < b {
		return b
	}
	return a
}
func abs(n int) int {
	if n < 0 {
		return -n
	}
	return n
}
func abs64(n int64) int64 {
	if n < 0 {
		return -n
	}
	return n
}
func readLine() string {
	buf := make([]byte, 0, 0)
	for {
		l, p, _ := sc.ReadLine()
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}
//  [go]
package main

import (
	"fmt"
)

func main() {

	var N int
	fmt.Scanf("%d", &N)

	var flag int = 0
	for a := 1; a <= 9; a++ {
		for b := 1; b <= 9; b++ {
			if N == a*b {
				flag = 1
			}
		}
	}

	if flag == 1 {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}

}
//  [ruby]
require 'prime'
a = gets.to_i

if a > 81
    puts "No"
else
    res = false
    [*1..9].each { |i| res = true if a % i ==0 && a / i < 10 }
    puts res ? "Yes" : "No"
end
//  [ruby]
n=gets.to_i
for i in 1..9 do
  if n % i == 0 and n / i <= 9 then
    print "Yes"
    exit()
  end
end
print "No"
//  [ruby]
n = gets.to_i
ans = "No"

(1..9).each do |i|
  ans = "Yes" if n%i == 0 && n/i <= 9
end

puts ans
//  [rust]
#[allow(dead_code)]
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}
#[allow(dead_code)]
fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}
#[allow(dead_code)]
fn read_vec2<T: std::str::FromStr>(n: u32) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}
#[allow(dead_code)]
fn yn(result: bool) {
    if result {
        println!("Yes");
    } else {
        println!("No");
    }
}

fn main() {
    let n = read::<u32>();

    for i in 1..10 {
        for j in 1..10 {
            if n == i * j {
                yn(true);
                return;
            }
        }
    }
    yn(false);
}
//  [rust]
// -*- coding:utf-8-unix -*-

use proconio::input;

fn main() {
    input! {
        n: usize,
    }
    for a in 1..10 {
        for b in 1..10 {
            if n==a*b{
                println!("Yes");
                return;
            }
        }
    }
    println!("No");
}
//  [swift]
let N = Int(readLine()!)!
var output = "No"
for i in 1...9 {
  if N % i == 0 && N / i < 10 {
    output = "Yes"
  }
}
print(output)
//  [swift]
import Foundation

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

let nk=readInts()
let n=nk[0]
var flag=0
for i in 1...9{
  for j in 1...9{if i*j==n{flag=1
                          break}}
}

if flag==1{print("Yes")}else{print("No")}
//  [swift]
let arr=readLine()!.characters.split{$0==" "}.map{Int(String($0))!}

let n : Int = arr[0]

class table99 {
  private var table: [ Int : Bool ] = [:]
  
  init () {
    for i in 1...9 {
      for j in 1...9 {
        table[ i * j ] = true
      }
    }
  }
  
  func is99able (number: Int) -> Bool {
    return table.keys.contains(number)
  }
}

let t = table99()
if( t.is99able(n) ) {
  print( "Yes" )
} else {
  print( "No" )
}
//  [typescript]
import * as fs from "fs";

const input = (fs.readFileSync("/dev/stdin", "utf8") as string).split("\n");
//const n = +input[0];
//const a = [];
//for(let i=0;i<n;i++){
//	a.push(input[i+1].split(" ").map((x:string):number=>+x));
//}

//const [n, m] = input[0].split(" ").map((x: string): number => +x);
//const a = input[1].split(" ").map((x: string): number => +x);

function compareFunc(a, b){
    return a-b;
}

const n: number = +input[0];
let ans: string = 'No';

for(let i = 1; i <10; i++){
    for(let j = 1; j < 10; j++){
        if(i*j === n){
            ans = 'Yes';
        }
    }
}
console.log(ans);
//  [typescript]
import * as fs from 'fs'

const reader = (data: string) => parseInt(data, 10)

function Main(input) {
  const N = reader(input)
  let bool = false
  for (let i = 1; i < 10; i++) {
    if (N % i === 0 && N / i <= 9) {
      bool = true
      break
    }
  }

  console.log(bool ? 'Yes' : 'No')
}

Main(fs.readFileSync('/dev/stdin', 'utf8'))
//  [typescript]
function main(p){
  'use strict'
  const num = parseInt(p.split('\n')[0], 10)
  for(let i=1; i<10; i++){
    if((num % i === 0) && (num / i <= 9)){
      console.log('Yes')
      return
    }
  }
  console.log('No')
    
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'))
//  [python]
k = int(input())

def lunlun(x):
    s = str(x)
    good = 0
    for i in range(1, len(s)):
        if abs(int(s[i - 1]) - int(s[i])) > 1:
            # what is the "digit value" of s[i]
            return 10 ** (len(s) - i - 1)
    return good

n = 1
last = 0
total = 0
while total < k:
    skip = lunlun(n)
    if skip == 0:
        last = n
        total += 1
        n += 1
    else:
        n += skip

print(last)
//  [python]
def main():
    K = int(input())
    lunlun_cnt = 0
    x = 1
    answer = 0
    while lunlun_cnt < K:
        x_is_lunlun = True
        str_x = str(x)
        length = len(str_x)
        for d in range(2, length + 1):
            # check per 2 digits
            if abs(int(str_x[d - 2]) - int(str_x[d - 1])) > 1:
                x_is_lunlun = False
                x += 10**(length - d)
                break
        if x_is_lunlun:
            lunlun_cnt += 1
            answer = x
            x += 1
    print(answer)


if __name__ == '__main__':
    main()
//  [python]
# coding: utf-8
# Your code here!
k = int(input())
l = list(range(1,10))
x = 0

while True:
    a = l.pop(0)
    x += 1
    
    if x >= k:
        print(a)
        exit()
    if k > 10000 and x > k/2:
        continue
    
    if a%10 == 0:
        b = int(str(a) + "0")
        l.append(b)
        
        b = int(str(a) + "1")
        l.append(b)
        
            
    elif a%10 == 9:
        b = int(str(a) + "8")
        l.append(b)
        
        b = int(str(a) + "9")
        l.append(b)
        
        
    else:
        b = int(str(a) + str((a%10)-1))
        l.append(b)
        
        b = int(str(a) + str(a%10))
        l.append(b)
        
        b = int(str(a) + str((a%10)+1))
        l.append(b)
        
        
        if x >= k:
            print(a)
            exit()
//  [java]
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int k = sc.nextInt();

		if ( k <= 12 ) {
			System.out.println(k);
			System.exit(0);
		}

		LinkedList<Long> ll = new LinkedList<Long>();
		for ( int i=1; i<=9; i++ ) {
			ll.add((long)i);
		}
		int ix = 0;

		while ( ll.size() < k ) {
			long li = ll.get(ix);
			long last = li%10l;
			long add0 = li*10l + last;
			if ( last!=0 ) {
				ll.addLast(add0-1l);
			}

			ll.addLast(add0);

			if ( last!=9 ) {
				ll.addLast(add0+1l);
			}

			ix++;
		}

		System.out.println(ll.get(k-1));
	}
}
//  [cpp]
#include <bits/stdc++.h>
#define rep(i, n) for(ll i = 0; i < n; i++)
#define repr(i, n) for(ll i = n; i >= 0; i--)
#define reprr(i, m, n) for (ll i = m; i < n; i++)
#define inf 2e9
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;

vll primes;

void generate_lunlun(string s) {
    if (primes.size() >= 2e6 || s.size() == 100) return;
    if (s[0] != '0') primes.push_back(stoll(s));

    ll num = s[0] - '0';
    if (num > 0) generate_lunlun(to_string(num - 1) + s);
    generate_lunlun(to_string(num) + s);
    if (num < 9) generate_lunlun(to_string(num + 1) + s);
}

int main()
{
    queue<string> q;
    ll k; cin >> k; k--;
    rep(i, 10) q.push(to_string(i));

    while (q.size()) {
        if (primes.size() > 2e6) break;
        string s = q.front(); q.pop();
        if (s[0] != '0') primes.push_back(stoll(s));

        ll num = s[0] - '0';
        if (num > 0) q.push(to_string(num - 1) + s);
        q.push(to_string(num) + s);
        if (num < 9) q.push(to_string(num + 1) + s);
    }

    sort(all(primes));
    cout << primes[k] << endl;
    return 0;
}
//  [c]
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>

/* http://oeis.org/A032981 */

int check(int64_t hoge) {
	int prev = -1;
	while (hoge > 0) {
		int cur = (int)(hoge % 10);
		hoge /= 10;
		if (prev >= 0 && abs(cur - prev) > 1) return 0;
		prev = cur;
	}
	return 1;
}

int64_t cheat[] = {
	0, INT64_C(22111101), INT64_C(76667876), INT64_C(223221112), INT64_C(434323221),
	INT64_C(566545665), INT64_C(777656545), INT64_C(1012101223), INT64_C(2101000111), INT64_C(2323212101)
};

int main(void) {
	int K;
	int64_t i = 0;
	int count = 0;
	int cnum;
	int cmax = (int)(sizeof(cheat) / sizeof(*cheat));
	if (scanf("%d", &K) != 1) return 1;
	cnum = K / 10000;
	if (cnum >= cmax) cnum = cmax - 1;
	i = cheat[cnum];
	count = cnum * 10000;
	if (K >= 79725 && K < 80000) {
		i = 2100000000;
		count = 79725;
	} else if (K >= 94829) {
		i = 3210000000;
		count = 94829;
	}
	while (count < K && ++i) {
		if (check(i)) count++;
	}
	printf("%" PRId64 "\n", i);
	return 0;
}
//  [c]
#include <float.h>
#include <inttypes.h>
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <math.h>
#ifdef __cplusplus
#include <bits/stdc++.h>
#endif

int comp(const void *a, const void *b){return (*(int*)a>*(int*)b)-(*(int*)a<*(int*)b);}
int compr(const void *a, const void *b){return (*(int*)a<*(int*)b)-(*(int*)a>*(int*)b);}

uint32_t nextpint(void){ char c=getc_unlocked(stdin); while(c<'0'||'9'<c) c=getc_unlocked(stdin); uint32_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getc_unlocked(stdin); } return x; }
uint64_t nextplong(void){ char c=getc_unlocked(stdin); while(c<'0'||'9'<c) c=getc_unlocked(stdin); uint64_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getc_unlocked(stdin); } return x; }
uint32_t nextstr(char *s){ char c=getc_unlocked(stdin); while(c==' '||c=='\n') c=getc_unlocked(stdin); uint32_t len=0; while(c!=' '&&c!='\n'){ *s++=c; len++; c=getc_unlocked(stdin); } *s='\0'; return len; }

inline int max2(const int a, const int b){return a>b?a:b;}
inline int min2(const int a, const int b){return a>b?b:a;}
inline int dif2(const int a, const int b){return a>b?a-b:b-a;}
inline int abs2(const int a){return a>=0?a:-a;}

int d[11][10];

int main(void){
	int k=nextpint();
	for(int i=0; i<=9; i++){
		d[0][i]=1;
	}
	for(int j=1; j<11; j++){
		d[j][0]=d[j-1][0]+d[j-1][1];
		for(int i=1; i<=8; i++){
			d[j][i]=d[j-1][i-1]+d[j-1][i]+d[j-1][i+1];
		}
		d[j][9]=d[j-1][8]+d[j-1][9];
	}
	int n=0;
	int f=0;
	int j, i;
	for(j=0; j<11; j++){
		for(i=1; i<=9; i++){
			n+=d[j][i];
			if(n>=k){
				n-=d[j][i];
				f=1;
				break;
			}
		}
		if(f) break;
	}
	putchar(i+'0');
	for(j--; j>=0; j--){
		k=k-n;
		n=0;
		if(i!=0){
			n+=d[j][i-1];
			if(n>=k){
				n-=d[j][i-1];
				i=i-1;
				putchar(i+'0');
				continue;
			}
		}
			n+=d[j][i];
			if(n>=k){
				n-=d[j][i];
				putchar(i+'0');
			}else{
				i++;
				putchar(i+'0');
			}
	}
	putchar(10);
}
//  [javascript]
"use strict";
function main(input) {
  const k = parseInt(input[0]);
  let i = 1;
  let runruncounter = 0;
  while(true){
    const j =  (i+"").split("").map(a => parseInt(a));
    let judge = true;

    for(let l=1;l<j.length;l++){
      //console.log(i);
      if(Math.abs(j[l]-j[l-1])>1){
        judge = false;
        if(j[l]===9){
          j[l-1]+=1;
          j[l]=0;
        }else{
          j[l]+=1;
        }
        //console.log(i +" " + j + " " + runruncounter  )
        i = parseInt(j.join(""));
        break;
      }
    }

    if(judge){
      runruncounter++;
      if(runruncounter===k){
        console.log(i);
        break;
      }
      i++;
    }
  }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split("\n"));
//  [javascript]
"use strict";
var input=require("fs").readFileSync("/dev/stdin","utf8");
var cin=input.split(/ |\n/),cid=0;
function next(a){return a?cin[cid++]:+cin[cid++];}
function nexts(n,a){return a?cin.slice(cid,cid+=n):cin.slice(cid,cid+=n).map(a=>+a);}
function nextm(h,w,a){var r=[],i=0;if(a)for(;i<h;i++)r.push(cin.slice(cid,cid+=w));else for(;i<h;i++)r.push(cin.slice(cid,cid+=w).map(a=>+a));return r;}
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill().map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill().map(x=>"+r+")";return eval(r);}

var myOut = main();
if(myOut !== undefined)console.log(myOut);

function main(){
  var k = next();
  var x = 10, ans = xArray(-1,x+1);
  ans[x] = 1;
  for(var i = 1; i < k; i++){
    if((ans[x-1] < 0 || ans[x-1] >= ans[x]) && ans[x] !== 9){
      ans[x]++;
      continue;
    }
    for(var j = x; --j;){
      if((ans[j-1] < 0 || ans[j-1] >= ans[j]) && ans[j] !== 9)break;
    }
    if(ans[j] === -1)ans[j] = 0;
    ans[j++]++;
    for(; j <= x; j++){
      if(ans[j-1])ans[j] = ans[j-1] - 1;
      else ans[j] = 0;
    }
  }
  for(var i = 0; i < x; i++)if(ans[i] === -1)ans[i] = 0;
  return +ans.join("");
}
//  [javascript]

function Main(arg) {
  var k = arg.split("\n")[0] - 0;

  if (k <= 12) {
    console.log(k);
    return;
  }

  var ans = 12;
  var answer = new Array(k+1);
  for (var i = 13; i <= k; i++) {
    ans++;
    while (1) {
      var tmp = ans.toString().split("").map(Number);
      var f = true;
      for (var j = 0; j < tmp.length-1; j++) {
        if (Math.abs(tmp[j] - tmp[j + 1]) > 1) {
          f = false;
          if (tmp[j] - tmp[j + 1] > 1) {
            tmp[j + 1]++;
          }
          else if (tmp[j] - tmp[j + 1] < -1) {
            tmp[j]++;
            tmp[j + 1] = 0;
          }
          ans = tmp.join('') - 0;
          break;
        }
      }

      if (f) {
        break;
      }
    }
    answer[i] = ans;
  }

  console.log(answer[k]);
  return;
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

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

var sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)

func scanString() string   { sc.Scan(); return sc.Text() }
func scanRunes() []rune    { return []rune(scanString()) }
func scanInt() int         { a, _ := strconv.Atoi(scanString()); return a }
func scanInt64() int64     { a, _ := strconv.ParseInt(scanString(), 10, 64); return a }
func scanFloat64() float64 { a, _ := strconv.ParseFloat(scanString(), 64); return a }

func scanInts(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = scanInt()
	}
	return res
}

func debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

//•*¨*•.¸¸♪main•*¨*•.¸¸♪(　-ω-)ノ　(　・ω・)
func main() {
	defer wr.Flush()
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 10000), 1001001)

	k := scanInt()

	arr := []int{}
	memo := map[int]bool{}

	var dfs func(num int)
	dfs = func(num int) {
		if memo[num] {
			return
		}
		arr = append(arr, num)
		memo[num] = true

		b := num % 10
		num *= 10
		if num > 1e11 {
			return
		}
		for i := 0; i < 10; i++ {
			if abs(b-i) > 1 {
				continue
			}

			dfs(num + i)
		}
	}

	for i := 1; i < 10; i++ {
		dfs(i)
	}

	sort.Ints(arr)

	fmt.Fprintln(wr, arr[k-1])
}
//  [go]
package main

import (
	"fmt"
	"strconv"
)

var queue = [][]int{}

func add(p []int) {
	n := p[len(p)-1]
	if n == 9 {
		np1 := make([]int, len(p))
		copy(np1, p)
		np2 := make([]int, len(p))
		copy(np2, p)

		np1 = append(np1, 8)
		np2 = append(np2, 9)

		queue = append(queue, np1, np2)
	} else if n == 0 {
		np1 := make([]int, len(p))
		copy(np1, p)
		np2 := make([]int, len(p))
		copy(np2, p)
		np1 = append(np1, 0)
		np2 = append(np2, 1)
		queue = append(queue, np1, np2)
	} else {
		np1 := make([]int, len(p))
		copy(np1, p)
		np2 := make([]int, len(p))
		copy(np2, p)
		np3 := make([]int, len(p))
		copy(np3, p)

		np1 = append(np1, n - 1)
		np2 = append(np2, n)
		np3 = append(np3, n + 1)
		queue = append(queue, np1, np2, np3)
	}
}

func show(p []int) {
	str := ""
	for _, e := range p {
		str += strconv.Itoa(e)
	}
	fmt.Println(str)
}

func main() {
	// Code for D - Lunlun Number
	var k int
	fmt.Scanf("%d", &k)

	for i := 1; i <= 9; i++ {
		queue = append(queue, []int{i})
	}

	for i := 1; i <= k; i++ {
		p := queue[0]
		queue = queue[1:]
		add(p)

		if i == k {
			show(p)
		}
	}
}
//  [ruby]
K=gets.to_i
table=Array.new
table << ['0','1','2','3','4','5','6','7','8','9']


10.times do |i|
  a=Array.new
  10.times do |j|
  table[-1].each do |e|
    if (e[0].to_i-j).abs <= 1
      a << "#{j.to_s}" + "#{e}"
    end
  end
end
  table << a
end

result=[]

table.each do |ar|
  ar.each do |e|
    if e[0] == '0'
      next
    else
      result << e.to_i
    end
  end
end

puts result[K-1]
//  [ruby]
K = gets.chomp.to_i

queue = []
1.upto(9) do |i|
  queue.push(i)
end

total = 0
while !queue.empty?
  n = queue.shift
  total += 1
  if total == K
    p n
    exit
  end
  last_s = n.to_s.split('').last
  ne = (n.to_s + last_s).to_i
  queue.push(ne - 1) if last_s != '0'
  queue.push(ne)
  queue.push(ne + 1) if last_s != '9'
end
//  [ruby]
K = gets.chop.to_i

arr = (1..9).to_a

def lulun(num)
  tail = num.split('')[-1]

  prev = (tail.to_i - 1).to_s
  forw = (tail.to_i + 1).to_s

  if tail == '0'
    return [(num + tail).to_i, (num + forw).to_i]
  elsif tail == '9'
    return [(num + prev).to_i, (num + tail).to_i]
  else
    return [(num + prev).to_i, (num + tail).to_i, (num + forw).to_i]
  end
end

def generate(arr1, arr2, count) # 完成した配列と更新したい配列を渡す
  tmp = [] # 新しく作った分を入れる

  arr2.each do |el|
    tmp.concat(lulun(el.to_s))
  end

  arr1.concat(tmp)

  if arr1.count > count
    return arr1
  else
    generate(arr1, tmp, count)
  end
end

luluns = generate(arr, arr, K)

puts luluns[K - 1]
//  [rust]
#[allow(unused_imports)]
use proconio::marker::*;
#[allow(unused_imports)]
use proconio::*;
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;
#[allow(unused_imports)]
use std::f64::consts::*;

fn main() {
    input! {
        k: usize,
    }
    let mut queue: VecDeque<u64> = (1..10).collect();

    for _ in 0..k - 1 {
        let x = queue.remove(0).unwrap();

        eprintln!("{}", x);
        for i in -1_i32..=1 {
            let d = (x % 10) as i32 + i;
            if d < 0 || d > 9 {
                continue;
            }
            let nx = x * 10 + d as u64;
            queue.push_back(nx);
        }
    }
    println!("{}", queue.get(0).unwrap());
}
//  [rust]
use std::collections::VecDeque;
use std::io;

fn is_lunlun_num(target_num: i64) -> bool {
    let mut is_lunlun_num: bool = true;
    let str_num: String = target_num.to_string();
    let str_num_vec: Vec<char> = str_num.chars().collect();
    let digit_num = str_num_vec.len();
    for i in 0..(digit_num - 1) {
        let now_num = str_num_vec[i] as i64;
        let next_num = str_num_vec[i + 1] as i64;
        if (now_num - next_num).abs() > 1 {
            is_lunlun_num = false;
            break;
        }
    }
    is_lunlun_num
}

fn main() {
    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    let k: i64 = buf.trim().parse().unwrap();
    let mut queue: VecDeque<i64> = VecDeque::new();

    for i in 1..10 {
        queue.push_back(i);
    }

    let mut count: i64 = 0;

    loop {
        // k番目のlunlunNumberかの判定処理
        let previous_digit_num: i64 = queue.pop_front().unwrap();
        count += 1;
        if count == k {
            println!("{}", previous_digit_num);
            break;
        }
        // lunlunNumberの追加処理
        let basic_digit: i64 = previous_digit_num * 10;
        for i in 0..10 {
            let now_num: i64 = basic_digit + i;
            if is_lunlun_num(now_num) {
                queue.push_back(now_num);
            }
        }
    }
}
//  [typescript]
import * as fs from 'fs';

const input: string = fs.readFileSync('/dev/stdin', 'utf8');
const args: string[][] = input.split('\n').map(l => l.split(' '));

const nextNumbers: number[][] = [];
for (let i = 0; i < 10; i++) {
  const tmp: number[] =
    [i + 9, i, i + 1]
      .map(x => x % 10)
      .filter(x => Math.abs(i - x) <= 1)
      .sort((x, y) => x - y);
  nextNumbers.push(tmp);
}

function getLunlun(n: number): number {
  let tmp = n - 1;
  let a: number[][] = [];
  for (let i = 1; i <= 9; i++) a.push([i]);
  if (tmp < a.length) return getNum(a[tmp])

  while (tmp >= a.length) {
    tmp -= a.length;
    let tmpArray: number[][] = [];
    a.forEach(array => {
      const nexts: number[] = nextNumbers[array[array.length - 1]];
      nexts.forEach(x => {
        let array2: number[] = [...array];
        array2.push(x);
        tmpArray.push(array2);
      })
    });
    a = tmpArray;
  }
  return getNum(a[tmp])
}

function getNum(ns: number[]): number {
  return ns.reduce((x, y) => 10 * x + y)
}

const k = parseInt(args[0][0]);
console.log(getLunlun(k));
//  [typescript]
import * as fs from 'fs';

const input: string = fs.readFileSync('/dev/stdin', 'utf8');
const args: string[][] = input.split('\n').map(l => l.split(' '));

const nextNumbers: number[][] = [];
for (let i = 0; i < 10; i++) {
  const tmp: number[] =
    [i + 9, i, i + 1]
      .map(x => x % 10)
      .filter(x => Math.abs(i - x) <= 1)
      .sort((x, y) => x - y);
  nextNumbers.push(tmp);
}

function getLunlun(n: number): number {
  let tmp = n - 1;
  let a: number[][] = [];
  for (let i = 1; i <= 9; i++) a.push([i]);
  if (tmp < a.length) return getNum(a[tmp])

  while (tmp >= a.length) {
    tmp -= a.length;
    let tmpArray: number[][] = [];
    a.forEach(array => {
      const nexts: number[] = nextNumbers[array[array.length - 1]];
      nexts.forEach(x => {
        tmpArray.push([...array, x]);
      })
    });
    a = tmpArray;
  }
  return getNum(a[tmp])
}

function getNum(ns: number[]): number {
  return ns.reduce((x, y) => 10 * x + y)
}

const k = parseInt(args[0][0]);
console.log(getLunlun(k));
//  [typescript]
import * as fs from 'fs';

const input: string = fs.readFileSync('/dev/stdin', 'utf8');
const args: string[][] = input.split('\n').map(l => l.split(' '));

const k = parseInt(args[0][0]);
console.log(getLunlun(k));

function getLunlun(n: number): number {
  function getNum(ns: number[]): number {
    return ns.reduce((x, y) => 10 * x + y)
  }

  let tmp = n - 1;
  let a: number[][] = [];
  for (let i = 1; i <= 9; i++) a.push([i]);
  if (tmp < a.length) return getNum(a[tmp])

  const nextNumbers: number[][] = [];
  for (let i = 0; i < 10; i++) {
    const tmp: number[] =
      [i + 9, i, i + 1]
        .map(x => x % 10)
        .filter(x => Math.abs(i - x) <= 1)
        .sort((x, y) => x - y);
    nextNumbers.push(tmp);
  }

  while (tmp >= a.length) {
    tmp -= a.length;
    let tmpArray: number[][] = [];
    a.forEach(array => {
      const nexts: number[] = nextNumbers[array[array.length - 1]];
      nexts.forEach(x => {
        tmpArray.push([...array, x]);
      })
    });
    a = tmpArray;
  }
  return getNum(a[tmp])
}
//  [python]
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import random
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353

S = sys.stdin.buffer.readline().decode().rstrip()


def ok1():
    N = len(S)
    s = S[:(N - 1) // 2]
    return s == s[::-1]


def ok2():
    N = len(S)
    s = S[(N + 3) // 2 - 1:]
    return s == s[::-1]


ok = True
ok &= S == S[::-1]
ok &= ok1()
ok &= ok2()
if ok:
    print('Yes')
else:
    print('No')
//  [python]
import collections
import sys
import numpy as np
sys.setrecursionlimit(1000000000)
s = input()
n = len(s)
#条件1
for i in range(n):
    if s[i] == s[n-1-i]:
        continue
    else:
        print("No")
        sys.exit()
ans1 = []
#条件2
for i in range(n//2):
    ans1.append(s[i])
for i in range(len(ans1)):
    if ans1[i] == ans1[len(ans1)-1-i]:
        continue
    else:
        print("No")
        sys.exit()
#条件3
ans2 = []
for i in range((n+3)//2-1,n):
    ans2.append(s[i])
for i in range(len(ans2)):
    if ans2[i] == ans2[len(ans2)-1-i]:
        continue
    else:
        print("No")
        sys.exit()
print("Yes")
//  [python]
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def is_ok(S):
    N = len(S)
    for i in range(N):
        if S[i]!=S[-i-1]:
            return False
    return True
def main():
    S=ST()
    N=len(S)
    a = is_ok(S[:(N-1)//2])
    b = is_ok(S[(N+3)//2-1:])
    c = is_ok(S)
    # print(S[:(N-1)//2],S[(N+3)//2-1:])
    if(a and b and c):
        print("Yes")
    else:
        print("No")
if __name__ == '__main__':
    main()
//  [java]
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.util.NoSuchElementException;
import java.io.InputStream;

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

    static class BStringPalindrome {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            String s = in.next();
            StringBuilder sb = new StringBuilder(s);
            boolean ret = true;
            if (!sb.reverse().toString().equals(s)) ret = false;
            String s2 = s.substring(0, s.length() / 2);
            StringBuilder sb2 = new StringBuilder(s2);
            if (!sb2.reverse().toString().equals(s2)) ret = false;
            String s3 = s.substring(((s.length() + 3) / 2) - 1);
            StringBuilder sb3 = new StringBuilder(s3);
            if (!sb3.reverse().toString().equals(s3)) ret = false;

            out.println(ret ? "Yes" : "No");


        }

    }

    static class Scanner {
        private final InputStream in;
        private final byte[] buffer;
        private int ptr;
        private int buflen;

        public Scanner(InputStream in) {
            this.in = in;
            this.buffer = new byte[1024];
            this.ptr = 0;
            this.buflen = 0;
        }

        private boolean hasNextByte() {
            if (ptr < buflen) return true;
            else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (buflen <= 0) return false;
            }
            return true;
        }

        private byte readByte() {
            if (hasNextByte()) return buffer[ptr++];
            return -1;
        }

        private boolean isPrintableChar(byte c) {
            return '!' <= c && c <= '~';
        }

        private void skipUnprintable() {
            while (hasNextByte() && !isPrintableChar(buffer[ptr])) {
                ptr++;
            }
        }

        public boolean hasNext() {
            skipUnprintable();
            return hasNextByte();
        }

        public String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            byte b = readByte();
            while (isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }

    }
}
//  [java]

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

/**
 * for (int i = 0; i < N; i++) {}
 * System.out.println();
 * HashMap<Integer, Integer> hm = new HashMap<>();
 * int[] s = new int[M];
 * ArrayDeque<Integer> deq = new ArrayDeque<>();
 *
 */
public class Main implements Runnable { //クラス名はMain1

	public static void main(String[] args) {
		Thread.setDefaultUncaughtExceptionHandler((t, e) -> System.exit(1));
		new Thread(null, new Main(), "", 1024 * 1024 * 1024).start(); //16MBスタックを確保して実行
	}

	public void run() {
		FastScannerMainB sc = new FastScannerMainB(System.in);

		try {
			String S = sc.nextLine().trim();
			int N = S.length();
			int hN = N / 2;

			int N1 = (N - 1) / 2;
			int N2 = (N + 3) / 2;
			//int[] a = new int[N];
			//long l = sc.nextLong();
			//ArrayList<Integer> arr = new ArrayList<Integer>();
			//for (int i = 0; i < N; i++) {}

			boolean con1 = true;
			boolean con2 = true;
			boolean con3 = true;

			for (int i = 0; i < hN; i++) {
				String s1 = S.substring(i, i + 1);
				String s2 = S.substring(N - i - 1, N - i);
				//System.out.println("s1:" + s1 + " s2:" + s2);
				if (!s1.equals(s2)) {
					con1 = false;
				}
			}

			for (int i = 0; i < N1; i++) {
				String s1 = S.substring(i, i + 1);
				String s2 = S.substring(N1 - i - 1, N1 - i);
				//System.out.println("s1:" + s1 + " s2:" + s2);
				if (!s1.equals(s2)) {
					con2 = false;
				}
			}

			int count = 0;
			for (int i = N2 - 1; i < N; i++) {
				String s1 = S.substring(i, i + 1);
				String s2 = S.substring(N - count - 1, N - count);
				//System.out.println("s1:" + s1 + " s2:" + s2);
				if (!s1.equals(s2)) {
					con3 = false;
				}
				count++;
			}

			if (con1 && con2 && con3) {
				System.out.println("Yes");
			} else {
				System.out.println("No");
			}

		} catch (Exception e) {
			e.printStackTrace();
		}

	}
}

//高速なScanner
class FastScannerMainB {
	private BufferedReader reader = null;
	private StringTokenizer tokenizer = null;

	public FastScannerMainB(InputStream in) {
		reader = new BufferedReader(new InputStreamReader(in));
		tokenizer = null;
	}

	public String next() {
		if (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(reader.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}

	public String nextLine() {
		if (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken("\n");
	}

	public long nextLong() {
		return Long.parseLong(next());
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}

	public int[] nextIntArray(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = nextInt();
		return a;
	}

	public long[] nextLongArray(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nextLong();
		return a;
	}
}
//  [cpp]
#include<bits/stdc++.h>	
typedef long long ll;
#define pb push_back
#define mod 1000000007ll
const ll maxn = 9e18;
using namespace std;
const ll maxsize = 100000009;


ll arr[maxsize];
vector<ll> v(maxsize);
map<ll, ll> m;	

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

ll lcm(ll a, ll b) {
	return  a * b / gcd(a, b);
}

bool is_palindrome(string s) {
	string t(s.rbegin(), s.rend());
	return t == s;
}
 
 
void solve() {
	string s;
	bool flag = true;
	cin >> s;
	int n = s.length();
	if(is_palindrome(s) && is_palindrome(s.substr(0, (n - 1) / 2)) && is_palindrome(s.substr((n + 1) / 2)))
	cout << "Yes" << endl;
	else cout << "No" << endl;
}


	

int main() {
	ios_base :: sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cout.precision(35);
	solve();
	return 0;
}
//  [c]
#include <stdio.h>

int is_palindrome(char s[100],int start,int end){
    int i,ans=1;
    for(i=start;i<end/2;i++){
        if(s[i] != s[end-i-1]){
            ans = 0;
            break;
        }
    }
    return ans;
}

int main(void){
    char s[100],ans=0;
    int cnt=0;
    scanf("%s",s);
    while(s[cnt] != '\0') cnt++;

    if(is_palindrome(s,0,cnt)){
        if(is_palindrome(s,0,(cnt-1)/2)){
            if(is_palindrome(s,(cnt+3)/2,cnt)){
                ans = 1;
            }
        }
    }

    if(ans == 1){
        printf("Yes\n");
    }else{
        printf("No\n");
    }

    return 0;
}
//  [c]
#include<stdio.h>
#include<string.h>
int main()
{
  char str[100];
  gets(str);
  int l=strlen(str);
  int count =0;
  int yes=0;
  for(int i=0;i<l/2;i++) // 0 1 2 3 4 5 6
  {
      if(str[i]!=str[l-1-i])
      {
          count++;
      }
  }
  if(count==0)
  {
      yes++;
  }
  count =0;
  for(int i=0;i<l/2;i++)
  {
      if(str[i]!=str[(l-3)/2-i])
      {
          count++;
      }
  }
  if(count==0)
  {
      yes++;
  }
  count =0;
   for(int i=(l+1/2);i<l;i++)
  {
      if(str[i]!=str[l-1-i])
      {
          count++;
      }
  }
  if(count==0)
  {
      yes++;
  }
  if(yes==3)
  {
      printf("Yes");

  }
  else printf("No");
}
//  [c]
#include <stdio.h>
#include <math.h>
#include <string.h>

int main()
{
    char s[99];
    gets(s);
    int n=strlen(s)-1;
    int f1=0;
    for(int i=0;i<=n/2;i++){
        if(s[i]!=s[n-i]){
            f1++;
            printf("No");
            return 0;
        }
    }
    int f2=0;
    for(int i=0;i<=(n-1)/2;i++){
        if(s[i]!=s[(n-1)/2-i]){
            f2++;
            printf("No");
            return 0;
        }
    }
    int f3=0;
    for(int i=(n+3)/2;i<=n;i++){
        if(s[i]!=s[n-i]){
            f3++;
            printf("No");
            return 0;
        }
    }
    if(f1==0 && f2==0 && f3==0) printf("Yes");
    else printf("No");

    return 0;
}
//  [javascript]
"use strict";
function main(input) {
  const s = input[0];
  const n = s.length;

  let judge = false;
  if(s === s.split("").reverse().join("")){
    let a = s.substr( 0, (n-1)/2);
    //console.log(a)
    if(a === a.split("").reverse().join("")){
      let b = s.substr( (n+3)/2 -1, n-1);
      //console.log(b)
      if(b === b.split("").reverse().join("")){
        judge = true;
      }
    }
  }

  console.log(judge?"Yes":"No");
}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split("\n"));
//  [javascript]

function Main(arg) {
  var S = arg.split("\n")[0];

  var a = S.slice(0, (S.length - 1) / 2);
  var b = S.slice(((S.length + 3) / 2)-1).split("").reverse().join("");
  
  if (a !== b) {
    console.log("No");
    return;
  }

  if (a.length % 2 == 0) {
    var c = a.slice(0, (a.length) / 2);
    var d = a.slice(((a.length + 2) / 2)-1).split("").reverse().join("");
  }
  else {
    var c = a.slice(0, (a.length - 1) / 2);
    var d = a.slice(((a.length + 3) / 2)-1).split("").reverse().join("");    
  }
  
  if (c !== d) {
    console.log("No");
    return;
  }

  if (a !== b) {
    console.log("No");
    return;
  }
  
  console.log("Yes");
  return;
}

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