Start: 2025-09-23 11:00:00

25复赛模拟赛01OI赛制

End: 2025-09-24 13:30:00
Now  2026-03-21 07:50:10  类型: OI  状态: Ended 

P1. 报字符char
Description

小Z拿到一个字符串s后,她会对它进行若干次变化和反转,然后她给你一个位置P,请你给出这个位置的字母!

她的变化如下:

假设一开始字符串是'hello',每次wt后会增加一个t;

第1次变化:是'hello'+'wt'+'olleh',也就是增加一个'wt'并进行了反转,最终变成了'hellowtolleh';

第2次变化:'hellowtolleh'+'wtt'+'hellotwolleh',变成'hellowtollehwtthellotwolleh';

第3次变化:'hellowtollehwtthellotwolleh'+'wttt'+'hellowtollehttwhellotwolleh';

以此类推

Input

第一行输入一个字符串s

接下来是一个数字p,表示它若干次变化后的p位置的字母是什么!

Output

一个字符表示位置p的字母

Examples

Input

hello
20

Output

o

Input

wuting
100

Output

t
Hint

60%的数据:p\leq 10^5

100%的数据:p\leq 10^{16},len|s| \leq 100


Submit

题目参数
Time Limit 1 second
Memory Limit 128 MB
Submit