jiahuimbzuai/CoQuIR huggingface dataset:
//  [rust]

use std::io::*;
use std::str::FromStr;

pub 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")
}

use std::cmp::{max, min};
use std::collections::HashMap;

fn gcd(a: i64, b: i64) -> i64 {
  if a % b == 0 {
    b
  } else {
    gcd(b, a % b)
  }
}

fn lcm(a: i64, b: i64) -> i64 {
  a * b / gcd(a, b)
}

fn main() {
  let n = read::<i64>();
  let mut vec: Vec<Vec<i64>> = vec![];
  let mut s_x = 0;
  let mut s_y = 0;
  let mut time = 0;
  let mut ans = "Yes";

  for _ in 0..n {
    let t = read::<i64>();
    let x = read::<i64>();
    let y = read::<i64>();
    vec.push(vec![t, x, y]);
  }

  for i in vec {
    let t = i[0];
    let x = i[1];
    let y = i[2];
    let d_x = (s_x - x).abs();
    let d_y = (s_y - y).abs();
    let d_time = (time - t).abs();

    if (d_x + d_y) % 2 != d_time % 2 || d_time < d_x + d_y {
      ans = "No";
      break;
    }
    s_x = x;
    s_y = y;
    time = t;
  }

  println!("{}", ans);
}
//  [swift]
//usr/bin/env swift $0 $@;exit
let n=Int(readLine()!)!
var t=0
var x=0
var y=0
var r="Yes"
for i in 0..<n {
	let arr=readLine()!.characters.split{$0==" "}.map{Int(String($0))!}
	let t0=arr[0]
	let x0=arr[1]
	let y0=arr[2]
	let dt=t0-t
	let dx=x0-x
	let dy=y0-y
	if dx+dy>dt || (dt-dx-dy)%2>0 {r="No"}
	t=t0
	x=x0
	y=y0
}
print(r)
//  [swift]
var ans = "Yes"
var (preT, preX, preY) = (0, 0, 0)
for _ in 0..<Int(readLine()!)! {
  let input = readLine()!.characters.split(" ").map{Int(String($0))!}
  let (t, x, y) = (input[0], input[1], input[2])
  let (dt, dx, dy) = (t - preT, abs(x - preX), abs(y - preY))
  let tmp = dt - (dx + dy)
  if tmp < 0 || tmp % 2 > 0 {
    ans = "No"
  }
  (preT, preX, preY) = (t, x, y)
}
print(ans)
//  [swift]
let N = Int(readLine()!)!
var ans = "Yes"
var preT = 0
var preX = 0
var preY = 0
for _ in 0..<N {
  let input = readLine()!.characters.split(" ").map{Int(String($0))!}
  let (t, x, y) = (input[0], input[1], input[2])
  let dist = abs(x - preX) + abs(y - preY)
  let time = t - preT
  let overTime = time - dist
  if overTime < 0 || overTime % 2 > 0 {
    ans = "No"
  }
  (preT, preX, preY) = (t, x, y)
}
print(ans)
//  [typescript]
// general helpers
const debug = (message?: any, ...optionalParams: any[]) => {
  if (process.env.LOCAL_DEBUG === '1') console.log(message, ...optionalParams)
}

// helpers
const parseLines = (
  lines: string[]
): any => {
  const N = +lines[0]
  const distances = lines.slice(1, 1 + N).map(line => line.split(' ').map(l => +l))
  const obj = { N, distances }
  debug(obj)
  return obj
}

// solver
export const solve = (lines: string[]): string => {
  let { distances } = parseLines(lines)
  let isReach = true
  for (let d of distances) {
    const [t, x, y] = d
    if (t % 2 === 0 && (x + y) % 2 !== 0) {
      isReach = false
      break
    } else if (t % 2 === 1 && (x + y) % 2 !== 1) {
      isReach = false
      break
    } else if ((x + y) > t) {
      isReach = false
      break
    }
  }
  return isReach ? "Yes" : "No"
}

// main
const main = (lines: string[]) => {
  console.log(solve(lines))
}

// exec main function for submit
if (process.env.LOCAL_DEBUG !== '1') {
  const { stdin: input, stdout: output } = process
  input.resume()
  input.setEncoding('utf8')
  const lines: string[] = []
  require('readline')
    .createInterface({ input, output })
    .on('line', (line: string) => lines.push(line))
    .on('close', () => main(lines))
}
//  [typescript]
export default solve;

// =================================================
// ABC086C
// =================================================

// reader
readline();

// main
function main(lines) {
  console.log(solve(lines));
}

// solver
function solve(lines: string[]): string {
  const { destinations } = parseLines(lines);

  let canArrive = true;
  loop: for (let i = 0; i < destinations.length; i++) {
    const [step, x, y] = destinations[i];
    const [previousStep, previousX, previousY] = destinations[i - 1] || [0, 0, 0];
    const distance = step - previousStep;
    const stepsToArrive = Math.abs(x - previousX) + Math.abs(y - previousY);
    if (distance % 2 !== stepsToArrive % 2 || distance < stepsToArrive) {
      canArrive = false;
      break loop;
    }
  }
  return canArrive ? 'Yes' : 'No';
}

// helpers
function parseLines(lines: string[]) {
  const N = +lines[0];
  const destinations = lines.slice(1, 1 + N).map(line => line.split(' ').map(s => +s));
  const obj = { N, destinations };
  debug(obj);
  return obj;
}

// general helpers
function debug(message?: any, ...optionalParams: any[]) {
  if (!!process.env.LOCAL_DEBUG) console.log(message, ...optionalParams);
}

function readline() {
  if (!process.env.LOCAL_DEBUG) {
    process.stdin.resume();
    process.stdin.setEncoding('utf8');
    const lines = [];
    require('readline')
      .createInterface({
        input: process.stdin,
        output: process.stdout,
      })
      .on('line', line => lines.push(line))
      .on('close', () => main(lines));
  }
}
//  [typescript]
export default solve;

// =================================================
// ABC086C
// =================================================

// reader
readline();

// main
function main(lines) {
  console.log(solve(lines));
}

// solver
function solve(lines: string[]): string {
  const { destinations } = parseLines(lines);

  let canArrive = true;
  loop: for (let i = 0; i < destinations.length; i++) {
    const [step, x, y] = destinations[i];
    const [previousStep, previousX, previousY] = destinations[i - 1] || [0, 0, 0];
    const distance = step - previousStep;
    const stepsToArrive = Math.abs(x - previousX) + Math.abs(y - previousY);
    if (distance % 2 !== stepsToArrive % 2 || distance < stepsToArrive) {
      canArrive = false;
      break loop;
    }
  }
  return canArrive ? 'Yes' : 'No';
}

// helpers
function parseLines(lines: string[]) {
  const N = +lines[0];
  const destinations = lines.slice(1, 1 + N).map(line => line.split(' ').map(s => +s));
  const obj = { N, destinations };
  debug(obj);
  return obj;
}

// general helpers
function debug(message?: any, ...optionalParams: any[]) {
  if (!!process.env.LOCAL_DEBUG) console.log(message, ...optionalParams);
}

function readline() {
  if (!process.env.LOCAL_DEBUG) {
    const { stdin: input, stdout: output } = process;
    input.resume();
    input.setEncoding('utf8');
    const lines = [];
    require('readline')
      .createInterface({ input, output })
      .on('line', line => lines.push(line))
      .on('close', () => main(lines));
  }
}
//  [python]
import math
import numpy as np
 
line = input().split()
D = int(line[0])
N = int(line[1])
 
if D == 0:
    if N == 100:
        print(N+1)
    else:
        print(N)
elif D == 1:
    if N == 100:
        print((N+1)*100)
    else:
        print(N*100)
else :
    if N == 100:
        print((N+1)*10000)
    else:
        print(N*10000)
//  [python]
D,N = map(int,input().split())

count = 0
i = 1
while count<N:
    if (i%(100**(D+1)) != 0) and (i%(100**(D+2)) != 0) and (i%(100**D)) == 0:
        count += 1
    i += 1
print(i-1)
//  [python]
D, N = map(int, input().split())

count = 0
for i in range(1, 10 ** 7):
    tmp = i
    flag = True
    div_count = 0
    for j in range(3):
        if tmp%100 == 0:
            tmp = tmp // 100
            div_count += 1

    if div_count == D:
        count += 1

    if count == N:
        print(i)
        break
//  [java]
import java.util.Iterator;
import java.util.PrimitiveIterator;
import java.util.Scanner;
import java.util.function.Supplier;
import java.util.stream.IntStream;
import java.util.stream.Stream;

public class Main{
	static Scanner s=new Scanner(System.in);

	void solve(){
		int n=gInt(),k=gInt();
		System.out.print(k==100?101:k);
		for(int i:rep(n))
			System.out.print("00");
		System.out.println();
	}
	
	public static void main(String[] A){
		new Main().solve();
	}

	static int gInt(){
		return Integer.parseInt(s.next());
	}
	static long gLong(){
		return Long.parseLong(s.next());
	}
	static double gDouble(){
		return Double.parseDouble(s.next());
	}

	SupplyingIterator<Integer> ints(int n){
		return new SupplyingIterator<>(n,Main::gInt);
	}
	SupplyingIterator<Long> longs(int n){
		return new SupplyingIterator<>(n,Main::gLong);
	}
	SupplyingIterator<Double> doubles(int n){
		return new SupplyingIterator<>(n,Main::gDouble);
	}
	SupplyingIterator<String> strs(int n){
		return new SupplyingIterator<>(n,s::next);
	}

	Range rep(int i){
		return Range.rep(i);
	}
	Range rep(int f,int t,int d){
		return Range.rep(f,t,d);
	}
	Range rep(int f,int t){
		return rep(f,t,1);
	}
	Range rrep(int f,int t){
		return rep(t,f,-1);
	}

	IntStream REP(int v){
		return IntStream.range(0,v);
	}
	IntStream REP(int l,int r){
		return IntStream.rangeClosed(l,r);
	}

	IntStream INTS(int n){
		return IntStream.generate(Main::gInt).limit(n);
	}
	Stream<String> STRS(int n){
		return Stream.generate(s::next).limit(n);
	}

}
class SupplyingIterator<T> implements Iterable<T>,Iterator<T>{
	int			t;
	Supplier<T>	supplier;

	SupplyingIterator(int t,Supplier<T> supplier){
		this.t=t;
		this.supplier=supplier;
	}

	@Override
	public Iterator<T> iterator(){
		return this;
	}

	@Override
	public boolean hasNext(){
		return t>0;
	}

	@Override
	public T next(){
		--t;
		return supplier.get();
	}

}
class Range implements Iterable<Integer>,PrimitiveIterator.OfInt{
	int to,cur,d;

	Range(int from,int to,int d){
		this.cur=from-d;
		this.to=to;
		this.d=d;
	}

	Range(int n){
		this(0,n-1,1);
	}

	@Override
	public Iterator<Integer> iterator(){
		return this;
	}

	@Override
	public boolean hasNext(){
		return cur+d==to||(cur!=to&&(cur<to==cur+d<to));
	}

	@Override
	public int nextInt(){
		return cur+=d;
	}

	static Range rep(int i){
		return new Range(i);
	}
	static Range rep(int f,int t,int d){
		return new Range(f,t,d);
	}
	static Range rep(int f,int t){
		return rep(f,t,1);
	}
	static Range rrep(int f,int t){
		return rep(f,t,-1);
	}

}
//  [java]
import java.util.*;
import java.util.function.BiPredicate;
import java.util.function.BinaryOperator;
import java.util.stream.IntStream;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int inputD = Integer.parseInt(sc.next());
        int inputN = Integer.parseInt(sc.next());

        int[] arr = IntStream.range(1, 10000000)
                .filter(num -> calc(num,inputD)).toArray();
        System.out.println(arr[inputN -1]);
    }
    private static boolean calc(int x, int d) {
        int count = 0;
        int tmp = x;
        while (true) {
            if (tmp % 100 == 0) {
                count++;
                tmp = tmp/ 100;
            } else {
                break;
            }
        }
        if (count == d) {
            return true;
        } else {
            return false;
        }
    };
}
//  [java]
import java.util.*;
public class Main {
   public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);

      int d = sc.nextInt();
      int n = sc.nextInt();

      int i = 0;

      int j = 1;

      if (n != 100) {

      while ( i < d ) {
         j = j * 100;
         i = i + 1;
      }
      System.out.println(n * j);


      }
      else {
         if (d == 0) {
            System.out.println(101);
         }
         else if (d == 1) {
            System.out.println(10100);
         }
         else {
            System.out.println(1010000);
         }
      }
   }
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
#define modulo 998244353
#define mod(mod_x) ((((long long)mod_x+modulo))%modulo)
#define Inf 1000000000



int main(){
	
	int N,D;
	cin>>D>>N;
	
	vector<int> ans;
	
	for(int i=1;i<=50000000;i++){
		int cnt = 0;
		int now = i;
		while(now%100==0){
			cnt++;
			now/=100;
		}
		if(cnt==D)ans.push_back(i);
	}
	
	
	cout<<ans[N-1]<<endl;
		
	
    return 0;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;
#define pi 3.14159265359
#define inf 2147483647
#define INF 9223372036854775807
#define mod 1000000007
#define mod2 998244353
#define Graph vector<vector<int>>

int main() {
    int D, N; cin >> D >> N;
    vector<int> ans;
    for (int i = 1; i < 10000000; i++) {
        if (i % (int)pow(100, D) == 0 && i % (int)pow(100, D + 1) != 0) ans.push_back(i);
    }
    cout << ans.at(N - 1) << endl;
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;

int main()
{
    int d,n;
    cin>>d>>n;
   vector<int>v;
   for(int i=1;i<=1e7;i++)
   {
       int counter=0;
       int a=i;
       while(a%100==0)
       {
           a/=100;
           counter++;
       }
       if(counter==d)v.push_back(i);
   }
   sort(v.begin(),v.end());
   cout<<v[n-1]<<endl;
}
//  [c]
#include<stdio.h>
#include<math.h>
int main()
{
  double d,n,ans;
  scanf("%lf %lf",&d,&n);
  if(n<100)ans = pow(100,d)*n;
  if(n==100)ans = pow(100,d)*101;
  printf("%d",(int)ans);
  return 0;
}
//  [c]
#include <stdio.h>
int main(void){
    int d,n;
    scanf("%d%d",&d,&n);
    if(n==100) n++;
    if(d==0) printf("%d",n);
    else if(d==1) printf("%d",100*n);
    else printf("%d",10000*n);
    return 0;
}
//  [c]
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <limits.h>
#include <stdbool.h>

#define rep(i, n) for(int i=0; i<(n); ++i)
#define max  200001

//qsort(str, n, sizeof(int), up_comp);
int up_comp(const void *a, const void *b){return *(int*)a - *(int*)b;}
int down_comp(const void *a, const void *b){return *(int*)b - *(int*)a;}
int int_sort( const void * a , const void * b ) {return strcmp(( char * )a , ( char * )b );}
int count_digit(int a){int i=0;while(a!=0){a=a/10;i++;}return i;}
int euclid( int a, int b ){int temp;if(a<b){temp=a;a=b;b=temp;}if(b<1)return -1;if(a%b==0) return b;return euclid(b,a%b);}

int main(void){
    
    int d, n;
    int ans;
    
    scanf("%d%d", &d, &n);
    
    if (n<100) {
        ans = n*pow(100, d);
    } else {
        ans = 101*pow(100, d);
    }
    
    printf("%d", ans);
    
    return 0;
}
//  [javascript]
'use strict'

function Main(input) {
  const D = Number(input.split(' ')[0]);
  let N = Number(input.split(' ')[1]);

  if(N === 100) {
    N++;
  }

  console.log(Math.pow(100,D) * N);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
//  [javascript]
function main(input) {
    var line = input.split(' ');
    var D = parseInt(line[0]);
    var N = parseInt(line[1]);
    var answer = Math.pow(100, D) * (N === 100 ? 101: N);
    console.log(answer);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
process.stdin.resume();
process.stdin.setEncoding('utf8');

var g_input = '';
process.stdin.on('data', function(chunk) {
    g_input += chunk;
});

process.stdin.on('end', function() {
    Main(g_input.split(/\r?\n/));
});

function Main(input) {

    var dn = input[0].split(' ');
    var d = parseInt(dn[0], 10);
    var n = parseInt(dn[1], 10);

    var n2 = n; 
    if (n % 100 === 0) {
        n2 = n + 1;
    }
    var ans = Math.pow(100, d) * n2;
    console.log(ans);

    return 0;
}
//  [go]
package main

import "fmt"

func main() {
	var D, N int
	fmt.Scan(&D, &N)
	c := 0
	for i := 1; true; i++ {
		d := 0
		j := i
		for j > 0 && j%100 == 0 {
			j /= 100
			d++
		}
		if d == D {
			c++
		}
		if c == N {
			fmt.Println(i)
			return
		}
	}
}
//  [go]
package main

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

var sc = bufio.NewScanner(os.Stdin)

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

func iScan() int {
	n, _ := strconv.Atoi(Scan())
	return n
}

func fScan() float64 {
	n, _ := strconv.ParseFloat(Scan(), 64)
	return n
}
func stringToInt(s string) int {
	n, _ := strconv.Atoi(s)
	return n
}
func SScan(n int) []string {
	a := make([]string, n)
	for i := 0; i < n; i++ {
		a[i] = Scan()
	}
	return a
}
func iSScan(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = iScan()
	}
	return a
}
func abs(x int) int {
	if x < 0 {
		x = -x
	}
	return x
}
func larger(a, b int) int {
	if a < b {
		return b
	} else {
		return a
	}
}
func smaller(a, b int) int {
	if a > b {
		return b
	} else {
		return a
	}
}
func max(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x < a[i] {
			x = a[i]
		}
	}
	return x
}
func min(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x > a[i] {
			x = a[i]
		}
	}
	return x
}
func sum(a []int) int {
	x := 0
	for _, v := range a {
		x += v
	}
	return x
}

var mod int = 1000000007

func main() {
	buf := make([]byte, 0)
	sc.Buffer(buf, mod)
	sc.Split(bufio.ScanWords)
	d, n := iScan(), iScan()
	if n == 100 {
		n++
	}
	for i := 0; i < d; i++ {
		n *= 100
	}
	fmt.Println(n)
}
//  [ruby]
def calc(x)
  r = 0
  while (x % 100).zero?
    x /= 100
    r += 1
  end
  r
end
d, n = gets.split.map(&:to_i)
cnt = 0
x = 1
loop do
  cnt += 1 if calc(x) == d
  break if cnt == n
  x += 1
end
puts x
//  [ruby]
require 'prime'
require 'set'
require 'tsort'
include Math
ALP = ('a'..'z').to_a
INF = 0xffffffffffffffff
def max(a,b);              a > b ? a : b                              end
def min(a,b);              a < b ?  a : b                             end
def swap(a,b);             a, b = b, a                                end
def gif;                   gets.to_i                                  end
def gff;                   gets.to_f                                  end
def gsf;                   gets.chomp                                 end
def gi;                    gets.split.map(&:to_i)                     end
def gf;                    gets.split.map(&:to_f)                     end
def gs;                    gets.chomp.split.map(&:to_s)               end
def gc;                    gets.chomp.split('')                       end
def pr(num);               num.prime_division                         end
def pr?(num);              Prime.prime?(num)                          end
def digit(num);            num.to_s.length                            end
def array(s,ini=nil);      Array.new(s){ini}                          end
def darray(s1,s2,ini=nil); Array.new(s1){Array.new(s2){ini}}          end
def rep(num);              num.times{|i|yield(i)}                     end
def repl(st,en,n=1);       st.step(en,n){|i|yield(i)}                 end


d,n=gi
if n == 100
  puts (100**d)*(n+1)
else
  puts (100**d)*(n)

end
//  [ruby]
D,N = gets.chomp.split(" ").map(&:to_i)

A=[]
1010001.times do |i|
    if i%100**D==0
        A<<i
    end
end

if N<100
  puts A[N]
else
  puts A[N+1]
end
//  [rust]
#![allow(unused_imports)]
use std::io::{ self, Write };
use std::str::FromStr;
use std::cmp::{ min, max };
use std::collections::{ BinaryHeap, VecDeque };

#[allow(unused_macros)]
macro_rules! trace {
    ($var:expr) => {
        let _ = writeln!(&mut std::io::stderr(), ">>> {} = {:?}", stringify!($var), $var);
    };
    ($($args:expr),*) => { trace!(($($args),*)) }
}

#[allow(unused_macros)]
macro_rules! put {
    ($var:expr) => {
        let _ = writeln!(&mut std::io::stdout(), "{}", $var);
    };
    ($var:expr, $($args:expr),*) => {
        let _ = write!(&mut std::io::stdout(), "{} ", $var);
        put!($($args),*);
    };
}

const M: usize = 1_000_000_007;

fn main() {
    let mut sc = Scanner::new();
    let d: u32 = sc.cin();
    let mut n: usize = sc.cin();
    let m0 = 100u64.pow(d);
    let m1 = 100u64.pow(d+1);
    // trace!(m0, m1);
    for i in 1..2000000 {
        if i % m0 == 0 && i % m1 != 0 {
            n -= 1;
            if n == 0 {
                put!(i);
                return;
            }
        }
    }
}

#[allow(dead_code)]
struct Scanner { stdin: io::Stdin, buffer: VecDeque<String>, }
#[allow(dead_code)]
impl Scanner {
    fn new() -> Scanner { Scanner { stdin: io::stdin(), buffer: VecDeque::new() } }
    fn reserve(&mut self) {
        while self.buffer.len() == 0 {
            let mut line = String::new();
            let _ = self.stdin.read_line(&mut line);
            for w in line.split_whitespace() {
                self.buffer.push_back(String::from(w));
            }
        }
    }
    fn cin<T: FromStr>(&mut self) -> T {
        self.reserve();
        match self.buffer.pop_front().unwrap().parse::<T>() {
            Ok(a) => a,
            Err(_) => panic!("parse err")
        }
    }
}
//  [rust]
#[allow(unused_imports)] use proconio::{input, marker::{Bytes, Chars, Usize1, Isize1}};
#[allow(unused_imports)] use std::cmp::{min, max};
#[allow(unused_imports)] use superslice::Ext as _;

#[proconio::fastout]
fn main() {
	input! {
		d: usize,
		mut n: usize,
	}

	if n == 100 {
		n += 1;
	}
	match d {
		0 => println!("{}", n),
		1 => println!("{}", 100*n),
		_ => println!("{}", 100*100*n),
	}
}
//  [typescript]
import { readFileSync } from "fs";

const read = () =>
  readFileSync(0, "utf8")
    .split("\n")
    .map((line) => line.split(" "));

const main = (input: string[][]) => {
  const [D, N] = input[0].map(Number);

  return 100 ** D * (N === 100 ? N + 1 : N);
};

console.log(main(read()));
//  [typescript]
const stdin = require('fs').readFileSync('/dev/stdin', 'utf8').trim()

const [d, n] = stdin
  .split('\n')[0]
  .split(' ')
  .map(Number)

const divideCount = x => {
  let c = 0
  while (x % 100 === 0) {
    c++

    x /= 100

    if (x < 100) {
      return c
    }
  }
  return c
}

const ans = _ => {
  let count = 0
  let num = 1

  while (1) {
    switch (d) {
      case 0:
        if (divideCount(num) === 0) count++
        break
      case 1:
        if (divideCount(num) === 1) count++
        break
      case 2:
        if (divideCount(num) === 2) count++
        break
    }

    if (count === n) {
      return num
    }

    num++
  }
}

console.log(ans())
//  [typescript]
import {stdin} from 'process';
let input = "";
stdin.on('data', x => {input += x});
stdin.on('end', () => {
    let [d, n] = input.split(' ')
        .map(x=>x.trim()).map(x=>parseInt(x));
    if (n === 100) {
        console.log(101 * Math.pow(100, d));
    }
    else {
        console.log(n * Math.pow(100, d));
    }
});
//  [python]
import numpy as np

a,b,c = map(int,input().split())

lest = a-b
print(max(c-lest,0))
//  [python]
# -*- coding: utf-8 -*-
"""
AtCoder A
"""
 
import sys, math, random
import numpy as np
 
# N = int(input())
# A = list(map(int,input().split())) # N row 1 column
# A = [int(input()) for _ in range(N)] # 1 row N column
# S = str(input()) # str(input()) == input() -> 'abc'
# S = list(input()) # abc -> ['a','b','c']
# S.replace('ABC','X') # "testABCABC" -> "testXX"
# S=numpp.assaray(S)=="#"
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]
 
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LLS(): return [list(sys.stdin.readline().rstrip()) for _ in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
 
 
 
def main():
    A, B, C = list(map(int,input().split()))
    sub=0
    if A>B:
        sub=A-B
    else:
        sub=0
    if sub>C:
        print("0")
    else:
        print(C-sub)
 
 
 
if __name__ == "__main__":
    main()
//  [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 a = in_data[0];
        int b = in_data[1];
        int c = in_data[2];

        int tmp = a - b;
        int ans = c - tmp;

        if(ans <= 0){
            System.out.println("0");
        }else{
            System.out.println(ans);
        }
    }
}
//  [java]
import java.io.*;
import java.util.*;

public class Main {
	static int mod = (int)1e9+7;
	static Comparator<Integer> lower_bound = (x, y) -> x.compareTo(y) >= 0 ? 1 : -1;
	static Comparator<Integer> upper_bound = (x, y) -> x.compareTo(y) > 0 ? 1 : -1;

	public static void main(String[] args){
		FastScanner sc = new FastScanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		solve(sc,out);

		out.flush();
	}

	public static void solve(FastScanner sc, PrintWriter out) {
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		
		out.println(c - a + b >= 0 ? c - a+ b : 0);
 	}

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

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

	public static long factorial(int n) {
		long a;

		if(n > 0) {
			a = n * factorial(n - 1);
		}else{
			a = 1;
		}
		return a;
	}
}

class Pair<K, V> extends AbstractMap.SimpleEntry<K, V> {

    public Pair(K key, V value) {
        super(key, value);
    }

    public Pair<V, K> swap() {
    	return new Pair<V, K>(getValue(), getKey());
    }
 }

class UnionFind {
	int[] par;

	public UnionFind(int n) {
		par = new int[n];

		Arrays.fill(par, -1);
	}

	int root(int x) {
		if(par[x] < 0) return x;
		return par[x] = root(par[x]);
	}

	boolean unite(int x,int y) {
		x = root(x);
		y = root(y);

		if(x == y) return false;

		if(size(x) < size(y)) {
			int tmp = x;
			x = y;
			y = tmp;
		}

		par[x] += par[y];
		par[y] = x;

		return true;
	}

	boolean same(int x,int y) {
		int rx = root(x);
		int ry = root(y);
		return rx == ry;
	}

	int size(int a) {
		return -par[root(a)];
	}
}

class FastScanner {
    private BufferedReader reader = null;
    private StringTokenizer tokenizer = null;

    public FastScanner(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;
    }
}
//  [c]
#include<stdio.h>
int main(void)
{
    int A,B,C;
    int S1;
  
    scanf("%d%d%d",&A,&B,&C);
    S1=A-B;
    if(S1<=C) printf("%d\n",C-S1);
    else printf("0\n");
  
    return 0;
}
//  [c]
#include<stdio.h>
int main()
{
    int a, b, c, x, y;
    scanf("%d %d %d", &a, &b, &c);
    x = a - b;
    y = c - x;
    if(y>0){
        printf("%d\n", y);
    }
    else printf("0\n");

    return 0;
}
//  [c]
#include <stdio.h>

int main(){
  int a,b,c,ans;
  scanf("%d%d%d", &a,&b,&c);
  ans = c-(a-b);
  if(ans<0){ ans=0; }
  printf("%d\n",ans);
  return 0;
}
//  [javascript]
function Main(input) {
    input = input.split(" ").map(Number);
    var a = input[0];
    var b = input[1];
    var c = input[2];
    var ans = Math.max(0, c - (a - b));
    console.log(ans);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
"use strict";
const main = arg => {
  let water = arg.split(" ").map(x=> x*1);
  let ans = water[2] + water[1] - water[0] >= 0? water[2] + water[1] - water[0]:0;
  console.log(ans);
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
function Main(input) {
    const args = input.split(' ');
	const a = parseInt(args[0], 10);
	const b = parseInt(args[1], 10);
    const c = parseInt(args[2], 10);
    
    var res = Math.max(0,b+c-a)

    console.log(res);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

import "fmt"

func main() {
	var a, b, c int
	fmt.Scanf("%d %d %d", &a, &b, &c)
	ans := b + c - a
	if ans >= 0 {
		fmt.Println(ans)
	} else {
		fmt.Println(0)
	}
}
//  [go]
package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Split(bufio.ScanWords)

	a := nextInt()
	b := nextInt()
	c := nextInt()

	if c-(a-b) > 0 {
		fmt.Println(c - (a - b))
	} else {
		fmt.Println(0)
	}

}

// ---- readfunc
func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}
func nextStr() string {
	sc.Scan()
	return sc.Text()
}
//  [ruby]
a, b, c = gets.chomp.split.map(&:to_i)
puts [c - (a - b), 0].max
//  [ruby]
#!/usr/bin/env ruby

require 'set'

class Hash
  def push(key, value)
    self[key] = [] if self[key] == nil
    self[key].push(value)
  end
end

class Array
  def lower_bound(value)
    left = -1;
    right = self.length;
    while left + 1 < right
      mid = left + (right - left) / 2;
      if self[mid] >= value
        right = mid
      else
        left = mid
      end
    end
    right
  end

  def unique
    res = [self.first]
    each_cons(2) do |a, b|
      if a != b
        res.push(b)
      end
    end
    res
  end
end

def get_ints
  gets.chomp.split.map(&:to_i)
end

def get_ints_minus_one
  get_ints.map { |x| x - 1 }
end

def get_int
  gets.chomp.to_i
end

A, B, C = get_ints

x = C - (A - B)

puts x < 0 ? 0 : x
//  [ruby]
a, b, c = gets.split.map(&:to_i)
puts [c - (a - b), 0].max
//  [rust]
#[allow(unused_imports)]
use proconio::{fastout, input};

#[fastout]
fn main() {
    input!(a: isize, b: isize, c: isize);
    println!("{}", if 0 < c - (a - b) { c - (a - b) } else { 0 });
}
//  [rust]
use text_io::*;
use std::collections::*;
use std::process::exit;
use std::cmp::max;

fn main() {
    let mut a:isize = read!();
    let mut b:isize = read!();
    let mut c:isize = read!();
    println!("{}",max(0,b+c-a));
}
//  [rust]
use proconio::{fastout, input};

#[fastout]
fn main() {
    input! {
        a: i32,
        b: i32,
        c: i32,
    }
    println!("{}", std::cmp::max(0, c - (a - b)));
}
//  [swift]
import Foundation
import CoreFoundation

#if swift(>=4.0)
#else
extension String {
    func split(separator separator: Character) -> [String] {
        return self.characters.split(separator).map{String($0)}
    }
    var count: Int {
        return self.characters.count
    }
    func uppercased() -> String {
        return self.uppercaseString
    }
    func lowercased() -> String {
        return self.lowercaseString
    }
}
extension Array where Element: Comparable {
    func max() -> Element? {
        return self.maxElement()
    }
    func min() -> Element? {
        return self.minElement()
    }
    func sorted() -> Array {
        return self.sort()
    }
    mutating func sort() {
        self.sortInPlace()
    }
}
extension Array {
    mutating func swapAt(i: Int, _ j: Int) {
        swap(&self[i], &self[j])
    }
    func joined(separator separator: String = " ") -> String {
        return self.map{String($0)}.joinWithSeparator(separator)
    }
    func reversed() -> Array {
        return self.reverse()
    }
    mutating func reverse() {
        self = self.reversed()
    }
    func enumerated() -> EnumerateSequence<[Element]> {
        return self.enumerate()
    }
    init(repeating: Element, count: Int) {
        self.init(count: count, repeatedValue: repeating)
    }
}
func stride<T: Strideable>(from start: T, to end: T, by stride: T.Stride) -> StrideTo<T> {
    return start.stride(to: end, by: stride)
}
#endif
func readInt() -> Int? {
    return Int(readLine()!)
}
func readStringSplit(by separator: Character = " ") -> [String] {
    return readLine()!.split(separator: separator)
}
func readIntSplit(by separator: Character = " ") -> [Int] {
    return readLine()!.split(separator: separator).map{Int($0)!}
}
prefix operator * { }
prefix func * <T> (a: [T]) -> (T, T)          { return (a[0], a[1]) }
prefix func * <T> (a: [T]) -> (T, T, T)       { return (a[0], a[1], a[2]) }
prefix func * <T> (a: [T]) -> (T, T, T, T)    { return (a[0], a[1], a[2], a[3]) }
prefix func * <T> (a: [T]) -> (T, T, T, T, T) { return (a[0], a[1], a[2], a[3], a[4]) }
infix operator ** { associativity right precedence 155 }    // 右結合，乗除算より強くビットシフトより弱い
func **(lhs: Int, rhs: Int) -> Int {
    return (0..<rhs).reduce(1){i,_ in i*lhs}
}
func **(lhs: Int, rhs: Double) -> Double {
    return pow(Double(lhs), rhs)
}
//func gcd(x: Int, _ y: Int) -> Int {
//    return y>0 ? gcd(y, x%y) : x
//}
//func lcm(x: Int, _ y: Int) -> Int {
//    return x * y / gcd(x, y)
//}
let MOD = 10**9+7

/*************** テストスペース ***************/

//arr.sort{$0.0==$1.0 ? $0.1<$1.1 : $0.0<$1.0}  // タプル配列のソート

/*************** メインプログラム ***************/

let (A, B, C) = *readIntSplit()
print(max(C-(A-B), 0))
//  [swift]
let array = readLine()!.characters.split{$0 == " "}.map{Int(String($0))!}
let result = array[2] - array[0] + array[1]
print(result < 0 ? 0 : result)
//  [swift]
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

func main() {
    let abc = readInts()
    
    if abc[2] + abc[1] - abc[0] >= 0 {
        print(abc[2] + abc[1] - abc[0])
    } else {
        print("0")
    }
}

main()
//  [typescript]
// general helpers
const debug = (message?: any, ...optionalParams: any[]) => {
  if (process.env.LOCAL_DEBUG === '1') console.log(message, ...optionalParams)
}

// helpers
const parseLines = (
  lines: string[]
): { A: number, B: number, C: number } => {
  const [A, B, C] = lines[0].split(' ').map(line => +line)
  const obj = { A, B, C }
  debug(obj)
  return obj
}
// solver
export const solve = (lines: string[]): string => {
  const { A, B, C } = parseLines(lines)
  let answer = C - (A - B)
  answer = answer < 0 ? 0 : answer
  return `${answer}`
}

// main
const main = (lines: string[]) => {
  console.log(solve(lines))
}

// exec main function for submit
if (process.env.LOCAL_DEBUG !== '1') {
  const { stdin: input, stdout: output } = process
  input.resume()
  input.setEncoding('utf8')
  const lines: string[] = []
  require('readline')
    .createInterface({ input, output })
    .on('line', (line: string) => lines.push(line))
    .on('close', () => main(lines))
}
//  [typescript]
const input=require('fs').readFileSync('/dev/stdin', 'utf8').split(/[\s]/);const nin=()=>{const r = input[0];input.shift();return Number(r)};const nrin=(n)=>{const a:number[]=[];rep(n,()=>a.push(nin()));return a};const sin=()=>{const r = input[0];input.shift();return String(r)};const out=(...a)=>{console.log(...a)};const floor=(a)=>{return Math.floor(a)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const rep=(n, callback)=>{for(let i = 0;i < n; i++){callback()}};const strrep=(s, i, v)=>{return s.slice(0, i)+v+s.slice(i+1);};const permutation=({result=[],pre=[],post,n=post.length})=>{if(n>0){post.forEach((_,i)=>{const rest=[...post];const elem=rest.splice(i, 1);permutation({result, pre: [...pre,...elem],post:rest,n:n-1})})}else{result.push(pre)}return result};const sw=(s,a:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<a.length;i+=2){if(op==='=='){if(s==a[i])return a[i+1]}else if(op==='>='){if(s>=a[i])return a[i+1]}else if(op==='<='){if(s<=a[i])return a[i+1]}else if(op==='>'){if(s>a[i])return a[i+1]}else if(op==='<'){if(s<a[i])return a[i+1]}}return a[a.length-1];};const or=(a,...b)=>{for(let i=0;i<b.length;i++)if(a==b[i])return true;return false};const maxindex=(...a)=>{return a.indexOf(Math.max.apply(null,a))};const asc=(ar:number[])=>{return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{return ar.sort((a,b)=>{return b-a})};const ceil=a=>{return Math.ceil(a)};const srin=s=>{const a:string[]=[];rep(s,()=>a.push(sin()));return a};let ssinteger=-1;const ssin=()=>{ssinteger++;return input[0][ssinteger]};
const main = ()=>{
  let [a,b,c]=nrin(3)
  out(c-(a-b) <= 0 ? 0 : c-(a-b))
}
main()
//  [typescript]
{
  const Main = (input: string) => {
    const inputArray: string[] = input.split(/ |\n/);
    const nums: number[] = inputArray.map(s => parseInt(s));
    const answer: number = nums[2] - (nums[0] - nums[1]);
    if (answer >= 0) {
      console.log(answer);      
    } else {
      console.log(0);
      
    }
  }
  Main(require("fs").readFileSync("/dev/stdin", "utf8"));
}
//  [python]
import numpy as np
import math

S = input()
K = int(input())

k = 0
#  
while k < len(S) and S[k] == '1' and k < K:
    k += 1

if k == K or k == len(S):
    print('1')
else:
    print(S[k])
//  [python]
import numpy as np
def get():
    s = input()
    k = int(input())
    nums = []
    for item in s:
        nums.append(int(item))
    nums = np.array(nums)
    # if k >= nums.shape[0]:
    #     m = np.max(nums)
    # else:
    #     m = np.max(nums[:k])
    # count = np.bincount(nums)
    for i in nums[:k]:
        if i!=1:
            return i
    return 1
a = get()
print(a)
//  [python]
s = input()
k = int(input())

import numpy as np

ind = np.inf

for i in range(len(s)):
    if int(s[i]) != 1:
        ind = i
        ans = int(s[i])
        break
if ind >= k:
    ans = 1
    
print(ans)
//  [java]
import java.math.BigInteger;
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.nextLine();
		long N = sc.nextLong();
		
		BigInteger K = BigInteger.valueOf(N);
		BigInteger b = BigInteger.ZERO;
		for (char c: S.toCharArray()) {
			if (c == '1') {
				b = b.add(BigInteger.ONE);
			} else {
				long val = Long.valueOf(String.valueOf(c));
				BigInteger tmp = BigInteger.valueOf(val).pow(100_000_0);
				BigInteger tmp2 = BigInteger.valueOf(val).pow(10);
				b = b.add(tmp.multiply(tmp).multiply(BigInteger.valueOf(5L).multiply(tmp2)));
			}
			
			if (b.compareTo(K) >= 0) {
				System.out.println(c);
				return;
			}
		}
		
	}
	
}
//  [java]
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
    static int[] w = new int[100010];
    static int[] v = new int[100010];
    static int[][] dp = new int[110][100010];
    static int k;

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

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

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long n = sc.nextLong();
        char[] array = s.toCharArray();
        char num = '1';
        for (int i = 0; i < n; i++) {
            if (array[i] != '1') {
                num = array[i];
                break;
            }
        }
        if (s.charAt(0) == 1 && n == 1) {
            System.out.println(1);
        } else if (s.charAt(0) == '1' && n > 1) {
            System.out.println(num);
        } else {
            System.out.println(s.charAt(0));
        }

    }
}
//  [java]
import java.util.*;
import java.util.stream.*;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.nextLine();
        long k = in.nextLong();
        int pos = 0;
        while(pos < s.length() && s.charAt(pos) == '1') pos++;
        if(k <= pos) {
            System.out.println(1);
        } else {
            System.out.println(s.charAt(pos));
        }
    }
}
//  [cpp]
#include <iostream>
using namespace std;

int main() {
    string S;
    int K;

    cin >> S;
    cin >> K;

    string ans;

    int flg = 1;
    int cnt = 0;
    for (int i = 0; i < K; i++){
        if (flg) {
            if (S[i] != '1'){
                flg = 0;
            }
            cnt += 1;
        }
    }

    if (flg){
        ans = S[0];
    } else {
        ans = S[cnt - 1];
    }

    if (K==1){
        ans = S[0];
    } 
    else if (S.size() == 1){
        ans = S[0];
    }
    
    cout << ans << endl;
    return 0;
}
//  [cpp]
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
const int INF=1e9,MOD=1e9+7,ohara=1e6+10;
const ll LINF=1e18;
using namespace std;
    
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(int i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define Size(n) (n).size()
#define Cout(x) cout<<(x)<<endl
#define doublecout(a) cout<<fixed<<setprecision(15)<<a<<endl;
#define Cerr(x) cerr<<(x)<<endl
#define fi first
#define se second
#define P pair<ll,ll> 
#define m_p make_pair
#define V vector<ll> 
#define U_MAP unordered_map<ll,ll>
#define pq priority_queue<ll>
#define rpq priority_queue<ll,vector<ll>,greater<ll>>
#define p_b push_back
    
ll n,cnt,a,b,c,d,tmp,tmpp,m,h,w,x,y,sum,pos,k;
ld doua;
int dy[]={1,0,-1,0};
int dx[]={0,1,0,-1};
//int dy[]={-1,0,1,-1,1,-1,0,1};
//int dx[]={-1,-1,-1,0,0,1,1,1};
string alph("abcdefghijklmnopqrstuvwxyz"),s;
bool fl;
struct edge{int to,cost;};
char ans;
    
//-------------------------↓↓↓↓↓↓------------------------
    
//------ 自分を天才だと信じる ------
    
int main(void){
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    
    cin>>s>>k;
    ll kokomade=-1;
    rep(i,Size(s)){
        if(s[i]!='1'){
            ans=s[i];
            break;
        }
        kokomade=i;
    }
    if(kokomade+1>=k)Cout(1);
    else Cout(ans);
    return 0;
}
//  [c]
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <limits.h>
#define min(x, y) (x < y ? x : y)
#define ll long long int 

int main()
{

ll test = 0;
char s[101]={'\0'};
scanf("%s",s);
ll K ;
scanf("%lld",&K);
int copy = K ;
for (int i = 0 ;i<strlen(s);i++)
{
ll digit = s[i] -'0';
for (int j = 0; j<=64;j++)
 {
   test = pow(digit,j);
   if (test>=K)
   {
     
    printf("%lld",digit);
    return 0;
   }
 }
 K=K-test;
} 
 K = copy;
 printf("%c",s[K-1]);

  return 0;
}
//  [c]
#include<stdio.h>
int main(void){
	char s[101];
	long i,k;
	scanf("%s %ld",s,&k);
	for(i=0;s[i]!='\0';i++){
		if(s[i]!='1'&&i<k){
			printf("%c",s[i]);
			return 0;
		}
	}
	printf("1");
	return 0;
}
//  [c]
#pragma warning(disable:4996)
#pragma GCC diagnostic ignored "-Wunused-result"
#pragma GCC diagnostic ignored "-Wwrite-strings"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#define MAX_STRING 200

int main() {

	char sInputString[MAX_STRING]="";
	char sInputNumber[MAX_STRING]="";
	char* psInput=NULL;
	int i=0;
	int j=0;
	long long nK=0;
	int nLen=0;
	int nLimit=0;
	int nAnswer=1;

	// read line 1
	gets(sInputString);
	nLen=strlen(sInputString);

	
	// read line2
	gets(sInputNumber);
	nK=atoll(sInputNumber);
	
	if(nK>nLen){
		nLimit=nLen;
	} else{
		nLimit=nK;
	}

	for(i=0;i<nLimit;i++){
		if(sInputString[i]!='1'){
			nAnswer=sInputString[i]-0x30;
			break;
		} else {
			
		}
	}

	printf("%d\n",nAnswer);

    return 0;
}
//  [javascript]
function Main(s){
  s = s.split("\n");
  var k = s[1];
  s = s[0];
  var ans = 1;
  k = Math.min(s.length, +k)
  for(var i = 0; i < k; i++){
    if(s[i] !== "1"){ans = s[i]; break;}
  }
  console.log(ans);
}

Main(require("fs").readFileSync("/dev/stdin","utf8"));
//  [javascript]
var toInt = x=>parseInt(x,10);
var toIntArr = arr=>arr.map(x=>toInt(x));
var abs = x=>x>0?x:-x;
function min(){var rest = arguments,val=rest[0];for(var i=1;i<rest.length;i++)if(rest[i]<val)val = rest[i];return val}
function max(){var rest = arguments,val=rest[0];for(var i=1;i<rest.length;i++)if(rest[i]>val)val = rest[i];return val}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
 
function Main(input){
	var input = input.split('\n');
	var s = input[0];
	var k = toInt(input[1]);
	var chou = 5*Math.pow(10,15);

	while(s[0]==1){
		if(k===1){
			console.log(1);
			return 0;
		}
		s = s.slice(1);
		k--;
	}
	console.log(s[0]);

}
//  [javascript]
function Main(input) {
    input = input.trim().split("\n").map(function(x) { return x.split(" ")});
    let S = input[0][0];
    let K = input[1][0];
    K = BigInt(K);
    let ans;
    if (S[0] !== '1') ans = S[0];
    else {
        let flag;
        let tmpLength = 0n;
        ans = 1;
        for (let i = 0; i < S.length; i++){
            flag = false;
            if (S[i] !== '1') {
                ans = S[i];
                break;
            }
            tmpLength = tmpLength + 1n;
            flag = true;
        }

        if (!flag){
            if (K <= tmpLength) ans = 1;
        }
    }

    console.log(ans);

}

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

import (
	"fmt"
	"strconv"
)

func main() {
	// Code for C - To Infinity
	var S string
	var K int
	fmt.Scanf("%s", &S)
	fmt.Scanf("%d", &K)

	var count int
	var A int
	for i := 0; i < len(S); i++ {
		A, _ = strconv.Atoi(string(S[i]))
		if A == 1 {
			count++
		} else {
			fmt.Println(A)
			break
		}

		if count == K {
			fmt.Println("1")
			break
		}
	}

}
//  [go]
package main

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

var sc = bufio.NewScanner(os.Stdin)

func Scan() string {
	sc.Scan()
	return sc.Text()
}
func iScan() int {
	n, _ := strconv.Atoi(Scan())
	return n
}
func fScan() float64 {
	n, _ := strconv.ParseFloat(Scan(), 64)
	return n
}
func stringToInt(s string) int {
	n, _ := strconv.Atoi(s)
	return n
}
func SScan(n int) []string {
	a := make([]string, n)
	for i := 0; i < n; i++ {
		a[i] = Scan()
	}
	return a
}
func iSScan(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = iScan()
	}
	return a
}
func abs(x int) int {
	if x < 0 {
		x = -x
	}
	return x
}
func larger(a, b int) int {
	if a < b {
		return b
	} else {
		return a
	}
}
func smaller(a, b int) int {
	if a > b {
		return b
	} else {
		return a
	}
}
func max(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x < a[i] {
			x = a[i]
		}
	}
	return x
}
func min(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x > a[i] {
			x = a[i]
		}
	}
	return x
}
func sum(a []int) int {
	x := 0
	for _, v := range a {
		x += v
	}
	return x
}

var mod int = 1000000007

func main() {
	buf := make([]byte, 0)
	sc.Buffer(buf, mod)
	sc.Split(bufio.ScanWords)
	s := Scan()
	k := iScan()
	ans := 1
	for i := 0; i < smaller(len(s), k); i++ {
		if string(s[i]) != "1" {
			ans = stringToInt(string(s[i]))
			break
		}
	}
	fmt.Println(ans)
}
//  [go]
package main

import (
	"fmt"
)

func main() {
	var s string
	var k int
	fmt.Scan(&s, &k)

	for i, r := range s {
		if int(r-'0') != 1 {
			fmt.Println(string(r))
			return
		}
		if i == k-1 {
			fmt.Println(1)
			return
		}
	}
}
//  [ruby]
#!/usr/bin/env ruby

require 'set'

class Hash
  def push(key, value)
    self[key] = [] if self[key] == nil
    self[key].push(value)
  end
end

class Array
  def lower_bound(value)
    left = -1;
    right = self.length;
    while left + 1 < right
      mid = left + (right - left) / 2;
      if self[mid] >= value
        right = mid
      else
        left = mid
      end
    end
    right
  end

  def unique
    res = [self.first]
    each_cons(2) do |a, b|
      if a != b
        res.push(b)
      end
    end
    res
  end
end

def get_ints
  gets.chomp.split.map(&:to_i)
end

def get_ints_minus_one
  get_ints.map { |x| x - 1 }
end

def get_int
  gets.chomp.to_i
end

S = gets.chomp
K = get_int


s_index = S.split('').find_index { |s| s != '1' }

if s_index.nil? || s_index >= K
  puts 1
else
  puts S[s_index]
end
//  [ruby]
require 'pp'
$DEBUG ? define_method(:dpp){|e|pp e} : define_method(:dpp){|e|}

# 入力値を数値で返却する
def gets_i()
  gets.chomp.to_i
end

d = 5000000000000000

s = gets.chomp
k = gets_i

s.chars.each_with_index do |s, i|
  if s != "1"
    puts s
    exit
  elsif i == k - 1
    puts 1
    exit
  end
end