Alice became interested in periods of integer numbers. We say positive $X$ integer number is periodic with length $L$ if there exists positive integer number $P$ with $L$ digits such that $X$ can be written as $PPPP…P$. For example:

$X = 123123123$ is periodic number with length $L = 3$ and $L = 9$

$X = 42424242$ is periodic number with length $L = 2,L = 4$ and $L = 8$

$X = 12345$ is periodic number with length $L = 5$

For given positive period length $L$ and positive integer number $A$, Alice wants to find smallest integer number $X$ strictly greater than $A$ that is periodic with length L.


-----Input-----

First line contains one positive integer number $L \ (1 \leq L \leq 10^5)$ representing length of the period. Second line contains one positive integer number $A \ (1 \leq A \leq 10^{100 000})$.


-----Output-----

One positive integer number representing smallest positive number that is periodic with length $L$ and is greater than $A$.


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

Output
124124

Input
3
12345

Output
100100



-----Note-----

In first example 124124 is the smallest number greater than 123456 that can be written with period L = 3 (P = 124).

In the second example 100100 is the smallest number greater than 12345 with period L = 3 (P=100)

Difficulty: interview

Starter code:

Solutions:
l = int(input())
a = input()
la = len(a)
if la % l != 0:
    per = la//l+1
    ans = '1'+'0'*(l-1)
    ans *= per
    print(ans)
else:
    ans = a[:l]
    per = la//l
    if ans*per > a:print(ans*per)
    else:
        temp = str(int(ans)+1)
        if len(temp) == l:print(temp*per)
        else:
            temp = '1'+'0'*(l-1)
            temp *= (per+1)
            print(temp)


import math

L = int(input())

A = input()
len_A = len(A)

if len_A % L != 0:
    print(('1'+'0'*(L-1))*math.ceil(len_A/L))
else:
    p = A[:L]
    intp = p*int(len_A/L)

    if intp > A:
        print(intp)
    elif p.count('9') == L:
        print(('1'+'0'*(L-1))*(int(len_A/L)+1))
    else:
        print(str(int(p)+1)*int(len_A/L))


#BubbleCup 12 - C

import math

L = int(input())
A = input()

f = int("".join(A[:L]))
tn = False
if (1 - abs((math.log(f + 1) / math.log(10))  %1)) % 1 < (10 ** -9):
    tn = True
if len(A) % L != 0:
    ln = len(A) + (L - len(A) % L)
    num = ("1" + "0" * (L - 1)) * (ln // L)
    print(num)
else:
    f = int("".join(A[:L]))
    fn = False
    ft = True
    for i in range(L, len(A), L):
        if int("".join(A[i:i+L])) > f and not fn:
            ft = False
        if int("".join(A[i:i+L])) < f:
            fn = True
    if fn and ft:
        print(str(f) * (len(A) // L))
    elif tn:
        print(("1" + "0" * (L - 1)) * ((len(A) // L) + 1))
    else:
        print(str(f + 1) * (len(A) // L))


import io, sys, atexit, os
import math as ma
from decimal import Decimal as dec
from itertools import permutations
from itertools import combinations


def li ():
	return list (map (int, sys.stdin.readline ().split ()))


def num ():
	return map (int, sys.stdin.readline ().split ())


def nu ():
	return int (input ())


def find_gcd ( x, y ):
	while (y):
		x, y = y, x % y
	return x


def lcm ( x, y ):
	gg = find_gcd (x, y)
	return (x * y // gg)


def findSum ( str1, str2 ):
	if (len (str1) > len (str2)):
		t = str1
		str1 = str2
		str2 = t
	str = ""
	n1 = len (str1)
	n2 = len (str2)
	str1 = str1 [ ::-1 ]
	str2 = str2 [ ::-1 ]

	carry = 0
	for i in range (n1):
		sum = ((ord (str1 [ i ]) - 48) +
			   ((ord (str2 [ i ]) - 48) + carry))
		str += chr (sum % 10 + 48)
		carry = int (sum / 10)
	for i in range (n1, n2):
		sum = ((ord (str2 [ i ]) - 48) + carry)
		str += chr (sum % 10 + 48)
		carry = (int) (sum / 10)
	if (carry):
		str += chr (carry + 48)
	str = str [ ::-1 ]

	return str




mm = 1000000007

def solve ():
	t = 1
	for tt in range (t):
		n=nu()
		s=input()
		if(len(s)%n!=0):
			nm=(len(s)//n+1)
			hp="1"
			for i in range(n-1):
				hp+="0"
			op=""
			for i in range(nm):
				op+=hp
			print(op)
			continue
		ff=s[0:n]
		ox=s[n:]
		vv=""
		for i in range(len(s)):
			vv+="9"
		if(vv==s):
			nm = (len (s) // n + 1)
			hp = "1"
			for i in range (n - 1):
				hp += "0"
			op = ""
			for i in range (nm):
				op += hp
			print (op)
			continue
		gp=""
		last=-1
		ok=-1
		for i in range(0,len(ox),n):
			for j in range(i,i+n):
				if(ff[j-i]<ox[j]):
					last=1
					break
				if(ff[j-i]>ox[j]):
					ok=j+1
					break
			if(last!=-1):
				break
			if(ok!=-1):
				break
		ans=""
		if(last!=-1):
			gp = findSum (ff, "1")
			for i in range (len (s) // n):
				print (gp, end = "")
			continue
		if(ok!=-1):
			for i in range (len (s) // n):
				print (ff, end = "")
			continue
		gp = findSum (ff, "1")
		for i in range (len (s) // n):
			print (gp, end = "")










def __starting_point():
	solve ()
__starting_point()

n = int(input())
A=input()
L=len(A)
def check_increase(p_numb,n):
    if (p_numb.count("9")==n):
        return True
    return False
def large_print(L,n):
    cycle_count=(L//n)+1
    p_numb="1"+"0"*(n-1)
    print(p_numb*cycle_count)

if (L==n):
    if(check_increase(A[:n],n)):
        large_print(L,n)
    else:
        print(int(A)+1)
elif (L%n==0):
    p_numb=A[:n]

    #eval
    for i in range(n,L):
        if (int(p_numb[i%n])>int(A[i])):
            break
        elif (int(p_numb[i%n])<int(A[i])):
            p_numb=str(int(p_numb)+1)
            break
    else:
        p_numb=str(int(p_numb)+1)
    if (len(p_numb)==n):
        print(p_numb*(L//n))
    else:
        large_print(L,n)
else:
    large_print(L,n)





"""
NTC here
"""
from sys import setcheckinterval, stdin, setrecursionlimit
setcheckinterval(1000)
setrecursionlimit(10**7)
 
# print("Case #{}: {} {}".format(i, n + m, n * m))
 
 
def iin(): return int(stdin.readline())
def lin(): return list(map(int, stdin.readline().split()))


l=iin()
a=list(input())
n=len(a)
if n<l:
    print('1'+'0'*(l-1))
elif l==n:
    for i in range(l-1,-1,-1):
        chg=int(a[i])
        if chg<9:
            a[i]=str(chg+1)
            break
        else:
            a[i]='0'
    else:
        s1='1'+'0'*(l-1)
        s2=s1*(2)
        print(s2)
        return
    print(*a,sep='')
else:
    if n%l==0:
        x=n//l
        s1=a[:l]
        s2=s1*x
        if s2<=a:
            for i in range(l):
                chg=int(s1[-i-1])
                if chg<9:
                    s1[-i-1]=str(chg+1)
                    break
                else:
                    s1[-i-1]='0'
            else:
                s1='1'+'0'*(l-1)
                s2=s1*(x+1)
                print(s2)
                return
            s2=s1*x
        print(*s2,sep='')

    else:
        x=(n+l-1)//l
        s1='1'+'0'*(l-1)
        s2=s1*x
        print(s2)


L = int(input())
str_A = (input())

#str_A  = str(A)

lens = len(str_A)

if lens % L == 0 and str_A != ("9"*lens):
    #print(1)
    build = -1
    for i in range(L,lens):
        if str_A[i] < str_A[i%L]:
            build =0
            break
        elif str_A[i] > str_A[i%L]:
            build = 1
            break
    if build in (1,-1):
        print(str(int(str_A[:L])+1)*(lens//L))
    if build == 0:
        print(str_A[:L] * (lens // L))

else:
    perf = ("1" + "0"*(L-1))*(lens// L +1)
    print(perf)

L = int(input())
str_A = (input())
 
#str_A  = str(A)
 
lens = len(str_A)
 
if lens % L == 0 and str_A != ("9"*lens):
    #print(1)
    build = -1
    for i in range(L,lens):
        if str_A[i] < str_A[i%L]:
            build =0
            break
        elif str_A[i] > str_A[i%L]:
            build = 1
            break
    if build in (1,-1):
        print(str(int(str_A[:L])+1)*(lens//L))
    if build == 0:
        print(str_A[:L] * (lens // L))
 
else:
    perf = ("1" + "0"*(L-1))*(lens// L +1)
    print(perf)


import math as m

def main():
	n = int(input())
	s = input()
	l = len(s)
	p = int(m.ceil(l/n))
	if l%n!=0 :
		t = '1'
		for i in range(1,n):
			t+='0'
		for i in range(0,p):
			print(t ,end = '')
	else :
		z = s[0:n]
		t=''
		for i in range(0,p):
			t+=z
		if t > s:
			print(t)
			return

		z = str(int(s[0:n])+1)
		if len(z)>n :
			t = '1'
			for i in range(1,n):
				t+='0'
			for i in range(0,p+1):
				print(t ,end = '')
			return

		t=''
		for i in range(0,p):
			t+=z
		
		print(t)
			



main()


	



L=int(input())
A=int(input())
l1=[]
D=A
s1=str(D)
"""
while True:
	if (D<10):
		l1.append(D)
		s1+=str(D)
		break
	else:
		l1.append(D%10)
		s1+=str(D%10)
		D=D//10

"""
q=len(s1)//L
q1=q+1
if (len(s1)%L!=0):
	print(("1"+"0"*(L-1))*q1)
else:
	s=""
	if (L==len(s1)):
		print(A+1)
	elif (int(s1[0])<int(s1[L])):
		v=s1[0:L]
		#v[-1]=v[-1]+1
		s+=v[0:len(v)-1]
		s+=str(int(v[-1])+1)
		print(s*q)

	else:
		l2=[]
		ind=0
		for m in range(q):
			l2.append(int(s1[ind:ind+L]))
			ind=ind+L
		c=l2[0]
		val=0
		for j in l2:
			if j>c:
				c+=1
				break
			elif j==c:
				val+=1
		if val==len(l2):
			d=c+1
			d=str(d)
			if (len(str(d))>len(str(c))):
				c=d[0:len(d)-1]
				q+=1
			else:
				c=str(d)
		print(str(c)*q)






# -*- coding: utf-8 -*-
"""
Created on Tue Sep 24 18:38:16 2019

@author: Mridul Garg
"""

L = int(input())
string = input()

#lstring = [0]*(L)
#for i in range(L):
#    lstring[i] = string[i]
#term = string[L+1]

q = len(string)//L
r = len(string)%L

if q == 0:
    temp = '1' + '0'*(L-1)
    ans = temp

elif r != 0:
    temp = '1' + '0'*(L-1)
    ans = temp*(q+1)
    
    
else:
    temp = string[0:L]
    temp2 = temp*q
#    if temp2 == string:
#        ans = temp2
#    print(temp2)
    if int(temp2) > int(string):
        ans = temp2
        
        
    else:
        if temp == '9'*L:
            temp = '1' + '0'*(L-1)
            temp = temp*(q+1)
            ans = temp
        else:
            temp2 = int(temp) + 1
            ans = str(temp2)*q
        
        
#        char = int(string[L-1]) + 1
#        
#        temp2 = temp + char
    

print(ans)

L = int(input())
string = input()

length = len(string)
if length % L != 0:
    print(('1'+'0'*(L-1))*((length + L -1)//L))
else:
    uptoL = string[:L]
    periodic = uptoL * (length//L)

    if periodic > string:
        print(periodic)
    elif uptoL.count('9') == L:
        print(('1'+'0'*(L-1))*((length + L )//L))
    else:
        print(str(int(uptoL)+1)*(length//L))


import os
import sys

import textwrap


def solve():
    L = int(input())
    A = input()

    size = len(A)
    div = int(size / L)
    mod = size % L

    if size == L:
        if A == '9'*L:
            print(str(10 ** (L - 1)) * (div + 1))
        else:
            print(int(A)+1)
    elif mod:
        print(str(10 ** (L - 1)) * (div + 1))
    else:
        parts = [int(x) for x in textwrap.wrap(A, L)]
        rep = parts[0]
        if rep == 10 ** L - 1:
            print(str(10 ** (L-1)) * (div+1))
        elif rep > parts[1]:
            print(str(rep) * div)
        elif rep < parts[1]:
            print(str(rep+1) * div)
        else:
            index = 2
            pl = len(parts)
            while index < pl and rep == parts[index]:
                index += 1
            if index == pl or parts[index] >= rep:
                print(str(rep + 1) * div)
            else:
                print(str(rep) * div)


def __starting_point():
    if "PYCHARM_HOSTED" in os.environ:
        sys.stdin = open('input.in')
    solve()

__starting_point()

L = int(input())
A = input()
N = len(A)

if N%L != 0 or A == '9'*N:
    K = N//L + 1
    for _ in range(K):
        print(1, end='')
        for _ in range(L-1):
            print(0, end='')
    print()
else:
    for k in range(N//L):
        lg = 0
        for l in range(L):
            a0 = int(A[l])
            a = int(A[k*L+l])
            if a > a0:
                lg = 1
                break
            if a < a0:
                lg = -1
                break
        if lg == -1 or lg == 1:
            break
    if lg == -1:
        for _ in range(N//L):
            print(A[:L], end='')
        print()
    elif lg == 1 or lg == 0:
        B = list(A[:L])
        for l in range(L):
            b = int(B[L-1-l])+1
            if b == 10:
                B[L-1-l] = '0'
            else:
                B[L-1-l] = str(b)
                break
        for _ in range(N//L):
            print(''.join(B), end='')
        print()


# from time import time
# start = time()
n = int(input())
s = input()
s = str(int(s)+1)
# print(s)
l = len(s)
# print(l)
if(n==l):
    print(s)
elif(n>l):
    print(str("1"+"0"*(n-1)))

elif(l%n!=0):
    print(str("1"+"0"*(n-1))*(l//n +1))
else:
    d = s[:n]
    # print(d)
    i = n
    flag = 0
    while(i<l):
        z = s[i:i+n]
        # print(i,d,z)
        if(int(z) > int(d)):
            d = str(int(d)+1)
            flag = 1
            break;
        i = i+n
    # print(l//n)
    print(str(d)*int(l//n))
# end = time()
# print("%0.2f" %(end-start),"seconds")


#  =========     /\       /|    |====/|
#      |        /  \       |    |   / |
#      |       /____\      |    |  /  |
#      |      /      \     |    | /   |
#  ========= /        \  =====  |/====|  
#  code

def main():
    l = int(input())
    s = input()
    n = len(s)

    if l > n or n % l != 0:
        k = '1' + '0'*(l - 1)
        c = (n + l - 1)//l
        print(k * c)
    else:
        k = s[:l]
        p = k * (n//l)
        if p > s:
            print(p)
        else:
            p = str(int(k) + 1)
            if len(p) == len(k):
                print(p * (n//l))
            else:
                n += 1
                k = '1' + '0'*(l - 1)
                c = (n + l - 1)//l
                print(k * c)
    return

def __starting_point():
    main()
__starting_point()

import sys


def add_one(p):
    count = 0
    for i in range(len(p) - 1, -1, -1):
        if p[i] == '9':
            count += 1
        else:
            return p[: -1 - count]+ str(int(p[i]) + 1) + '0' * count, 0
    return '0' * count, 1


def __starting_point():
    L = int(input())
    A = input()
    if len(A) % L == 0:
        p_size = int(len(A) / L)
        p = A[:L]
        for i in range(2, p_size + 1):
            num = A[(i - 1) * L: i * L]
            if p > num:
                print(A[:L] * p_size)
                return
            elif p < num:
                p, _ = add_one(p)                
                print(p * p_size)
                return
        p, c = add_one(p)
        if c == 1:
            print(('1' + '0' * (L - 1)) * (p_size + 1))
        else:
            print(p * p_size)
    else:
        print(('1' + '0' * (L - 1)) * (int(len(A) / L) + 1))

__starting_point()

'''
    Author : thekushalghosh
    Team   : CodeDiggers
'''
import sys,math,statistics as ss,collections as cc
input = sys.stdin.readline
n = int(input())
a = input()
a = a[:len(a) - 1]
if len(a) % n == 0:
    q = a[:n] * (len(a) // n)
    if q > a:
        print(q)
    elif a[:n].count("9") == n:
        print("".join((["1"] + (["0" * (n - 1)])) * ((len(a) + n) // n)))
    else:
        print(str(int(a[:n]) + 1) * (len(a) // n))
else:
    print("".join((["1"] + (["0" * (n - 1)])) * math.ceil(len(a) / n)))

import math#, time

l = int(input())
a = input()

#t_s = time.time()
#log = int(math.log10(a))+1

l_a = len(a)
#print(l_a)


if( (l_a%l) != 0 ):
    l_in_P = int(l_a/l) + 1
    i = 0
    P = (10 ** (l - 1))
    P = str(P)
    amount = 0
    while(i < l_in_P) :
        print(P, end='')
        i = i + 1

else :

    l_in_P = int(l_a/l)
    #print('l_in_P=', l_in_P)
    #print(l_in_P)

    #a_str = str(a)
    a_str = a
    int_for_P = a_str[0:l]

    compare = '='
    i = 0
    while(i<l_in_P):
        index = l*i
        #j = 0
        #while(j<l):
            #if( int(a_str[index+j]) != int(int_for_P[j]) ) :
                #if(int(a_str[index+j]) < int(int_for_P[j])) :
                    #compare = '<'
                #else:
                    #compare = '>'
                #break
            #j = j + 1
        #print(a_str[index:(index+l)],'int_for_P',int_for_P, i)
        difference = int(a_str[index:(index+l)]) - int(int_for_P)
        if(difference != 0) :
            if(difference < 0):
                compare = '<'
            else:
                compare = '>'
            break

        #if (compare != '='):
            #break
        i = i + 1

    if(compare == '<') :
        #int_for_P = str(int_for_P)
        i = 0
        while(i<l_in_P):
            print(int_for_P, end='')
            i = i + 1
    else:
        #P = int(int_for_P) + 1
        #exam_length_P = int(math.log10(P))+1
        #exam_length_P = len(str(P))
        if(int_for_P != ('9'*l)):
            #P = str(P)
            P = int_for_P
            k = l-1
            while(P[k] == '9'):
                k = k - 1

            P = P[0:(k)]+str(int(P[k])+1)+('0'*(l-k-1))

            i = 0
            while(i < l_in_P):
                print(P,end='')
                i = i + 1
        else:
            #P = 10 ** (l - 1)
            P = '1'+'0'*(l-1)
            l_in_P = l_in_P + 1
            #print('l_inP=',l_in_P)
            i = 0
            while (i < l_in_P):
                print(P, end='')
                i = i + 1
#t_f = time.time()
#print('')
#print(t_f-t_s)

n=int(input())
s=input()
k=len(s)
if k%n!=0 or s=="9"*(k):
    print(("1" + (n-1)*"0")*(k//n + 1))
else:
    s1=s[:n]*(k//n)
    # print(s1,s)
    for i in range(k):
        # print(i,s,s1)
        if int(s1[i])<int(s[i]):
            s2=''
            c=1
            for i in range(n -1,-1,-1):
                s2+=str((int(s[i]) + c)%10)
                c=(int(s[i]) + c)//10
                
            print(s2[::-1]*(k//n))
            break
        elif int(s1[i])>int(s[i]):
            print(s1)
            break
        elif i==k-1:
            s2=''
            c=1
            for i in range(n-1,-1,-1):
                s2+=str((int(s[i]) + c)%10)
                c=(int(s[i]) + c)//10
                
            print(s2[::-1]*(k//n))
            break


def revive(l):
    res = pow(10 , l-1)
    return str(res)



l = int(input())
s = input()
val = 0
if len(s) % l == 0:
    ans = s[:l]
    if ans*(len(s)//l) > s:
        print(ans*(len(s)//l))
        return
    elif ans == "9"*l:
        ans = revive(l)
        val = l
    else:
        ans = str(int(ans) + 1)
else:
    ans = revive(l)
print(ans*((len(s) + l-1 + val)//l))

import sys
l=int(sys.stdin.readline())
s=sys.stdin.readline()[:-1]
def check(s):
    n=len(s)
    for i in range(n):
        if s[i]!='9':
            return False
    return True
n=len(s)
if n%l!=0:
    ans=['0' for _ in range(l)]
    ans[0]='1'
    x=['0' for _ in range(l*(n//l+1))]
    i=0
    while i<(n//l+1)*l:
        for j in range(l):
            x[i]=ans[j]
            i+=1
    print(''.join(y for y in x))
else:
    j=l-1
    #print('divisible')
    carry=1
    s_ind=''
    for i in range(l-1,-1,-1):
        y=(int(s[i])+carry)%10
        carry=(int(s[i])+carry)//10
        if carry==0:
            s_ind=str(y)
            break
    #print(i,'ii',carry)
    if carry:
        #print('a')
        if check(s):
            ans=['0' for _ in range(l)]
            ans[0]='1'
            i=0
            #print(ans,'ans')
            x=['0' for _ in range(l*(n//l+1))]
            #print(x,'x')
            while i<(n//l+1)*l:
                for j in range(l):
                    x[i]=ans[j]
                    i+=1
        else:
            x=['9' for _ in range(l*(n//l+1))]
        print(''.join(y for y in x))
    else:
        ans=['0' for _ in range(l)]
        ans[i]=str(y)
        for j in range(i):
            ans[j]=s[j]
        for j in range(i+1,l):
            ans[j]='0'
        x=['0' for _ in range(n)]
        i=0
        while i<(n//l)*l:
            for j in range(l):
                x[i]=ans[j]
                i+=1
        b=s[:l]*(n//l)
        #print(s[:l])
        #print(b,'s')
        
        a=''.join(y for y in x)
        #print(a,'a')
        if a<b:
            print(a)
        else:
            if b>s:
                print(b)
            else:
                print(a)
    
                    


l=int(input())
a=input()
lena=len(a)
if lena%l != 0:
    ans="1"+("0"*(l-1))
    ans=ans*(lena//l+1)
    print(ans)
else:
    seg=lena//l
    now=a[0:l]
    flag=0
    for i in range(seg):
        if now>a[i*l:(i+1)*l]:
            flag=1
            break
        elif now<a[i*l:(i+1)*l]:
            break;
    if flag==0:
        if now.count("9")==l:
            now="1"+"0"*(l-1);
            seg+=1
        else:
            now=str(int(now)+1)
    print(now*seg)