import std.stdio, std.conv, std.string;
import std.algorithm, std.array, std.container;
import std.numeric, std.math;
import core.bitop;

string my_readln() { return chomp(readln()); }

long mod = pow(10, 9) + 7;
long moda(long x, long y) { return (x + y) % mod; }
long mods(long x, long y) { return ((x + mod) - (y % mod)) % mod; }
long modm(long x, long y) { return (x * y) % mod; }

void main()
{
	auto S = my_readln;
	auto tokens = my_readln.split;
	auto K = tokens[0].to!ulong;

	string ans;
	foreach (i, e; S)
	{
		if (i == K || e != '1')
		{
			ans ~= e;
			break;
		}
	}

	writeln(ans);
	stdout.flush();
}