Every year, hundreds of people come to summer camps, they learn new algorithms and solve hard problems.

This is your first year at summer camp, and you are asked to solve the following problem. All integers starting with 1 are written in one line. The prefix of these line is "123456789101112131415...". Your task is to print the n-th digit of this string (digits are numbered starting with 1.


-----Input-----

The only line of the input contains a single integer n (1 ≤ n ≤ 1000) — the position of the digit you need to print.


-----Output-----

Print the n-th digit of the line.


-----Examples-----
Input
3

Output
3

Input
11

Output
0



-----Note-----

In the first sample the digit at position 3 is '3', as both integers 1 and 2 consist on one digit.

In the second sample, the digit at position 11 is '0', it belongs to the integer 10.

Difficulty: EASY
Tags: Implementation

Starter code:

Solutions:
m = int(input())
s = ''
i = 1
while len(s) <= m:
	s += str(i)
	i += 1
print(s[m - 1])


a = int(input())
s = ''
for i in range(1, a + 1):
	s += str(i)
print(s[a - 1])


import math
n = int(input())
lst = list((i for i in range(1, 1001)))
i = 1
tmp_str = ''.join(map(str, lst))
print(tmp_str[n - 1])


import sys
input = sys.stdin.readline
from operator import mul
from functools import reduce

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

def main():
	n = inp()
	s = ''
	for i in range(1, n + 1):
		s += str(i)
	print(s[n - 1])
main()


a = ''
for i in range(1, 1000):
	a += str(i)
n = int(input())
print(a[n - 1])


n = int(input())
s = ''
k = 1
while 1:
	s += str(k)
	if len(s) >= n:
		print(s[n - 1])
		break
	k += 1


n = int(input())
s = ''
i = 1
while len(s) <= n:
	s += str(i)
	i += 1
print(s[n - 1])


n = int(input())
lst = ''
for i in range(1, n + 1):
	lst += str(i)
print(lst[n - 1])


n = int(input())
string = ''
for j in range(1, n + 1):
	string += str(j)
print(string[n - 1])


n = int(input())
l_n = list()
for t_n in range(1, 371):
	t_l_n = list()
	while t_n != 0:
		t_l_n.append(t_n % 10)
		t_n //= 10
	t_l_n.reverse()
	l_n.extend(t_l_n)
print(l_n[n - 1])


s = str(list(range(1, 1000)))[1:-1]
print(s.replace(',', '').replace(' ', '')[int(input()) - 1])


n = int(input())
s = ''
a = 1
for i in range(1, n + 2):
	s = s + str(a)
	a = a + 1
print(s[n - 1])


N = input()
N = int(N)
if N < 10:
	print(N)
elif N < 190:
	k = (N - 9 + 1) // 2 + 9
	k1 = (N - 9) % 2
	if k1 == 0:
		print(k % 10)
	else:
		print(k // 10)
else:
	k = (N - 189 + 2) // 3 + 99
	k1 = (N - 189) % 3
	if k1 == 0:
		print(k % 10)
	elif k1 == 1:
		print(k // 100)
	else:
		print(k // 10 % 10)


a = ''
i = 1
n = int(input())
while len(a) < 1015:
	a += str(i)
	i += 1
print(a[n - 1])


n = int(input())
s = ''
for i in range(n):
	s += str(i + 1)
print(s[n - 1])


n = int(input())
nums = ''
for i in range(1, n + 1):
	nums += str(i)
print(nums[n - 1])


s = str()
for i in range(399):
	s += str(i)
print(s[int(input())])


print(''.join([str(i) for i in range(555)])[int(input())])


n = int(input())
a = ''
for i in range(1010):
	a += str(i)
	if len(a) > n:
		continue
print(a[n])


n = int(input())
s = ''
for x in range(1000):
	s += str(x)
print(s[n])


n = int(input())
s = ''
z = 1
while len(s) < n:
	s += str(z)
	z += 1
print(s[n - 1])


def solve(n):
	data = ''
	i = 0
	while len(data) < 1009:
		i += 1
		data += str(i)
	return data[n - 1]
n = int(input())
print(solve(n))


q = 1
s = ''
while len(s) < 1000:
	s = s + str(q)
	q += 1
print(s[int(input()) - 1])


n = int(input())

def main(n):
	string = ''
	for i in range(n):
		string += str(i + 1)
	return string[n - 1]
print(main(n))


n = int(input())
s = ''.join((str(i) for i in range(1, 1001)))
print(s[n - 1])


n = int(input())
if n <= 9:
	print(n)
elif n <= 189:
	n = n + 10
	if n % 2 == 0:
		n = n // 2
		print(n // 10)
	else:
		n = n // 2
		print(n % 10)
else:
	n = n + 110
	if n % 3 == 0:
		n = n // 3
		print(n // 100)
	elif n % 3 == 1:
		n = n // 3
		n = n // 10
		print(n % 10)
	else:
		n = n // 3
		print(n % 10)


def main():
	x = int(input())
	seq = [str(i) for i in range(1001)]
	seq = ''.join(seq)
	print(seq[x])
main()


import sys
f = sys.stdin
n = int(f.readline().rstrip())
string = []
i = 1
while len(string) <= n:
	for c in str(i):
		string.append(c)
	i = i + 1
print(string[n - 1])


k = int(input())
t = list(range(1, 1001))
l = str()
for i in range(1000):
	l += str(t[i])
print(l[k - 1])


def tedad(n):
	t = 0
	while n != 0:
		n = n // 10
		t = t + 1
	return t
n = int(input())
m = 9
c = 1
while m < n:
	c = c + 1
	m = m + c * (10 ** c - 10 ** (c - 1))
m = m - c * (10 ** c - 10 ** (c - 1))
n = n - m
if n % c == 0:
	h = n // c
else:
	h = n // c + 1
n = n - (h - 1) * c
t = 10 ** (c - 1) + h - 1
while tedad(t) != n:
	t = t // 10
print(t % 10)


string = '123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370'

def main():
	n = int(input())
	print(string[n - 1])
main()


n = int(input())
s = ''
i = 1
while len(s) < n:
	k = str(i)
	for j in range(len(k)):
		s += k[j]
	i += 1
print(s[n - 1])


n = int(input())
a = '123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380'
print(a[n - 1])


n = int(input())
thestring = ''
for i in range(500):
	thestring += str(i)
print(thestring[n])


a = int(input())
b = str('')
x = int(1)
while x <= a:
	b = b + str(x)
	x = x + 1
print(b[a - 1])


N = int(input())
S = ''
for i in range(1, N + 1):
	S += str(i)
print(S[N - 1])


n = int(input())
if n <= 9:
	print(n)
elif n <= 189:
	num = (n - 10) / 2 + 10
	mod = (n - 10) % 2
	s = str(num)
	print(s[mod])
else:
	num = (n - 10 - 90 * 2) / 3 + 100
	mod = (n - 10 - 90 * 2) % 3
	s = str(num)
	print(s[mod])


n = int(input())
t = 1
s = ''
while len(s) < 1000:
	s += str(t)
	t += 1
print(s[n - 1])


print(''.join(map(str, range(1, 1000)))[int(input()) - 1])


a = int(input())
k = ''
p = 1
while len(k) <= a:
	k = k + str(p)
	p += 1
print(k[a - 1])


a = int(input())
st = ''
for i in range(1, a + 1):
	j = str(i)
	st = st + j
print(st[a - 1])


try:
	while True:
		n = int(input())
		print(''.join(map(str, list(range(1, n + 1))))[n - 1])
except EOFError:
	pass


s = '1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000'
print(s[int(input()) - 1])


list1 = []
for i in range(1, 1001):
	if i < 10:
		list1.append(i)
	elif i < 100:
		de1 = int(i / 10)
		de2 = i % 10
		list1.append(de1)
		list1.append(de2)
	elif i < 1000:
		de1 = int(i / 100)
		list1.append(de1)
		de2 = int((i - de1 * 100) / 10)
		list1.append(de2)
		de3 = i % 100 % 10
		list1.append(de3)
n = int(input())
print(list1[n - 1])


x = int(input())
s = ' '
for i in range(1, 1002):
	s += str(i)
print(s[x])


from math import floor, log10
n = int(input())
s = ''
length = 0
i = 1
while length < n:
	s += str(i)
	length += floor(log10(i))
	i += 1
print(s[n - 1])


n = int(input())
cnt = 0
for i in range(1, 999):
	if i > 99:
		cnt += 3
	elif i > 9:
		cnt += 2
	else:
		cnt += 1
	if cnt >= n:
		num = i
		break
if cnt == n:
	ans = int(num % 10)
else:
	pos = cnt - n
	if pos == 1:
		ans = int(int(num / 10) % 10)
	else:
		ans = int(int(num / 100) % 10)
print(ans)


def answer(n):
	res = ''
	for i in range(1, 371):
		res = res + str(i)
	return res[n - 1]
print(answer(int(input())))


n = int(input())
L = ''
for i in range(1, 371):
	L += str(i)
print(L[n - 1])


n = int(input())
k = 1
i = 1
while k < n:
	i += 1
	k += len(str(i))
print(int(str(i)[n - k + len(str(i)) - 1]))


N = 1000
S = ''.join(map(str, range(N)))
print(S[int(input())])


k = int(input())
n = ''
x = 1
while len(n) < 1000:
	n += str(x)
	x += 1
print(n[k - 1])


def sol():
	n = int(input())
	A = ''
	for i in range(1, 1000):
		A += str(i)
	print(A[n - 1])
sol()


n = int(input())
s = ''
for i in range(1, 1005):
	s += str(i)
	if len(s) >= n:
		break
print(s[n - 1])


n = int(input())
s = str.join('', map(str, range(n + 1)))
print(s[n])


n = int(input())
s = ''
for j in range(1, n + 1):
	s = s + str(j)
print(s[n - 1])


a = int(input())
b = []
for i in range(1, 1001):
	i = str(i)
	i = list(i)
	b += i
print(b[a - 1])


n = int(input())
s = ''
i = 1
while True:
	s += str(i)
	if len(s) >= n:
		print(s[n - 1])
		break
	i += 1


n = int(input())
cur = 0
s = ''
for i in range(1, n + 1):
	s += str(i)
	if len(s) >= n:
		print(s[n - 1])
		exit(0)


n = int(input())
arr = ''
for i in range(1, 1001):
	arr = arr + str(i)
print(arr[n - 1])


s = int(input())
a = ''
for i in range(0, 1000):
	a = a + str(i + 1)
print(a[s - 1])


n = int(input())
txt = ''
i = 1
while len(txt) < n:
	txt += str(i)
	i += 1
print(txt[n - 1])


n = int(input())
a = list()
for i in range(1, 372):
	a.append(str(i))
s = ''.join(a)
print(s[n - 1])


n = int(input())
s = ''.join([str(i) for i in range(500)])
print(s[n])


maxn = 1000
s = ''
for i in range(1, maxn):
	s += str(i)
n = int(input())
print(s[n - 1])


s = ''.join([str(i) for i in range(1, 1000)])
print(s[int(input()) - 1])


n = int(input())
a = ''
for i in range(1, 1001):
	a = a + str(i)
print(a[n - 1])


n = int(input())
s = ''
i = 0
while len(s) < 1000:
	i += 1
	s += str(i)
print(s[n - 1])


import sys
import math
import bisect

def main():
	A = []
	for i in range(1, 1000):
		A.append(str(i))
	s = ''.join(A)
	n = int(input())
	print(s[n - 1])
main()


n = int(input())
c = ''
x = 1
while len(c) < n:
	c += str(x)
	x += 1
print(c[n - 1:n])


n = int(input())
a = ''
for i in range(1, 400):
	a = a + str(i)
print(a[n - 1])


counter = 1
s = ''
n = int(input())
while counter <= n + 1:
	s += str(counter)
	counter += 1
print(s[n - 1])


num = ''
n = int(input())
for i in range(1, 10000):
	num += str(i)
print(num[n - 1])


st = ''
for i in range(1, 1000):
	st += str(i)
print(st[int(input()) - 1])


n = int(input())
str1 = ''
for i in range(1, n + 1):
	str1 = str1 + str(i)
print(str1[n - 1])


n = int(input())
l = []
for i in range(1, n + 1):
	l.append(str(i))
s = ''.join(l)
print(s[n - 1])


n = int(input())
string = ''
for i in range(1, n + 1):
	string += str(i)
for (i, j) in enumerate(string):
	if i + 1 == n:
		print(string[i])


n = int(input())
idx = 0
s = ''
while len(s) <= 1001:
	s += str(idx)
	idx += 1
print(s[n])


n = int(input())
s = ''
count = n * 3
for i in range(count):
	s += str(i)
print(s[n])


n = int(input())
if n < 10:
	print(n)
elif n < 190:
	div = n - 10 >> 1
	mod = n - 10 - (div << 1)
	target = 10 + div
	if mod == 0:
		print(int(target / 10))
	else:
		print(target % 10)
else:
	div = int((n - 190) / 3)
	mod = n - 190 - div * 3
	target = 100 + div
	if mod == 0:
		print(int(target / 100))
	elif mod == 2:
		print(target % 10)
	else:
		print(int(target / 10) % 10)


a = map(str, range(1000))
b = ''.join(a)
print(b[int(input())])


num = int(input())
string = ''
for x in range(0, 600):
	string = string + str(x)
print(string[num])


(s, n) = ('1', 2)
while len(s) <= 1000:
	s += str(n)
	n += 1
print(s[int(input()) - 1])


import math
n = int(input())
if 0 < n < 10:
	print(n)
elif 9 < n < 190:
	a = n - 9
	b = str(9 + math.ceil(a / 2))
	print([b[0], b[1]][a % 2 == 0])
else:
	a = n - 189
	b = str(99 + math.ceil(a / 3))
	print(b[a % 3 - 1])


import math
numbers = list(map(int, input().split()))
n = numbers[0]
j = 0
k = 1
L = ''
for k in range(1, 400):
	L = L + str(k)
print(L[n - 1])


n = int(input())
a = []
curr_num = 0
for i in range(1000):
	curr_num += 1
	for j in range(len(str(curr_num))):
		a.append(str(curr_num)[j])
print(a[n - 1])


n = int(input())
a = list(range(1, n + 1))
j = 0
for i in a:
	for k in str(i):
		j += 1
		if j == n:
			print(k)
			break


a = ''.join([str(i) for i in range(1000)])
print(a[int(input())])


l = list()
for i in range(1, 1001):
	k = str(i)
	k = list(k)
	for j in k:
		l.append(j)
n = int(input())
print(l[n - 1])


n = int(input())
nmb = [str(i + 1) for i in range(1000)]
nmb = ''.join(nmb)
print(nmb[n - 1])


n = int(input())
print(''.join(map(str, range(0, 1000)))[n])


import math
n = int(input())

def digits_length(num):
	arr = [0, 10, 100, 1000]
	result = 1
	for (i, a) in enumerate(arr):
		if num >= a:
			result = i + 1
		else:
			break
	return result

def digit_on_position(num, pos):
	if pos > 0:
		num = math.floor(num / 10 ** pos)
	return num % 10
cur = 0
dig = 0
while cur < n:
	dig += 1
	cur += digits_length(dig)
print(digit_on_position(dig, cur - n))


i = int(input())
s = ''.join(map(str, range(400)))
print(s[i])


n = int(input())
if n < 10:
	q = n
elif n < 190:
	k = (n + 10) // 2
	if n % 2 == 0:
		q = k // 10
	else:
		q = k % 10
else:
	k = (n + 110) // 3
	if n % 3 == 1:
		q = k // 100
	elif n % 3 == 2:
		q = k % 100 // 10
	else:
		q = k % 10
print(q)


print(''.join([str(x) for x in range(1, 1000)])[int(input()) - 1])


n = int(input())
s = ''
x = 1
while len(s) < n:
	s += str(x)
	x += 1
print(s[n - 1])


def calculateIntAtPosition(pos):
	numStr = generateNumberString(pos)
	return numStr[pos - 1]

def generateNumberString(number):
	chain = ''
	for x in range(1, number + 1):
		chain += str(x)
	return chain

def solve():
	pos = int(input())
	print(calculateIntAtPosition(pos))
solve()


line = '123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370'
x = int(input())
print(line[x - 1])


ans = ''.join([str(x) for x in list(range(1, 1005))])
print(ans[int(input()) - 1])


n = int(input())
a = 1000
r = []
i = 1
while len(r) <= 1000:
	r.append(i)
	i += 1
r = ''.join(map(str, r))
result = int(r[n - 1])
print(result)


index = '0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999'
print(index[int(input())])


import math
import datetime
from sys import stdin
x = int(input())
news = ''
for m in range(1, 371):
	news += str(m)
print(news[x - 1])


seq = []
indx = 0
for i in range(1, 1001):
	curr = str(i)
	for j in curr:
		seq.append(j)
		indx += 1
print(seq[int(input()) - 1])


n = int(input())
a = ''
for i in range(1000):
	b = str(i)
	a = a + b
print('{}'.format(a[n]))


n = int(input())
k = 0
for i in range(1, 1000):
	k += len(str(i))
	if k >= n:
		print(str(i)[n - k - 1])
		break


n = int(input())
string = ''
i = 1
while len(string) < n:
	string += str(i)
	i += 1
print(string[n - 1])


l = []
for i in range(1, 1001):
	l.append(i)
l = ''.join(map(str, l))
n = int(input())
print(l[n - 1])


n = int(input())
if n < 10:
	print(n)
elif n < 190:
	n -= 9
	m = 9 + (n - 1) // 2 + 1
	if n % 2:
		print(m // 10)
	else:
		print(m % 10)
else:
	n -= 189
	m = 99 + (n - 1) // 3 + 1
	if n % 3 == 0:
		print(m % 10)
	elif n % 3 == 1:
		print(m // 100)
	else:
		print(m // 10 % 10)


n = int(input())
number = '10'
digit = '9'
start_number = 0
total_digits = 0
digits = 1
count = 0
while True:
	total_digits_condition = total_digits + int('9' + '0' * count) * (count + 1)
	if total_digits_condition > n:
		count -= 1
		break
	else:
		start_number += int(digit + '0' * count)
		total_digits += int(digit + '0' * count) * (count + 1)
		number = str(number) + '0'
		count += 1
		digits += 1
difference = n - total_digits
offset_numbers = difference // digits
remainder = difference % digits
if count >= 0:
	final_number = int('9' * (count + 1)) + offset_numbers + 1
else:
	final_number = offset_numbers + 1
if remainder == 0:
	result = str(final_number - 1)[-1]
else:
	result = str(final_number)[remainder - 1]
print(result)


s = ''
for i in range(1000):
	s += str(i)
n = int(input())
print(s[n])


import sys
import string

def main():
	n = int(sys.stdin.readline())
	print(''.join([str(i) for i in range(1, 1000)])[n - 1])
main()


import sys
import math
get_string = lambda : sys.stdin.readline().strip()
get_int_list = lambda : list(map(int, sys.stdin.readline().strip().split()))
get_intList_from_str = lambda : list(map(int, list(sys.stdin.readline().strip())))
get_charList_from_str = lambda : list(sys.stdin.readline().strip())
get_char_list = lambda : sys.stdin.readline().strip().split()
get_int = lambda : int(sys.stdin.readline().strip())
pt = lambda x: sys.stdout.write(str(x))
n = get_int()
s = ''
num = 1
while len(s) < n:
	s += str(num)
	num += 1
print(s[n - 1])


lista = list(map(str, range(1, 1001)))
string = ''.join(lista)
n = int(input())
print(string[n - 1])


number = int(input())
string = ''
for i in range(1, number + 1):
	string += str(i)
print(string[number - 1])


b = int(input())
a = str(0)
i = 1
while i < 400:
	a = a + str(i)
	i = i + 1
print(a[b])


s = 0
n = int(input())
i = 1
goon = True
while goon:
	for j in str(i):
		s += 1
		if s == n:
			print(j)
			goon = False
			break
	i += 1


n = int(input())
st = ''
i = 1
while len(st) <= n:
	st += str(i)
	i += 1
print(st[n - 1])


num = int(input())
num_seq = ''.join([str(i) for i in range(1, num + 1)])
print(num_seq[num - 1])


import math
n = int(input())
string = ''
for i in range(1, 1000):
	string += str(i)
print(string[n - 1])


n = int(input())
arr = list(map(str, range(n + 5)))
st = ''
for i in arr:
	st += i
print(st[n])


i = 1
n = int(input())
line = ''
while i <= n:
	l = str(i)
	line = line + l
	i = i + 1
line = list(line)
print(line[n - 1])


n = int(input())
s = ''
n2 = 0
for i in range(1, 1000):
	i = str(i)
	n2 += len(i)
	s += i
	if n2 > n:
		print(s[n - 1])
		break


N = int(input())
s = ''
for i in range(1, N + 1):
	s += str(i)
print(s[N - 1])


x = input()
x = int(x)
t = ''
for i in range(1, 1000, 1):
	t += str(i)
print(t[x - 1])


import math, sys, re, itertools
(rs, ri, rai) = (input, lambda : int(input()), lambda : list(map(int, input().split())))
s = '0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370'
print(s[ri()])


n = int(input())
str = ''.join(list(map(str, range(1, n + 1))))
print(str[n - 1])


__author__ = 'aste'

def main():
	n = int(input())
	l = 0
	i = 1
	while i <= n:
		s = str(i)
		sn = len(s)
		l += sn
		if l >= n:
			print(s[n - (l - sn) - 1])
			break
		i += 1
main()


n = int(input())
r = '123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370'
print(r[n - 1])


res = '123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370'
n = int(input())
print(res[n - 1])


def fill_arr(n, m):
	return [str(x) for x in range(n, m)]
n = int(input())
arr = fill_arr(1, 371)
arr = ''.join(arr)
print(arr[n - 1])


s = input()
x = str()
for i in range(1, 1000):
	x += str(i)
print(x[int(s) - 1])


n = int(input())
A = ''
for i in range(1, n + 1):
	A += str(i)
print(A[n - 1])


ans = ''
for i in range(1, 1000):
	ans += str(i)
n = int(input())
print(ans[n - 1])


u = int(input())
g = 1
r = ''
for i in range(1, u + 1):
	r = r + str(i)
print(r[u - 1])


def p1():
	l = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47]
	a = []
	for i in range(15):
		print(l[i])
		a.append(input())
	if a.count('yes') >= 2:
		print('composite')
	elif a.count('yes') == 0:
		print('prime')
	elif a.count('yes') == 1:
		i = 0
		for j in range(15):
			if a[j] == 'yes':
				i = j
				break
		print(l[i] * l[i])
		b = input()
		if b == 'yes':
			print('composite')
		else:
			print('prime')

def p2():
	n = int(input())
	a = ''
	b = 1
	while len(a) < n:
		a = a + str(b)
		b = b + 1
	print(a[n - 1])

def p3():
	n = int(input())
	print(n // 7 * 2, n // 7 * 2 + min(2, n % 7))

def p4():
	(a, b, c) = [int(i) for i in input().split()]
	if a > c:
		print('NO')
	elif a == c:
		print('YES')
	elif c - a >= b and ((c - a) % b == 0 or (c - a) % b == 1):
		print('YES')
	else:
		print('NO')

def p5():
	(a, b) = input().split()
	if a == b:
		print(a)
	else:
		print(1)
p2()


n = int(input().strip())
ll = ''
for i in range(1, 1001):
	ll = ll + str(i)
print(ll[n - 1])


n = int(input())
s = ''
for i in range(2000):
	s += '{}'.format(i)
print(s[n])


import sys
n = int(input())
c = 0
k = 1
while True:
	for i in range(len(str(k))):
		c += 1
		if c == n:
			print(str(k)[i])
			sys.exit()
	k += 1


def main():
	n = int(input())
	s = '123456789'
	x = 10
	n -= 1
	while len(s) <= n:
		s += str(x)
		x += 1
	print(s[n])
main()


n = int(input())
seq = []
i = 1
while i < 400:
	digits = list(str(i))
	for d in digits:
		seq.append(d)
	i += 1
print(seq[n - 1])


def main():
	numbers = ''
	for i in range(1001):
		numbers += str(i)
	num = int(input())
	print(numbers[num])
main()


r = ''
for i in range(1, 1001):
	r += str(i)
n = int(input())
print(r[n - 1])


n = int(input())
v = []
for i in range(1, 500):
	s = str(i)
	v.append(s)
z = ''.join(v)
print(z[n - 1])


s = '123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370'
print(s[int(input()) - 1])


n = int(input())
ex = ''
for i in range(1, n + 1):
	ex += str(i)
print(ex[n - 1])


m1 = 'abcdefghijklmnopqrstuvwxyz'
m2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
cond = ['No', 'Yes']
Cond = ['NO', 'YES']
n = input()
n = int(n)
s = ''
for i in range(10000):
	s += str(i + 1)
print(s[n - 1])


n = int(input())
for i in range(1, 1000):
	if len(str(i)) < n:
		n -= len(str(i))
	else:
		print(str(i)[n - 1])
		break


S = ''.join((str(x) for x in range(371)))
print(S[int(input())])


st = ''
n = 1
while len(st) < 1000:
	st += str(int(n))
	n += 1
n = int(input())
print(st[n - 1])


n = int(input())
v = ''
for i in range(1, n + 1):
	v = v + str(i)
print(v[n - 1])


s = ''
for i in range(1, 500):
	s += str(i)
print(s[int(input()) - 1])


n = int(input())
x = ''
for i in range(1, 1001):
	x = x + str(i)
print(x[n - 1])


(a, b) = (int(input()), '')
for i in range(1000):
	b += str(i)
print(b[a])


n = int(input())
l = ''
c = -1
for i in range(500):
	l += str(i)
for i in l:
	c += 1
	if c == n:
		print(i)


N = int(input())
List = [None]
for wi in range(1, 500):
	for c in str(wi):
		List.append(c)
	if len(List) > 1000:
		break
print(List[N])


k = []
for i in range(1, 1001):
	k.append(str(i))
s = ''.join(k)
print(s[int(input()) - 1])


v = int(input())
s = ''
num = 1
while len(s) < 1000:
	s += str(num)
	num += 1
print(int(s[v - 1]))


n = int(input())
x = [str(i) for i in list(range(1, 1000))]
print(''.join(x)[n - 1])


s = []
for i in range(1, 400):
	l = str(i)
	for j in l:
		s.append(j)
s1 = ''.join(s)
n = int(input())
print(s[n - 1])


def main():
	s = ''.join([str(x + 1) for x in range(1000)])
	n = int(input())
	print(s[n - 1])
main()


n = int(input())
for i in range(1, 1001):
	s = str(i)
	l = len(s)
	if n <= l:
		print(s[n - 1])
		exit()
	else:
		n -= l


l = list((x for x in range(1, 1001)))
l = ''.join(map(str, l))
k = int(input())
print(l[k - 1])


print(''.join([str(i) for i in range(1, 1001)])[int(input()) - 1])


__author__ = 'Ryabchun Vladimir'
n = int(input())
line = ''
pointer = 1
while len(line) <= n:
	line += str(pointer)
	pointer += 1
print(line[n - 1])


out = ''
for i in range(1001):
	out += str(i)
n = int(input())
print(out[n])


n = int(input())
a = []
for i in range(1, 1100):
	a.extend(list(str(i)))
print(a[n - 1])


def main():
	n = int(input())
	s = ''
	ind = 1
	while len(s) < n:
		s += str(ind)
		ind += 1
	print(s[n - 1])
main()


print(''.join(map(str, range(1, 1001)))[int(input()) - 1])


n = int(input())
dl = 0
i = 0
while dl < n:
	i += 1
	dl += len(str(i))
print(str(i)[-(dl - n + 1)])


print(''.join([str(x) for x in range(555)])[int(input())])


a = int(input())
i = ''
number = 1
while len(i) < a:
	i += str(number)
	number += 1
print(i[a - 1])


i = 2
s = '1'
while len(s) < 1005:
	s += str(i)
	i += 1
n = int(input())
print(s[n - 1])


while 1:
	try:
		n = int(input())
	except:
		break
	for s in map(str, range(1000)):
		if n < len(s):
			print(s[n])
			break
		else:
			n -= len(s)


def main():
	n = int(input())
	print(''.join([str(i) for i in range(1, n + 1)])[n - 1])
main()


n = int(input())
array = []
for i in range(1, 371):
	array.append(str(i))
print(''.join(array)[n - 1])


s = ''
i = 0
while len(s) <= 1010:
	i += 1
	s += str(i)
n = int(input())
print(s[n - 1])


n = int(input())
c = ''
for i in range(1, n + 1):
	c += str(i)
print(c[n - 1])


n = int(input())
s = ''
for _ in range(1, n + 1):
	s += str(_)
print(s[n - 1])


t = int(input())
st = ''.join((str(i) for i in range(1, t + 1)))
print(st[t - 1])


num = int(input())
x = 1
st = str(x)
while len(st) < num:
	x += 1
	st += str(x)
print(st[num - 1])


n = int(input())
st = ''
for i in range(1, 400):
	st += str(i)
print(st[n - 1])


import sys
numbers = ''
for i in range(1, 371):
	numbers += str(i)
index = int(sys.stdin.read())
print(numbers[index - 1])


n = int(input())
a = ''
for i in range(1, 1001):
	a += str(i)
	if len(a) >= n:
		print(a[n - 1])
		break


n = int(input())
ans = ''
c = 1
while len(ans) <= n:
	ans += str(c)
	c += 1
print(ans[n - 1])


s = ''
for i in range(0, 1000):
	s += str(i)
print(s[int(input())])


a = [str(x) for x in range(0, 371)]
print(''.join(a)[int(input())])


def findNth(n):
	cur = 0
	while n > 9 * 10 ** cur * (cur + 1):
		n -= 9 * 10 ** cur * (cur + 1)
		cur += 1
	cur += 1
	nth = (n - 1) // cur
	num = 10 ** (cur - 1) + nth
	print(str(num)[(n - 1) % cur], end=' ')
findNth(int(input()))


n = int(input())
a = ''
for j in range(375):
	a = a + str(j)
print(a[n])


n = int(input())
if n >= 1 and n <= 9:
	print(n)
elif n >= 10 and n <= 189:
	a = n - 10
	if a % 2 == 0:
		print(str(n - a // 2)[0])
	else:
		print(str(n - (a // 2 + 1))[1])
elif n >= 190 and n <= 999:
	a = n - 190
	print(str(100 + a // 3)[a % 3])
elif n == 1000:
	print('3')


import unittest
import sys

class Camp:

	def __init__(self, test_inputs=None):
		it = iter(test_inputs.split('\n')) if test_inputs else None

		def uinput():
			return next(it) if it else sys.stdin.readline().rstrip()
		[self.n] = map(int, uinput().split())

	def calculate(self):
		line = ''
		for i in range(400):
			line += str(i)
		result = line[self.n]
		return str(result)

class unitTests(unittest.TestCase):

	def test_single_test(self):
		test = '3'
		d = Camp(test)
		self.assertEqual(d.n, 3)
		self.assertEqual(Camp(test).calculate(), '3')
		test = '11'
		self.assertEqual(Camp(test).calculate(), '0')
		test = ''
		test = ''

	def time_limit_test(self, nmax):
		import random
		import timeit
		test = str(nmax) + ' ' + str(nmax) + '\n'
		numnums = [str(i) + ' ' + str(i + 1) for i in range(nmax)]
		test += '\n'.join(numnums) + '\n'
		nums = [random.randint(1, 10000) for i in range(nmax)]
		test += ' '.join(map(str, nums)) + '\n'
		start = timeit.default_timer()
		d = Camp(test)
		calc = timeit.default_timer()
		d.calculate()
		stop = timeit.default_timer()
		print('\nTimelimit Test: ' + '{0:.3f}s (init {1:.3f}s calc {2:.3f}s)'.format(stop - start, calc - start, stop - calc))
sys.setrecursionlimit(100000)
if sys.argv[-1] == '-ut':
	unittest.main(argv=[' '])
sys.stdout.write(Camp().calculate())


__author__ = 'Dilshod'
n = int(input())
digit = ''
for i in range(1, 1001):
	digit += str(i)
print(digit[n - 1])


n = int(input())
L = ''.join([str(k) for k in range(1, n + 1)])
print(L[n - 1])


stri = ''
for i in range(1, 1000):
	stri += str(i)
num = int(input())
print(stri[num - 1])


n = int(input())
string = ''
for i in range(1, n + 1):
	string += str(i)
	if len(string) >= n:
		print(string[n - 1])
		break


import random
n = int(input())
s = ''
x = 1
while len(s) <= 1000:
	s += str(x)
	x += 1
print(s[n - 1])


n = int(input())
if n <= 9:
	print(n)
elif n <= 189:
	if n % 2 == 0:
		a = str((n - 9) // 2 + 10)
		print(a[:1])
	else:
		a = str((n - 10) // 2 + 10)
		print(a[1:])
else:
	a = n - 189
	if a % 3 == 0:
		b = str(a // 3 + 99)
		print(b[2:])
	else:
		b = str(a // 3 + 100)
		if a % 3 == 2:
			print(b[1])
		else:
			print(b[0])


x = int(input())
l = [i for i in range(1, 2001)]
s = ''.join(map(str, l))
for i in range(1, len(s) + 1):
	print(s[x - 1])
	break


st = ''
for i in range(1, 1001):
	st = st + str(i)
n = int(input())
print(st[n - 1])


s = '0'
a = 1
while len(s) <= 1000:
	s += str(a)
	a += 1
n = int(input())
print(s[n])


n = int(input())
s = ''
for i in range(400):
	s += str(i)
print(s[n])


s = ''
for i in range(1, 1001):
	s += str(i)
p = int(input())
print(s[p - 1])


data = '1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000'
print(data[int(input()) - 1])


print(''.join(map(str, range(555)))[int(input())])


numbers = []
full = ''
for i in range(1, 1000):
	numbers.append(i)
	full += str(numbers[i - 1])
n = int(input())
print(full[n - 1])


chislo = int(input())
stroka = ''
increment = 1
while len(stroka) < chislo:
	stroka += str(increment)
	increment += 1
print(stroka[chislo - 1])


def main():
	n = int(input())
	print(''.join(map(str, list(range(0, 1000))))[n])

def __starting_point():
	main()
__starting_point()


s = ''
for i in range(10000):
	s = s + str(i)
n = int(input())
print(s[n])


a = int(input(''))
dat = ''
cou = 1
for i in range(a):
	dat = dat + str(cou)
	cou = cou + 1
print(dat[a - 1])


n = int(input())
empty = ' '
for i in range(1, n + 1):
	empty += str(i)
print(empty[n])


string = ''
a = 1
n = int(input())
while True:
	string = string + str(a)
	a = a + 1
	if len(string) >= n:
		break
print(string[n - 1])


n = [int(i) for i in input().split()][0]
a = ''
for i in range(n):
	a += str(i + 1)
print(a[n - 1])


import sys
n = int(input())
s = ''
st = 1
while 1 == 1:
	s += str(st)
	if len(s) >= n:
		print(s[n - 1])
		sys.exit()
	st += 1


n = int(input())
if n < 10:
	print(n)
else:
	s = ''
	for i in range(10, 10 + n // 2):
		s += str(i)
	for i in range(int(len(s))):
		if i == n - 10:
			print(s[i])
			break


qi = lambda : int(input())
qs = lambda : input().split()
n = qi()
print(''.join((str(i) for i in range(1, n + 1)))[n - 1])


import os
s = ''
n = int(input())
k = 1
while len(s) < n:
	s += str(k)
	k += 1
print(s[n - 1])


n = int(input())
x = []
for i in range(1, 1001):
	x.append(str(i))
z = ''.join(x)
print(z[n - 1])


import math
t = int(input())
i = 1
s = ''
while i <= t:
	s = s + str(i)
	i = i + 1
print(s[t - 1])


n = int(input())
i = 1
count = 1
while count <= n:
	for j in range(len(str(i))):
		if count == n:
			print(str(i)[j])
		result = str(i)[j]
		count += 1
	i += 1


s = ''
for i in range(388):
	s += str(i)
n = int(input())
print(s[n])


n = int(input())
i = 1
string = '0'
while i <= n:
	string += str(i)
	i += 1
print(string[n])


x = int(input())
l = []
if x < 9:
	print(x)
else:
	for i in range(1, x + 1):
		[l.append(i) for i in str(i)]
	print(l[x - 1])


full = ''
for i in range(1, 400):
	full += str(i)
n = int(input())
print(full[n - 1])


line = ''
for i in range(1000):
	line += str(i)
print(line[int(input())])


def p1(n):
	intlist = []
	for i in range(1, n + 2):
		intlist.append(str(i))
	intstr = ''.join(intlist)
	return str(intstr[n - 1])
inp = input()
print(p1(int(inp)))


x = int(input())
data = []
for i in range(1, x + 1):
	data.append(str(i))
st = ''.join(data)
print(st[x - 1])


n = int(input())
count = n
for i in range(n + n):
	if count < len(str(i)):
		print(str(i)[count])
		break
	else:
		count -= len(str(i))


import sys
n = int(input())
s = ''
for i in range(1, n + 1):
	s += str(i)
print(s[n - 1])


l = ' '
for i in range(1, 1000):
	l += str(i)
n = int(input())
print(l[n])


n = int(input())
l = ''
t = 1
while len(l) < n:
	l += str(t)
	t += 1
print(l[n - 1])


n = int(input())
l = ''
num = 1
while len(l) <= n:
	l += str(num)
	num += 1
print(l[n - 1])


ln = int(input())
s = ''
i = 1
while len(s) < ln:
	s += str(i)
	i += 1
print(s[ln - 1])


n = int(input())
s = ''
count = 1
while len(s) < 1001:
	s += str(count)
	count += 1
print(s[n - 1])


n = int(input())
temp = ''
for i in range(1, 501):
	temp += str(i)
print(temp[n - 1])


from sys import stdin
inFile = stdin
tokens = []
tokens_next = 0

def next_str():
	global tokens, tokens_next
	while tokens_next >= len(tokens):
		tokens = inFile.readline().split()
		tokens_next = 0
	tokens_next += 1
	return tokens[tokens_next - 1]

def nextInt():
	return int(next_str())
s = ''
i = 1
while len(s) <= 1000:
	s += str(i)
	i += 1
print(s[nextInt() - 1])


l = ''
for i in range(1, 1001):
	l = l + str(i)
n = int(input())
print(l[n - 1])


s = ''
for i in range(600):
	s += str(i)
n = int(input())
print(s[n])


str = '1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693'
print(str[int(input()) - 1])


import math

def solve():
	n = int(input())
	if n <= 9:
		print(n)
	elif n <= 189:
		num = (n - 10) / 2 + 10
		mod = (n - 10) % 2
		s = str(num)
		print(s[mod])
	else:
		num = (n - 10 - 90 * 2) / 3 + 100
		mod = (n - 10 - 90 * 2) % 3
		s = str(num)
		print(s[mod])

def main():
	t = 1
	for _ in range(t):
		solve()
main()


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
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 [int(x) for x in sys.stdin.readline().split()]

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 pf(s):
	return print(s, flush=True)

def main():
	n = I()
	a = []
	for i in range(1, 1000):
		a.append(i)
	s = ''.join(map(str, a))
	return s[n - 1]
print(main())


n = int(input())
S = ''
for i in range(1001):
	S = S + str(i)
print(S[n])


i = ''
j = 1
while j < 500:
	i += str(j)
	j += 1
val = int(input())
print(i[val - 1])


n = int(input())
z = ''
for x in range(1, n + 1):
	z += str(x)
print(z[n - 1])


x = int(input())
if x <= 9:
	print(x)
else:
	i = 0
	r = 0
	while x >= r:
		r = r + (i + 1) * 9 * 10 ** i
		if x <= r:
			break
		i = i + 1
	s = x - r + (i + 1) * int(9 * 10 ** i)
	s1 = int(s / (i + 1))
	s2 = int(s % (i + 1))
	if s2 != 0:
		k = int('9' * i) + s1 + 1
		r1 = i + 1 - s2
		for i in range(r1):
			k = int(k / 10)
		print(k % 10)
	else:
		k = int('9' * i) + s1
		print(k % 10)


n = int(input())
S = ''
for i in range(500):
	S += str(i)
print(S[n])


position = int(input())
s = ''
for i in range(1, 1001):
	s += str(i)
print(s[position - 1])


a = ''
for i in range(1, 1001):
	a += str(i)
inter = int(input())
print(a[inter - 1])


line = str()
for i in range(1, 400):
	line += str(i)
n = int(input())
print(line[n - 1])


n = int(input())
a = ''
i = 1
while i <= n:
	a += str(i)
	i += 1
print(a[n - 1])


STR = ''
N = int(input())
for _ in range(1, N + 1):
	STR += str(_)
print(STR[N - 1])


a = int(input())
list = []
for q in range(1, a + 1):
	q = str(q)
	list.append(q)
c = ''.join(list)
print(c[a - 1])


s = ''.join([str(x) for x in range(1000)])
print(s[int(input())])


s = ''
for i in range(1, 400):
	s += str(i)
print(s[int(input()) - 1])


print(''.join((str(x) for x in range(1, 500)))[int(input()) - 1])


cheat = '123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370'
print(cheat[int(input()) - 1])


def main():
	n = int(input())
	ans = ''
	for i in range(1, n + 1):
		ans += str(i)
		if len(ans) > n:
			break
	print(ans[n - 1])
main()


def main():
	s = ''
	i = 1
	while len(s) <= 1009:
		s += str(i)
		i += 1
	print(s[int(input()) - 1])
main()


l = ''
k = int(input())
index = 0
counter = 1
while True:
	for i in str(counter):
		if index <= k - 1:
			l += i
			index += 1
	counter += 1
	if index > k - 1:
		break
if 1 <= k <= 1000:
	print(l[k - 1])


import time
n = int(input()) - 1
start = time.time()
now = 1
k = 1
while n > 9 * now * k:
	n -= 9 * now * k
	now *= 10
	k += 1
ans = str(now + n // k)
print(ans[n % k])
finish = time.time()


def f(n):
	if n < 9:
		return n
	elif n < 10 + 9 * 10 * 2:
		x = (n - 10) // 2 + 10
		if n % 2 == 0:
			return x // 10
		else:
			return x % 10
	else:
		prev = 10 + 9 * 10 * 2
		x = (n - prev) // 3 + 100
		if n % 3 == 0:
			return x % 10
		elif n % 3 == 1:
			return x // 100
		elif n % 3 == 2:
			return x // 10 % 10
n = int(input())
ans = f(n)
print(ans)


f = lambda : map(int, input().split())
n = int(input())
s = ''
for i in range(1, 371):
	s += str(i)
print(s[n - 1])


n = int(input())
s = ''
for i in range(1, 1000):
	s += str(i)
	if len(s) >= 1001:
		break
print(s[n - 1])


import math
from fractions import Fraction as frac
MOD = 1000000000.0 + 7

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	return a * b // gcd(a, b)

def solve(case_no):
	n = int(input())
	s = ''
	for i in range(1, n + 1):
		s += str(i)
	print(s[n - 1])
t = 1
for i in range(1, t + 1):
	solve(i)


z = int(input())
s = ''
for i in range(z):
	s = s + str(i + 1)
print(s[z - 1])


n = int(input())
res = ''
for i in range(1000):
	res += str(i)
print(res[n])


import math
position = int(input())
length = 0
number = ''
n = 1
while length <= position - 1:
	number = number + str(n)
	length = length + int(len(str(n)))
	n = n + 1
print(number[position - 1])


__author__ = 'Rushil'
req_num = ''.join(list(map(str, list(range(1, 1001)))))
n = int(input().strip())
print(req_num[n - 1])


index = int(input())
numbers = [x for x in range(1, index + 1)]
number_line = ''.join(map(str, numbers))
print(number_line[index - 1])


from collections import *
from math import *
from itertools import *
import os
import sys
from io import BytesIO, IOBase

def splint():
	return map(int, input().split())

def PRINT(check: bool, first: str, second: str):
	print(first if check else second)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def main():
	n = int(input())
	if n <= 9:
		print(n)
	elif n <= 189:
		dummy = n - 9
		num = str(ceil(dummy / 2) + 9)
		PRINT(dummy % 2 == 0, num[1], num[0])
	else:
		dummy = n - 189
		num = str(ceil(dummy / 3) + 99)
		dummy %= 3
		if dummy == 1:
			print(num[0])
		elif dummy == 2:
			print(num[1])
		elif dummy == 0:
			print(num[2])
main()


n = int(input(''))
res = ''
i = 0
while len(res) <= n:
	res += str(i)
	i += 1
print(res[n])


n = int(input())
if n < 10:
	print(n)
elif n < 190:
	if n & 1:
		print((n - 10 >> 1) % 10)
	else:
		print((n + 10) // 20)
else:
	n -= 190
	(q, r) = divmod(n, 3)
	n = 100 + q
	s = str(n)
	print(s[r])


n = int(input())
r = [i for i in range(1, 700)]
s = ''.join(map(str, r))
print(s[n - 1])


read = lambda : list(map(int, input().split()))
n = int(input())
a = [i for i in range(1, 1000)]
b = ''.join(map(str, a))
print(b[n - 1])


__author__ = 'artyom'

def main():
	n = read()
	if n <= 9:
		return n
	n -= 9
	if n <= 180:
		x = 10 + (n - 1 >> 1)
		return x // 10 if n & 1 else x % 10
	n -= 180
	x = 100 + (n - 1) // 3
	n %= 3
	if n == 0:
		return x % 10
	if n == 1:
		return x // 100
	return x % 100 // 10

def read(mode=1, size=None):
	if mode == 0:
		return input().strip()
	if mode == 1:
		return int(input().strip())
	if mode == 2:
		return input().strip().split()
	if mode == 3:
		return list(map(int, input().strip().split()))
	a = []
	for _ in range(size):
		a.append(read(3))
	return a

def write(s='\n'):
	if s is None:
		s = ''
	if isinstance(s, tuple) or isinstance(s, list):
		s = ' '.join(map(str, s))
	s = str(s)
	print(s, end='\n')
write(main())


x = int(input())
a = list(map(str, [i for i in range(1, x + 1)]))
b = ''
for i in range(x):
	b = b + a[i]
print(b[x - 1])


listOfNumberDigits = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '1', '0', '1', '1', '1', '2', '1', '3', '1', '4', '1', '5', '1', '6', '1', '7', '1', '8', '1', '9', '2', '0', '2', '1', '2', '2', '2', '3', '2', '4', '2', '5', '2', '6', '2', '7', '2', '8', '2', '9', '3', '0', '3', '1', '3', '2', '3', '3', '3', '4', '3', '5', '3', '6', '3', '7', '3', '8', '3', '9', '4', '0', '4', '1', '4', '2', '4', '3', '4', '4', '4', '5', '4', '6', '4', '7', '4', '8', '4', '9', '5', '0', '5', '1', '5', '2', '5', '3', '5', '4', '5', '5', '5', '6', '5', '7', '5', '8', '5', '9', '6', '0', '6', '1', '6', '2', '6', '3', '6', '4', '6', '5', '6', '6', '6', '7', '6', '8', '6', '9', '7', '0', '7', '1', '7', '2', '7', '3', '7', '4', '7', '5', '7', '6', '7', '7', '7', '8', '7', '9', '8', '0', '8', '1', '8', '2', '8', '3', '8', '4', '8', '5', '8', '6', '8', '7', '8', '8', '8', '9', '9', '0', '9', '1', '9', '2', '9', '3', '9', '4', '9', '5', '9', '6', '9', '7', '9', '8', '9', '9', '1', '0', '0', '1', '0', '1', '1', '0', '2', '1', '0', '3', '1', '0', '4', '1', '0', '5', '1', '0', '6', '1', '0', '7', '1', '0', '8', '1', '0', '9', '1', '1', '0', '1', '1', '1', '1', '1', '2', '1', '1', '3', '1', '1', '4', '1', '1', '5', '1', '1', '6', '1', '1', '7', '1', '1', '8', '1', '1', '9', '1', '2', '0', '1', '2', '1', '1', '2', '2', '1', '2', '3', '1', '2', '4', '1', '2', '5', '1', '2', '6', '1', '2', '7', '1', '2', '8', '1', '2', '9', '1', '3', '0', '1', '3', '1', '1', '3', '2', '1', '3', '3', '1', '3', '4', '1', '3', '5', '1', '3', '6', '1', '3', '7', '1', '3', '8', '1', '3', '9', '1', '4', '0', '1', '4', '1', '1', '4', '2', '1', '4', '3', '1', '4', '4', '1', '4', '5', '1', '4', '6', '1', '4', '7', '1', '4', '8', '1', '4', '9', '1', '5', '0', '1', '5', '1', '1', '5', '2', '1', '5', '3', '1', '5', '4', '1', '5', '5', '1', '5', '6', '1', '5', '7', '1', '5', '8', '1', '5', '9', '1', '6', '0', '1', '6', '1', '1', '6', '2', '1', '6', '3', '1', '6', '4', '1', '6', '5', '1', '6', '6', '1', '6', '7', '1', '6', '8', '1', '6', '9', '1', '7', '0', '1', '7', '1', '1', '7', '2', '1', '7', '3', '1', '7', '4', '1', '7', '5', '1', '7', '6', '1', '7', '7', '1', '7', '8', '1', '7', '9', '1', '8', '0', '1', '8', '1', '1', '8', '2', '1', '8', '3', '1', '8', '4', '1', '8', '5', '1', '8', '6', '1', '8', '7', '1', '8', '8', '1', '8', '9', '1', '9', '0', '1', '9', '1', '1', '9', '2', '1', '9', '3', '1', '9', '4', '1', '9', '5', '1', '9', '6', '1', '9', '7', '1', '9', '8', '1', '9', '9', '2', '0', '0', '2', '0', '1', '2', '0', '2', '2', '0', '3', '2', '0', '4', '2', '0', '5', '2', '0', '6', '2', '0', '7', '2', '0', '8', '2', '0', '9', '2', '1', '0', '2', '1', '1', '2', '1', '2', '2', '1', '3', '2', '1', '4', '2', '1', '5', '2', '1', '6', '2', '1', '7', '2', '1', '8', '2', '1', '9', '2', '2', '0', '2', '2', '1', '2', '2', '2', '2', '2', '3', '2', '2', '4', '2', '2', '5', '2', '2', '6', '2', '2', '7', '2', '2', '8', '2', '2', '9', '2', '3', '0', '2', '3', '1', '2', '3', '2', '2', '3', '3', '2', '3', '4', '2', '3', '5', '2', '3', '6', '2', '3', '7', '2', '3', '8', '2', '3', '9', '2', '4', '0', '2', '4', '1', '2', '4', '2', '2', '4', '3', '2', '4', '4', '2', '4', '5', '2', '4', '6', '2', '4', '7', '2', '4', '8', '2', '4', '9', '2', '5', '0', '2', '5', '1', '2', '5', '2', '2', '5', '3', '2', '5', '4', '2', '5', '5', '2', '5', '6', '2', '5', '7', '2', '5', '8', '2', '5', '9', '2', '6', '0', '2', '6', '1', '2', '6', '2', '2', '6', '3', '2', '6', '4', '2', '6', '5', '2', '6', '6', '2', '6', '7', '2', '6', '8', '2', '6', '9', '2', '7', '0', '2', '7', '1', '2', '7', '2', '2', '7', '3', '2', '7', '4', '2', '7', '5', '2', '7', '6', '2', '7', '7', '2', '7', '8', '2', '7', '9', '2', '8', '0', '2', '8', '1', '2', '8', '2', '2', '8', '3', '2', '8', '4', '2', '8', '5', '2', '8', '6', '2', '8', '7', '2', '8', '8', '2', '8', '9', '2', '9', '0', '2', '9', '1', '2', '9', '2', '2', '9', '3', '2', '9', '4', '2', '9', '5', '2', '9', '6', '2', '9', '7', '2', '9', '8', '2', '9', '9', '3', '0', '0', '3', '0', '1', '3', '0', '2', '3', '0', '3', '3', '0', '4', '3', '0', '5', '3', '0', '6', '3', '0', '7', '3', '0', '8', '3', '0', '9', '3', '1', '0', '3', '1', '1', '3', '1', '2', '3', '1', '3', '3', '1', '4', '3', '1', '5', '3', '1', '6', '3', '1', '7', '3', '1', '8', '3', '1', '9', '3', '2', '0', '3', '2', '1', '3', '2', '2', '3', '2', '3', '3', '2', '4', '3', '2', '5', '3', '2', '6', '3', '2', '7', '3', '2', '8', '3', '2', '9', '3', '3', '0', '3', '3', '1', '3', '3', '2', '3', '3', '3', '3', '3', '4', '3', '3', '5', '3', '3', '6', '3', '3', '7', '3', '3', '8', '3', '3', '9', '3', '4', '0', '3', '4', '1', '3', '4', '2', '3', '4', '3', '3', '4', '4', '3', '4', '5', '3', '4', '6', '3', '4', '7', '3', '4', '8', '3', '4', '9', '3', '5', '0', '3', '5', '1', '3', '5', '2', '3', '5', '3', '3', '5', '4', '3', '5', '5', '3', '5', '6', '3', '5', '7', '3', '5', '8', '3', '5', '9', '3', '6', '0', '3', '6', '1', '3', '6', '2', '3', '6', '3', '3', '6', '4', '3', '6', '5', '3', '6', '6', '3', '6', '7', '3', '6', '8', '3', '6', '9', '3', '7', '0']
print(listOfNumberDigits[int(input()) - 1])


A = list(''.join(list((str(x) for x in range(1, 1001)))))
print(A[int(input()) - 1])


n = int(input())
c = ''
for i in range(1000):
	c += str(i)
print(c[n])


def bubble_sort(l):
	for i in range(len(l) - 1):
		for j in range(len(l) - i - 1):
			if l[j] > l[j + 1]:
				(l[j], l[j + 1]) = (l[j + 1], l[j])
	return l

def main_function():
	n = int(input())
	output_str = ''
	output_list = []
	for i in range(1, 500):
		for j in str(i):
			output_list.append(j)
	return int(output_list[n - 1])
print(main_function())


n = int(input())
a = []
k = ''
for i in range(1, n + 1):
	a.append(i)
a = list(map(str, a))
k = k.join(a)
for i in range(n + 1):
	if i == n:
		print(k[i - 1])
		break


n = int(input())
s = ''
k = 1
while len(s) < n:
	s += str(k)
	k += 1
print(s[n - 1])


while 1:
	try:
		n = int(input())
	except:
		break
	s = ''.join((str(x) for x in range(n + 1)))
	print(s[n])


n = int(input())
string = ''
for i in range(1, 1001):
	string += str(i)
print(int(string[n - 1]))


def main():
	n = int(input())
	if n < 10:
		return n
	if n < 190:
		n -= 10
		return str(n // 2 + 10)[n % 2]
	n -= 190
	return str(n // 3 + 100)[n % 3]
print(main())


n = int(input())
a = ''.join((str(i) for i in range(1, n + 1)))
print(a[n - 1])


def solution672a():
	n = int(input())
	res = ''
	i = 1
	while len(res) < 1000:
		res += str(i)
		i += 1
	print(res[n - 1])
solution672a()


string = []
digit = int(input())
for i in range(digit + 1):
	string.append(i)
characters = [int(i) for i in ''.join(map(str, string))]
print(characters[digit])


print(''.join([str(num) for num in range(1001)])[int(input())])


numbers = ''
for i in range(1, 371):
	numbers += str(i)
print(numbers[int(input()) - 1])


n = int(input())
nums = ''
for i in range(1, n + 1):
	nums += str(i)
if n < 10:
	print(n)
else:
	print(nums[n - 1])


n = int(input())
s = '123456789'
if n <= 9:
	print(n)
else:
	for i in range(10, n + 1):
		s += str(i)
	print(s[n - 1])


n = int(input())
count = 0
i = 0
ans = -1
while True:
	i += 1
	for d in str(i):
		count += 1
		if count == n:
			ans = d
	if ans != -1:
		break
print(ans)


a = 0
s = []
p = []
w = []
x = int(input())
if x < 12:
	if x > 9:
		print(['0', '1'][x % 2 == 0])
	else:
		print(x)
elif x < 190:
	if x % 2 != 0:
		z = x - 1
	else:
		z = x
	for i in range(12, 190, 2):
		a += 1
		if i == z:
			break
	o = z - a
	if x % 2 == 0:
		print(o // 10)
	else:
		print(o % 10)
else:
	a = 88
	z = x
	p = list(range(190, 1003, 3))
	while 1:
		if z in p:
			break
		z = z - 1
	for b in range(190, 1003, 3):
		a += 2
		if b == z:
			break
	d = z - a
	while d > 0:
		f = d % 10
		s.append(f)
		d = d // 10
	s.reverse()
	for r in range(3):
		w.append(z)
		z = z + 1
	print(s[w.index(x)])


n = int(input())
S = ''
for i in range(1, n + 1):
	S += str(i)
print(S[n - 1])


s = ''
for x in range(1, 400):
	s += str(x)
print(s[int(input()) - 1])


n = int(input())
l = ''.join(map(str, range(1, 1000)))
print(l[n - 1])


n = int(input())
string = ''
for i in range(1000):
	string = string + str(i)
print(string[n])


n = int(input())
if n < 10:
	print(str(n))
elif n <= 189:
	if n % 2 == 0:
		i = 28
		j = 1
		while j < 10:
			if n <= i:
				print(int(j))
				break
			i += 20
			j += 1
	else:
		i = 1
		while n < 190:
			if n < (i + 1) * 10 + 11:
				print(int((n - (i - 1) * 10 - 11) / 2))
				break
			i += 2
else:
	o = n % 3
	if o == 1:
		i = 487
		j = 1
		while j < 10:
			if n <= i:
				print(int(j))
				break
			i += 300
			j += 1
	elif o == 2:
		i = 218
		j = 0
		while i < 1216:
			if n <= i:
				print(j)
				break
			i += 30
			j += 1
			if j == 10:
				j = 0
	else:
		i = 1
		while n < 1001:
			if n < (i + 2) * 10 + 192:
				print(int((n - (i - 1) * 10 - 192) / 3))
				break
			i += 3


x = []
for i in range(1, 1001):
	x.append(i)
mystr = ''.join([str(elem) for elem in x])
me = list(mystr)
y = int(input(''))
print(me[y - 1])


hat = int(input())
text = ''
for i in range(1, 371):
	text += str(i)
print(text[hat - 1])


e = int(input())
d = []
for i in range(1001):
	d.append(str(i))
k = ''.join(d)
print(k[e])


import math
a = int(input())
s = '1'
for i in range(2, 1001):
	s += str(i)
print(s[a - 1])


n = int(input())
s = ''.join(map(str, range(400)))
print(s[n])


a = '1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000'
b = int(input())
print(a[b - 1])


n = int(input())
c = 1
s = ''
while len(s) < n:
	s += str(c)
	c += 1
print(s[n - 1])


x = int(input())
y = ''
for i in range(1, 1001):
	y = y + str(i)
	if len(y) > 1010:
		break
print(y[x - 1])


x = [str(i) for i in range(1, 500)]
y = ''.join(x)
print(y[int(input()) - 1])


n = int(input())
k = ''.join(map(str, [i for i in range(1, 1001)]))
print(k[n - 1])


a = int(input())
s = ''
for i in range(1000):
	s += str(i)
print(s[a])


a = int(input())
if a <= 9:
	print(a)
elif a <= 90 * 2 + 9 * 1:
	if a % 2 == 0:
		print((a + 10) // 2 // 10)
	else:
		print((a + 10) // 2 % 10)
elif a % 3 == 1:
	print((a + 110) // 3 // 100)
elif a % 3 == 2:
	print((a + 110) // 3 % 100 // 10)
else:
	print((a + 110) // 3 % 10)


from sys import stdin

def main():
	s = '0'
	for i in range(1, 1000):
		s = s + str(i)
	n = int(stdin.readline())
	print(s[n])
main()


n = int(input())
k = ''
for i in range(1, n + 1):
	k = k + str(i)
print(k[n - 1])


n = int(input())
line = ''
number = 1
while len(line) < n:
	line += str(number)
	number += 1
print(line[n - 1])


print([''.join([str(i) for i in range(1, n + 1)])[n - 1] for n in [int(input())]][0])


a = int(input())
b = []
for i in range(1, a + 1):
	b.append(str(i))
c = ''.join(b)
print(c[a - 1])


x = int(input())
L = ''
for i in range(1, 1000):
	if len(L) < x:
		L += str(i)
	else:
		break
print(L[x - 1])


import math
n = int(input())
x = 0
y = 0
while n > x:
	y += 1
	x += 10 ** (y - 1) * 9 * y
x -= 10 ** (y - 1) * 9 * y
a = 10 ** (y - 1) + math.ceil((n - x) / y) - 1
b = (n - x) % y
if b == 0:
	b = y
a = str(a)
print(a[b - 1])


n = eval(input())
i = 0
x = ''
while i <= 1000:
	x += str(i)
	i += 1
print(int(x[n]))


import math

def get_primes(prime_supr):
	is_prime = [0] * 2 + [1] * prime_supr
	for i in range(2, int(math.sqrt(prime_supr)) + 1):
		if is_prime[i]:
			for j in range(i * i, prime_supr + 1, i):
				is_prime[j] = 0
	return is_prime
get_int = lambda : map(int, input().split())
n = int(input())
a = ''.join((str(i) for i in range(n + 5)))
print(a[n])


s = ''
for i in range(460):
	s += str(i)
print(s[int(input())])


n = int(input())
a = []
for i in range(1, n + 1):
	x = []
	while i > 0:
		x.append(i % 10)
		i //= 10
	for j in range(len(x) - 1, -1, -1):
		a.append(x[j])
print(a[n - 1])


def main():
	n = int(input())
	print(''.join(map(str, list(range(1, 800))))[n - 1])
main()


strNumbers = ''
y = 1
for i in range(1, 1000):
	strNumbers = strNumbers + str(y)
	y += 1
n = int(input())
print(strNumbers[n - 1])


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
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 [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return input()

def main():
	n = I()
	s = ''
	for i in range(1, n + 1):
		s += str(i)
	return s[n - 1]
print(main())


def main():
	n = int(input())
	s = ''
	for i in range(1, 1000):
		s += str(i)
	print(s[n - 1])
main()


enteros = ''
for i in range(1000):
	enteros += str(i)
ch = input('')
print(enteros[int(ch)])


import math

def solve(n):
	arr = []
	for i in range(1, 1001):
		arr += list(str(i))
	return arr[n - 1]

def main():
	n = int(input())
	print(solve(n))
main()


n = int(input())
string = ''
for x in range(0, n + 1):
	string += str(x)
print(string[n])


def main():
	s = ''
	for i in range(371):
		s += str(i)
	n = int(input())
	print(s[n])
main()


q = '123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532535345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000'
w = int(input())
print(q[w - 1])


def school(n):
	s = ''
	for i in range(1, n + 1):
		s += str(i)
	return s[n - 1]
print(school(int(input())))


x = int(input())
lista = ''
for c in range(1, 1001):
	lista += str(c)
print(lista[x - 1])


N = int(input())
X = '1'
for i in range(2, 1000):
	X = X + str(i)
Y = list(X)
print(Y[N - 1])


def digit_position(digit):
	string = ''
	current_number = 1
	while len(string) < digit:
		string += str(current_number)
		current_number += 1
	return string[digit - 1]
print(digit_position(int(input())))


def convertNumber(x):
	res = ''
	while x > 0:
		res = chr(x % 10 + ord('0')) + res
		x //= 10
	return res
n = int(input())
res = ''
for i in range(1, 400):
	res += convertNumber(i)
print(res[n - 1])


def realnum(i):
	s = ''.join(map(str, range(400)))
	return int(s[i])
print(realnum(int(input())))


import os
import sys
from io import BytesIO, IOBase
import math
from decimal import Decimal
from decimal import *
from collections import defaultdict, deque
import heapq
from decimal import Decimal
getcontext().prec = 25
abcd = 'abcdefghijklmnopqrstuvwxyz'
MOD = 1000000007
BUFSIZE = 8192
from bisect import bisect_left, bisect_right

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
s = ''
for i in range(1000):
	s += str(i)
print(s[int(input())])


def result(a):
	if a >= 1 and a <= 9:
		return a
	elif a >= 10 and a <= 9 + 90 * 2:
		return str((a - 9 + 1) // 2 + 9)[(a - 9 + 1) % 2]
	else:
		return str((a - 189 + 2) // 3 + 99)[(a - 189 + 2) % 3]
print(result(int(input())))


line = ''.join((str(x) for x in range(1, 500)))
n = int(input())
print(line[n - 1])


n = int(input())
x = 1
string = ''
while x <= n:
	string = string + str(x)
	x = x + 1
print(string[x - 2])


d = int(input())
nu = '12345678910'
ex = 11
while len(nu) < d:
	nu += str(ex)
	ex += 1
print(nu[d - 1])


n = int(input())
s = ''
a = 1
while len(s) <= n:
	s += str(a)
	a += 1
print(s[n - 1])


S = '0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999'
N = int(input())
print(S[N])


a = int(input())
i = 1
v = ''
while i <= a:
	v = v + str(i)
	i = i + 1
print(v[a - 1])


import math

def first():
	inp = int(input())
	s = ''
	for i in range(1000):
		s += str(i)
	print(s[inp])
first()


s = ' 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000'
n = int(input())
print(s[n])


n = int(input())
s = ''
for i in range(1, n + 1, 1):
	s += str(i)
li = []
li = list(s)
print(li[n - 1])


lis = []
for i in range(1, 1001):
	lis.append(str(i))
lis = ''.join(lis)
a = int(input())
print(lis[a - 1])


word = ''
for i in range(1, 1001):
	word += str(i)
p = int(input())
print(word[p - 1])


n = int(input())
rep = ''
for i in range(1, n + 1):
	rep += str(i)
print(rep[n - 1])


st = ''
for i in range(1, 371):
	st += str(i)
print(st[int(input()) - 1])


def silly(n):
	num = ''.join(map(str, list(range(1, 400))))
	print(num[n - 1])

def good(n):
	pass

def main():
	n = int(input())
	silly(n)
main()


n = int(input(''))
myList = []
counter = 0
while counter <= 1000:
	myList.append(str(counter))
	counter = counter + 1
a = ''.join(myList)
print(a[n])


n = int(input())
if n <= 9:
	print(n)
elif n <= 189:
	m = int((n - 10) / 2) + 10
	print(str(m)[(n - 10) % 2])
else:
	m = int((n - 190) / 3) + 100
	print(str(m)[(n - 190) % 3])


i = '0' + '1'
j = 2
while j < 500:
	i += str(j)
	j += 1
val = int(input())
print(i[val])


def main():
	n = int(input())
	print('123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374'[n - 1])
main()


t = int(input())
s = ''
for i in range(1, 100000 + 1, 1):
	s += str(i)
print(s[t - 1])


n = int(input())
anse = ''
for i in range(1, n + 1, 1):
	anse += str(i)
print(anse[n - 1])


n = int(input())
(x, s) = (1, 0)
while True:
	z = len(str(x))
	s += z
	if s >= n:
		print(str(x)[n - (s - z) - 1])
		break
	x += 1


v = int(input())
nums = [x for x in range(1, 10)]
for i in range(10, 100):
	nums.append(int(i / 10))
	nums.append(i % 10)
for i in range(100, 400):
	nums.append(int(i / 100))
	nums.append(int(i % 100 / 10))
	nums.append(i % 10)
print(nums[v - 1])


n = int(input())
l = [str(i) for i in range(400)]
z = ''.join(l)
print(z[n])


st = ''
inp = int(input())
for i in range(1, inp + 1):
	st += str(i)
print(st[inp - 1])


n = int(input())
x = 0
for i in range(1, n + 1):
	x += 1 + (i > 9) + (i > 99) + (i > 999)
	if x >= n:
		break
print(str(i)[n - x - 1])


n = int(input())
for i in range(1, 100000):
	if n <= len(str(i)):
		print(str(i)[n - 1])
		break
	if i <= 9:
		n -= 1
	elif i <= 99:
		n -= 2
	elif i <= 999:
		n -= 3
	elif i <= 9999:
		n -= 4


n = int(input())
(i, length) = (0, 0)
while length < n:
	i += 1
	s = str(i)
	length += len(s)
print(s[-(length - n + 1)])


n = int(input())
b = ''
for i in range(1, 400):
	b += str(i)
print(b[n - 1])


n = int(input())
t = ''
for i in range(n + 100):
	t += str(i)
print(t[n])


a = int(input())
count = 0
i = 1
s = ''
while count < a:
	s += str(i)
	count += len(str(i))
	i += 1
print(s[a - 1])


__author__ = 'Utena'
n = int(input())
i = 1
total = ''
while True:
	total += str(i)
	i += 1
	if len(total) >= n:
		print(total[n - 1])
		break


n = int(input())
s = ''
num = 1
while len(s) < n:
	s = s + str(num)
	num += 1
print(s[n - 1])


n = int(input())
s = ''.join(map(str, range(1001)))
print(s[n])


a = int(input(''))
l = []
for i in range(1, a + 1):
	l.append(i)
s = ''.join(map(str, l))
print(s[a - 1])


n = int(input())
if n < 10:
	print(n)
else:
	str_ = ''
	for i in range(1, n):
		k = str(i)
		str_ = str_ + k
	print(str_[n - 1])


s = ''.join(map(str, [x for x in range(1002)]))
print(s[int(input())])


n = int(input())
lst = ''
for i in range(1000):
	lst += str(i)
print(lst[n])


n = int(input())
cur = '1'
i = 1
while i <= n:
	cur += str(i)
	i += 1
print(cur[n])


from math import *
from cmath import *
from itertools import *
from decimal import *
from fractions import *
from sys import *
from types import CodeType, new_class
print(''.join(map(str, range(555)))[int(input())])


ans = ''
for i in range(1, 500):
	ans += str(i)
n = int(input())
print(ans[n - 1])


n = int(input())
if n <= 9:
	print(n)
elif n <= 189:
	m = n - 9
	a = (m + 1) // 2
	b = m % 2
	N = 9 + a
	print(str(N)[b - 1])
else:
	m = n - 189
	a = (m + 2) // 3
	b = m % 3
	N = 99 + a
	print(str(N)[b - 1])


n = input('')
n = int(n)
arr = [0]
arr2 = []
for i in range(1, n + 1):
	x = i
	while x > 0:
		m = x % 10
		arr2.append(m)
		x /= 10
		x = int(x)
	j = len(arr2) - 1
	while j >= 0:
		arr.append(arr2[j])
		j -= 1
	arr2 = []
print(arr[n])


n = int(input())
i = 0
c = 0
s = ''
while True:
	i += 1
	s = s + str(i)
	if len(s) >= n:
		k = n - len(s) - 1
		print(s[k])
		break


check = ''
for i in range(1000):
	check += str(i + 1)
n = int(input())
print(check[n - 1])


def STR():
	s = ''
	for i in range(1, 1001):
		s += str(i)
	return s
s = STR()
n = int(input())
print(s[n - 1])


s = ''
for i in range(0, 1001):
	s += str(i)
print(s[int(input())])


n = int(input())
cn = '0'
c = []
cc = 1
while True:
	cn = str(int(cn) + 1)
	c = [cc + i for i in range(len(cn))]
	if n in c:
		print(cn[c.index(n)])
		break
	else:
		cc = c[-1] + 1


S = ''
i = 1
while len(S) < 2000:
	S += str(i)
	i += 1
N = int(input())
print(S[N - 1])


a = int(input())
b = ''
for i in range(a + 1):
	b += str(i + 1)
print(b[a - 1:a])


def remain(n):
	r = n % 10
	return r
n = int(input())
digits = []
i = 1
while len(digits) < n:
	temp = i
	rever = []
	while temp != 0:
		rever.append(remain(temp))
		temp = temp // 10
	i += 1
	for d in reversed(rever):
		digits.append(d)
print(digits[n - 1])


def answer():
	n = int(input())
	if n < 10:
		print(n)
	elif n < 190:
		num = str(10 + int((n - 10) / 2))
		print(num[(n - 10) % 2])
	elif n < 2890:
		num = str(100 + int((n - 190) / 3))
		print(num[(n - 190) % 3])
	elif n == 2890:
		print(1)
	elif n > 2890:
		print(0)
answer()


n = int(input())
l = []
output = []

def reemovNestings(l):
	for i in l:
		if type(i) == list:
			reemovNestings(i)
		else:
			output.append(i)
for i in range(1, n + 1):
	res = [int(x) for x in str(i)]
	l.append(res)
reemovNestings(l)
print(output[n - 1])


n = int(input())
right = 1
i = 0
while right <= n:
	left = right
	right += 9 * (i + 1) * 10 ** i
	i += 1
target_num = 10 ** (i - 1) + (n - left) // i
print(str(target_num)[(n - left) % i])


def ii():
	return int(input())

def ss():
	return [x for x in input()]

def si():
	return [int(x) for x in input().split()]

def mi():
	return map(int, input().split())
s = []
for i in range(1, 371):
	s.append(str(i))
s = ''.join(s)
a = ii()
print(s[a - 1])


n = int(input())
x = []
for i in range(1, n + 1):
	x.append(str(i))
y = ''.join(x)
print(y[n - 1])


from __future__ import print_function

def main():
	n = int(input())
	s = ''.join(map(str, range(1, 1002)))
	print(s[n - 1])
main()


import sys
n = int(input())
s = ''
i = 0
while len(s) < n:
	i += 1
	s += str(i)
print(s[n - 1])


a = [int(x) for x in range(1000)]
a = [str(a[i]) for i in range(len(a))]
l = str(''.join(a))
n = int(input())
print(l[n])


x = int(input())
y = ''
for i in range(1, 1001):
	y += str(i)
print(y[x - 1])


test_case = input()
T = int(test_case)
out = ''
for i in range(1, T + 1):
	out = out + str(i)
print(out[T - 1])


n = int(input())
sa = []
p = list(range(1, n + 1))
for item in p:
	if len(str(item)) == 1:
		sa.append(item)
	else:
		for x in str(item):
			sa.append(x)
print(sa[n - 1])


n = int(input())
numbers = ''
for i in range(1, 1002):
	numbers = numbers + str(i)
print(numbers[n - 1])


s = ''
f = 1
c = 370
while c > 0:
	s += str(f)
	f += 1
	c -= 1
print(s[int(input()) - 1])


a = ''
for i in range(1, 1010):
	a += str(i)
op = int(input())
print(a[op - 1])


n = int(input())
s = ''
for i in range(1001):
	s += str(i)
print(s[n])


print(''.join([str(x) for x in range(1001)])[int(input())])


s = int(input())
ar = ''
for i in range(s + 1):
	ar = ar + str(i)
print(ar[s])


s = '123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999'
print(s[int(input()) - 1])


from functools import reduce
print(reduce(lambda s, p: s + p, map(str, range(1, 1001)), '')[int(input()) - 1])


n = int(input())
if n > 90 * 2 + 9:
	z = 100
	n = n - 90 * 2 - 10
	z += n // 3
	n = n - n // 3 * 3
	z = str(z)
	print(z[n])
elif n > 9:
	z = 10
	n = n - 10
	z += n // 2
	n = n - n // 2 * 2
	z = str(z)
	print(z[n])
else:
	print(n)


n = int(input())
text = ''
i = 0
while len(text) <= n:
	text += str(i)
	i += 1
print(text[n])


n = int(input())
crt = 1
a = ''
while len(a) < n:
	a += str(crt)
	crt += 1
print(a[n - 1])


from sys import setrecursionlimit, exit
from math import ceil, floor, acos, pi
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from functools import reduce
setrecursionlimit(10 ** 8)
RI = lambda x=' ': list(map(int, input().split(x)))
RS = lambda x=' ': input().rstrip().split(x)
dX = [-1, 1, 0, 0, -1, 1, -1, 1]
dY = [0, 0, -1, 1, 1, -1, -1, 1]
mod = int(1000000000.0 + 7)
eps = 1e-06
MAX = 46
s = ''
for i in range(1, 400):
	s += str(i)
n = RI()[0]
print(s[n - 1])


x = int(input())
z = [[int(k) for k in str(n)] for n in range(1, x + 1)]
s = []
for n in range(len(z)):
	s += z[n]
print(s[x - 1])


n = int(input())
if n % 10 == n:
	print(n)
	exit()
s = '123456789'
for i in range(1, 10):
	for j in range(0, 10):
		s = s + str(i) + str(j)
for i in range(1, 4):
	for j in range(0, 10):
		for k in range(0, 10):
			s = s + str(i) + str(j) + str(k)
print(s[n - 1])


S = ''
for i in range(1, 400):
	S += str(i)
print(S[int(input()) - 1])


n = int(input())
count = 15
seq = '123456789101112131415'
while len(seq) < n:
	count += 1
	seq += str(count)
print(seq[n - 1])


import sys
input = sys.stdin.readline
n = ''
for i in range(400):
	n += str(i)
i = int(input())
print(n[i])


l = []
i = 1
while len(l) < 1000:
	l += list(str(i))
	i += 1
print(l[int(input()) - 1])


import math
n = int(input())
i = 1
l = 1
while l < n:
	i += 1
	l += int(math.log10(i) + 1)
print(i // 10 ** (l - n) % 10)


a = int(input())
b = ''
c = 0
for i in range(0, 10009):
	c += 1
	b += str(c)
print(b[a - 1])


n = int(input())
line = ''.join(map(str, range(1, 1001)))
print(line[n - 1])


n = int(input())
digits = ''
for i in range(1, 1001):
	digits += str(i)
print(digits[n - 1])


c = int(input())
for i in range(1, 1000):
	for j in range(0, len(str(i))):
		if c == 1:
			print(str(i)[j])
		c -= 1


n = int(input())
d = []
s = [str(i) for i in range(n + 1)]
for i in s:
	if len(i) == 1:
		d.append(i)
	else:
		for j in i:
			d.append(j)
print(d[n])


n = int(input())
a = ''
for i in range(1, 500, 1):
	a += str(i)
print(a[n - 1])


s = ''.join([str(i) for i in range(1, 1010)])
print(s[int(input()) - 1])


a = int(input())
fin = ''
for i in range(1, a + 1):
	fin += str(i)
print(fin[a - 1])


n = int(input())
if n < 10:
	print(n)
elif 10 <= n <= 189:
	print(str(9 + (n - 8) // 2)[n % 2])
else:
	print(str(99 + (n - 187) // 3)[(n + 2) % 3])