Harryxun/stf_run huggingface dataset:
n,k,c= map(int, input().split())
s=input()
l=[]

for c in s.split("x"*c):
    count=0
    while i<len()
    if i=="o":


### FIXED CODE ###

n,k,rest=map(int,input().split())
s=input()

last=-3000000
l1=[]
l2=set()
for i,c in enumerate(s):
    if last+rest<i and c=="o":
        last=i
        l1.append(i)
last=6000000
for i,c in enumerate(reversed(s)):
    if n-1-i<last-rest and c=="o":
        last=n-1-i
        l2.add(n-1-i)

if len(l1)!=k:
    print()
else:
    for i in l1:
        if i in l2:
            print(i+1)
import math
from functools import reduce

N = int(input())
monsters = list(map(int,input().split()))

print(reduce(math.gcd, monsters))

### FIXED CODE ###

N = int(input())
monsters = list(map(int,input().split()))
monsters = sorted(monsters)

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

if N == 1:
    print(monsters[0])
else:
    ans = gcd(monsters[0], monsters[1])
    if N == 2:
        print(ans)
    else:
        for i in range(2, N):
            ans = gcd(ans,monsters[i])
        print(ans)
N, A = [int(_) for _ in input().split()]

MAX_I = 200
memo = [[0] * MAX_I for _ in range(N + 2)]


def cnv(v):
    return v - A + (MAX_I // 2)


X = [int(_) for _ in input().split()]
for i in range(N):
    offset = X[i] - A
    # print('x', offset)

    mm = memo[i]
    for j in range(MAX_I):
        if mm[j] > 0:
            # print('j+x', j + offset)
            memo[i + 1][j + offset] += mm[j]
        memo[i + 1][j] += mm[j]

    memo[i + 1][cnv(X[i])] += 1
    # print(memo[i + 1][90:110])

print(memo[i + 1][100])


### FIXED CODE ###

N, A = [int(_) for _ in input().split()]

MAX_I = 5000
memo = [[0] * MAX_I for _ in range(N + 2)]


def cnv(v):
    return v - A + (MAX_I // 2)


X = [int(_) for _ in input().split()]
for i in range(N):
    offset = X[i] - A
    # print('x', offset)

    mm = memo[i]
    for j in range(MAX_I):
        if mm[j] > 0:
            memo[i + 1][j + offset] += mm[j]
        memo[i + 1][j] += mm[j]

    memo[i + 1][cnv(X[i])] += 1

print(memo[N][MAX_I//2])
from collections import defaultdict
import bisect
N,X = map(int,input().split())
S = list(map(int,input().split()))
S.sort()
mod = 10**9+7

fact_memo = [0]*201
fact_memo[0] = 1
def fact(n):
    if fact_memo[n] == 0:
        fact_memo[n] = n*fact(n-1)%mod
    return fact_memo[n]

fact_inv_memo = [0]*201
fact_inv_memo[0] = 1
def fact_inv(n):
    if fact_inv_memo[n] == 0:
        fact_inv_memo[n] = pow(fact(n),mod-2,mod)
    return fact_inv_memo[n]

dp = defaultdict(lambda :-1)

def rec(n,x):
    if dp[(n,x)] != -1:
        return dp[(n,x)]
    if n == 0:
        dp[(n,x)] = x%S[0]
        return dp[(n,x)]
    s = S[:n+1]
    if x <= s[-1]:
        k = bisect.bisect(s,x)
        if k == 0:
            dp[(n,x)] = x*fact(n+1)%mod
        else:
            dp[(n,x)] = fact(n+1)*fact_inv(k)*rec(k-1,x)%mod
    else:
        res = x%s[0]*fact(n)%mod
        for i in range(1,n+1):
            res += fact(n)*fact_inv(i)*rec(i-1,x%s[i])%mod
        dp[(n,x)] = res%mod
    return dp[(n,x)]
        
print(rec(N-1,X))

### FIXED CODE ###

from collections import defaultdict
N,X = map(int,input().split())
S = list(map(int,input().split()))
S.sort()
mod = 10**9+7

fact_memo = [0]*201
fact_memo[0] = 1
def fact(n):
    if fact_memo[n] == 0:
        fact_memo[n] = n*fact(n-1)%mod
    return fact_memo[n]

fact_inv_memo = [0]*201
fact_inv_memo[0] = 1
def fact_inv(n):
    if fact_inv_memo[n] == 0:
        fact_inv_memo[n] = pow(fact(n),mod-2,mod)
    return fact_inv_memo[n]

dp = defaultdict(lambda :[-1]*(X+1))
for n in range(N):
    for x in range(X+1):
        if n == 0:
            dp[n][x]=x%S[0]
        else:
            dp[n][x]=(dp[n-1][x%S[n]]+n*dp[n-1][x])%mod

print(dp[N-1][X])
N = int(input())
h = list(map(int,input().split()))
h.append(0)

count=0
while 1:
  flag = 0
  for i in range(N):
    if h[i]>0:
      h[i] -= 1
      flag = 1
      if h[i+1] == 0:
        count += 1
      else:
        pass
  if flag == 0:
    break
print(count)

### FIXED CODE ###

N,K=list(map(int,input().split()))
h=[]
for i in range(N):
  h.append(int(input()))
h.sort()

minimum=1000000000
for j in range(N-K+1):
  minimum=min(minimum, h[j+K-1]-h[j])
print(minimum)
a = int(input())
b = int(input())
if (a*b)%2 == 0:
    print('Even')
else:
    print('Odd')

### FIXED CODE ###

a,b =map(int,input().split())
if (a*b)%2 == 0:
    print('Even')
else:
    print('Odd')
from heapq import *
import sys
from collections import *
from itertools import *
from decimal import *
import copy
from bisect import *
import math
sys.setrecursionlimit(4100000)
def gcd(a,b):
    if(a%b==0):return(b)
    return (gcd(b,a%b))
input=lambda :sys.stdin.readline().rstrip()
N,K=map(int,input().split())

A=list(map(int,input().split()))
mod=10**9+7
Am=[-i for i in A if i<0]
Ap=[i for i in A if i>=0]

Am.sort()
Ap.sort()
Am=deque(Am)
Ap=deque(Ap)



if N==K:
    c=1
    for a in A:
        c*=a
        c%=mod

elif len(Ap)==0 and K%2:
    c=1
    while K :
        c*=Am.popleft()

        K-=1

        c%=mod
    c=-c
    c%=mod
    #print("unko")

else:
    #print(unko)
    c=1
    h=0
    a="unko"
    b="unko"
    while K and (Am or Ap) :
        if Am and Ap:
            if Am[-1]>Ap[-1]:

                a=Am.pop()
                c*=a
                h+=1
            else:

                b=Ap.pop()
                c*=b

        elif Am:
            a=Am.pop()
            c*=a
            h+=1
        elif Ap:
            b=Ap.pop()
            c*=b
        K-=1
        c%=mod

    if h%2:
        if Am and Ap and a!="unko" and b!="unko":
            if Am[-1]*a>Ap[-1]*b:
                a=Am.pop()
                c*=a
                c*=pow(b,mod-2,mod)
            else:
                b=Ap.pop()
                c*=b
                c*=pow(a,mod-2,mod)
        elif Am:
            a=Am.pop()
            c*=a
            c*=pow(b,mod-2,mod)
        else:
            b=Ap.pop()
            c*=b
            c*=pow(a,mod-2,mod)


print(c%mod)


### FIXED CODE ###

from heapq import *
import sys
from collections import *
from itertools import *
from decimal import *
import copy
from bisect import *
import math
sys.setrecursionlimit(4100000)
def gcd(a,b):
    if(a%b==0):return(b)
    return (gcd(b,a%b))
input=lambda :sys.stdin.readline().rstrip()
N,K=map(int,input().split())

A=list(map(int,input().split()))
mod=10**9+7
Am=[-i for i in A if i<0]
Ap=[i for i in A if i>=0]

Am.sort()
Ap.sort()
Am=deque(Am)
Ap=deque(Ap)



if N==K:
    c=1
    for a in A:
        c*=a
        c%=mod

elif len(Ap)==0 and K%2:
    c=1
    while K :
        c*=Am.popleft()

        K-=1

        c%=mod
    c=-c
    c%=mod
    #print("unko")

else:
    #print(unko)
    c=1
    h=0
    a="unko"
    b="unko"
    while K and (Am or Ap) :
        if Am and Ap:
            if Am[-1]>Ap[-1]:

                a=Am.pop()
                c*=a
                h+=1
            else:

                b=Ap.pop()
                c*=b

        elif Am:
            a=Am.pop()
            c*=a
            h+=1
        elif Ap:
            b=Ap.pop()
            c*=b
        K-=1
        c%=mod

    if h%2:
        if Am and Ap and a!="unko" and b!="unko":
            if Am[-1]*a>Ap[-1]*b:
                a=Am.pop()
                c*=a
                c*=pow(b,mod-2,mod)
            else:
                b=Ap.pop()
                c*=b
                c*=pow(a,mod-2,mod)
        elif Am and b!="unko":
            a=Am.pop()
            c*=a
            c*=pow(b,mod-2,mod)
        else:
            b=Ap.pop()
            c*=b
            c*=pow(a,mod-2,mod)


print(c%mod)
A,B=int(input()),float(input())
print(A*B//1)

### FIXED CODE ###

A,B=input().split()
A=int(A)
B=int(B.replace(".",""))
print(A*B//100)
a=input().split()
if int(a[0])>int(a[1])*int(a[2]):
  print("No")
else:
print("Yes")

### FIXED CODE ###

a=input().split()
if int(a[0])>int(a[1])*int(a[2]):
  print("No")
else:
  print("Yes")
import math
A,B,H,M=map(int,input().split())
cen=(60*H+M)/2-6*M
cen_cos=math.cos(math.radian(cen))

print(A**2+B**2-2*cen_cos*A*B)


### FIXED CODE ###

import math
A,B,H,M=map(int,input().split())
cen=(60*H+M)/2-6*M
cen_cos=math.cos(math.radians(cen))

print((A**2+B**2-2*cen_cos*A*B)**0.5)
n,l=map(int,input().split())
s=[input() for i in range(n)]
S="".join(sorted(s))
print(S)


### FIXED CODE ###

print(["NO","YES"][eval(input().replace(" ","*"))==175])
import time

n, m, k = map(int, input().split())

friends = [[] for i in range(n)]
cands = [None for i in range(n)]
cycles = []
visited = [False for i in range(n)]
count = [0 for i in range(n)]
for _ in range(m):
    a, b = map(lambda x: int(x)-1, input().split())
    friends[a].append(b)
    friends[b].append(a)

def dfs(x):
    if visited[x]:
        return
    visited[x] = True
    cycle.append(x)
    for i in friends[x]:
        dfs(i)
    return

for i, v in enumerate(visited):
    if v:
        continue
    cycle = []
    dfs(i)
    l = len(cycle)
    ind = len(cycles)
    cycles.append(cycle)
    for fr in cycle:
        cands[fr] = ind
        count[fr] = l - 1 - len(friends[fr])

time.sleep(3)

for _ in range(k):
    a, b = map(lambda x: int(x)-1, input().split())
    if a in cycles[cands[b]]:
        count[a] -= 1
        count[b] -= 1

for i in count:
    print(i, end=" ")

### FIXED CODE ###

import time, sys
sys.setrecursionlimit(int(1e7))

n, m, k = map(int, input().split())

friends = [[] for i in range(n)]
cands = [None for i in range(n)]
cycles = []
visited = [False for i in range(n)]
count = [0 for i in range(n)]
for _ in range(m):
    a, b = map(lambda x: int(x)-1, input().split())
    friends[a].append(b)
    friends[b].append(a)

def dfs(x):
    visited[x] = True
    cycle.add(x)
    for i in friends[x]:
        if not visited[i]:
            dfs(i)
    return


for i, v in enumerate(visited):
    if v:
        continue
    cycle = set()
    dfs(i)
    l = len(cycle)
    ind = len(cycles)
    cycles.append(cycle)
    for fr in cycle:
        cands[fr] = ind
        count[fr] = l - 1 - len(friends[fr])


for _ in range(k):
    a, b = map(lambda x: int(x)-1, input().split())
    if a in cycles[cands[b]]:
        count[a] -= 1
        count[b] -= 1

for i in count:
    print(i, end=" ")
S = list(str(input()))

ans = ''
y = ''

for index, s in enumerate(S):
  y += s
  if index == 3:
    ans = 2018
    break
    
for s in S[4:]:
  ans += s
print(ans)

      

### FIXED CODE ###

S = list(str(input()))

ans = ''
y = ''

for index, s in enumerate(S):
  y += s
  if index == 3:
    ans = '2018'
    break
    
for s in S[4:]:
  ans += s
print(ans)
import math
from functools import reduce

N = int(input())
T = map(int, [input() for _ in range(N)])

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(numbers):
    return reduce(lcm_base, numbers, 1)

print(lcm(T))


### FIXED CODE ###

# import math
from fractions import gcd
from functools import reduce

N = int(input())
T = map(int, [input() for _ in range(N)])

def lcm_base(x, y):
    return (x * y) // gcd(x, y)

def lcm(numbers):
    return reduce(lcm_base, numbers, 1)

print(lcm(T))
import sys
input = sys.stdin.readline
from operator import itemgetter
import itertools

def main():
    n, m = map(int, input().strip().split())
    lis = [[] for _ in range(n)]
    for _ in range(m):
        a, b = list(map(lambda x: x-1, map(int, input().strip().split())))
        lis[a].append(b)
        lis[b].append(a)
    ans = 0
    for path in itertools.permutations(range(8), 8):
        if all(path[i+1] in lis[path[i]] for i in range(n-1)):
            ans += 1
    print(ans)

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
input = sys.stdin.readline
from operator import itemgetter

lis = []
n = 0
m = 0
ans = 0

def dfs(i, d, fr, used):
    global lis, ans
    if i in used:
        return
    if d == n - 1:
        ans += 1
        return
    for j in lis[i]:
        if j != fr:
            used.append(i)
            # print(i+1 , j+1)
            dfs(j, d+1, i, used)
            used.pop()


def main():
    global lis, n, m, ans
    n, m = map(int, input().strip().split())
    lis = [[] for _ in range(8)]
    for _ in range(m):
        a, b = list(map(lambda x: x-1, map(int, input().strip().split())))
        lis[a].append(b)
        lis[b].append(a)
    # print("##")
    dfs(0, 0, -1, [])
    print(ans)

if __name__ == '__main__':
    main()
s=input()

k=list(s)
m=list(set(l))

if len(k)==len(m):
  print("yes")
else:
  print("no")

### FIXED CODE ###

s=input()

k=list(s)
m=list(set(s))

if len(k)==len(m):
  print("yes")
else:
  print("no")
import math

n = int(input())
a = list(map(int, input().split()))
max = 0

for i in range(n):
    if i == 0:
        b = a[1:]
    elif i == n-1:
        b = a[:n-1]
    else:
        tmp1 = a[:i]
        tmp2 = a[i+1:]
        b = []
        b.extend(tmp1)
        b.extend(tmp2)
    current = b[0]
    for j in range(n-1):
        current = math.gcd(current, b[j])
    if max < current:
        max = current
print(max)


### FIXED CODE ###

a, b, t = map(int, input().split())
times = t // a
print(times*b)
a=1
b=0
c=-1
A,B,C,K=input().split()
A=int(A)
B=int(B)
C=int(C)
K=int(K)
if K>0:
    if K>=0:
        test=a*A
        K=K-A
    if K>=0:
        test=test+b*B
        K=K-B
    if K>=0:
        test=test+c*K
else:
    test=0
print(test)

### FIXED CODE ###

S=input()
T=input()


if len(S)+1==len(T):
    for i in range(len(S)): #回数の時は絶対range()
        if S[i]==T[i]:
            a='ok'
            continue
        else:
            a='no'
            break
else:
    print('no')

if a=='ok':
    print('Yes')
else:
    print('No')
a,b,x=map(int,input().split())
cnt=0
while b-a<k:
	b-=k
	cnt+=1
print(cnt)

### FIXED CODE ###

a,b,x=map(int,input().split())
ans_a=(a-1)//x
ans_b=b//x
print(ans_b-ans_a)
def main():
    n,k,c=map(int,input().split())
    s=list(input())
    l=[0]*(k+1)
    r=[0]*(k+1)
    x=0
    i=0
    while i<=n-1:
        if s[i]=='o':
            x+=1
            l[x]=i+1
            i+=k+1
            if x==k:
                break
        else:
            i+=1
    i=n-1
    while 0<=i:
        if s[i]=='o':
            r[x]=i+1
            x-=1
            i-=k+1
            if x==1:
                break
        else:
            i-=1
    for i in range(1,k+1):
        if l[i]==r[i]:
            print(l[i])

if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    n,k,c=map(int,input().split())
    s=list(input())
    l,r=[0]*(k+1),[0]*(k+1)
    x,i=1,0
    while i<=n-1:
        if s[i]=='o':
            l[x]=i+1
            i+=c+1
            x+=1
            if x==k+1:
                break
        else:
            i+=1
    x,i=k,n-1
    while 0<=i:
        if s[i]=='o':
            r[x]=i+1
            x-=1
            i-=c+1
            if x==0:
                break
        else:
            i-=1
    for i in range(1,k+1):
        if l[i]==r[i]:
            print(l[i])

if __name__ == '__main__':
    main()
import math
n = int(input())
a = [int(x) for x in input().split()]
g = a[0]
if n>1:
    for idx in range(1,len(a)):
        g = a[idx]*g//math.gcd(a[idx],g)
ans = []
for i in range(n):
    ans.append(int(g/a[i]))
print(sum(ans)%(10**9+7))

### FIXED CODE ###

from fractions import gcd
n = int(input())
a = [int(x) for x in input().split()]
g = a[0]
for i in a:
    g = i*g//gcd(i,g)
ans = 0
for i in range(n):
    ans+=int(g//a[i])
print(ans%(10**9+7))
line = sys.stdin.readlines()
a,b = map(int, line.strip().split(','))

### FIXED CODE ###

for i in range(1, 10):
	for j in range(1, 10):
		print "%sx%s=%s"%(i,j,i*j)
n, k = map(int, input().split())
a = list(map(int, input().split()))

ans = int((n-k)/(k-1)+2)
print(ans)

### FIXED CODE ###

inp = input()
plus = int(inp.count("+"))
minus = int(inp.count("-"))
print(plus-minus)
input()
print(" ".join(input().split()[::-1])

### FIXED CODE ###

input()
print(" ".join(input().split()[::-1]))
S=int(input())
if S[0]==S[1] or S[1]==S[2} or S[2]==S[3]:
  print("Bad")
else:
  print("Good")

### FIXED CODE ###

S=input()
if S[0]==S[1] or S[1]==S[2] or S[2]==S[3]:
  print("Bad")
else:
  print("Good")
import sys
sys.setrecursionlimit(4100000)
import math
INF = 10**9

def main():
    n,m = map(int, input().split())
    wa = 0
    ac = 0
    used = {}
    wa_tmp = {}
    for _ in range(m):
        p,s = map(str, input().split())
        if used.get(p):
            continue
        if s == 'WA':
            if not wa_tmp.get(p):
                wa_tmp[p] = 0
            wa_tmp[p] += 1
        if s == 'AC':
            ac += 1
            used[p] = True
            wa += wa_tmp[p]
    print(ac, wa)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
sys.setrecursionlimit(4100000)
import math
INF = 10**9

def main():
    n,m = map(int, input().split())
    wa = 0
    ac = 0
    used = {}
    wa_tmp = {}
    for _ in range(m):
        p,s = map(str, input().split())
        if used.get(p):
            continue
        if s == 'WA':
            if not wa_tmp.get(p):
                wa_tmp[p] = 0
            wa_tmp[p] += 1
        if s == 'AC':
            ac += 1
            used[p] = True
            if wa_tmp.get(p):
                wa += wa_tmp[p]
    print(ac, wa)


if __name__ == '__main__':
    main()
A, B = [int(i) for i in input().split()]
     
    if B % A == 0:
      print(A + B)
    else:
      print(B - A)

### FIXED CODE ###

A, B = [int(i) for i in input().split()]
if B % A == 0:
	print(A + B)
else:
	print(B - A)
import sys
from numba import njit
input = sys.stdin.buffer.readline


@njit
def main():
    K = int(input())
    A, B = map(int, input().split())
    for i in range(A, B + 1):
        if i % K == 0:
            print('OK')
            return 0
    print('NG')
    return 0


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
input = sys.stdin.buffer.readline

K = int(input())

A, B = map(int, input().split())


def main(K, A, B):
    for i in range(A, B + 1):
        if i % K == 0:
            print('OK')
            sys.exit()
    print('NG')


if __name__ == '__main__':
    main(K, A, B)
h,n = input().split()
a = input().split()
value = int(sorted(a)[-1]) + int(sorted(a)[-2])
result = 'yes' if value >= int(h) else 'no'
print(result)

### FIXED CODE ###

H,N = map(int,input().split())

A = input().split()

result = 0

for i in range(N):
    result += int(A[i])

if H - result <= 0:
    print("Yes")
else:
    print("No")
n = int(input())
x = [0]*n
y = [0]*n
h = [0]*n
for i in range(n):
    x[i],y[i],h[i] = map(int,input().split())

H = max(h)
while 1:
  for i in range(101):
    for j in range(101):
      for k in range(n):
        dx,dy = abs(x[k]-i),abs(x[k]-j)
        if max(H-dx-dy)!=h[k]:
          break
        else:
          print(i,j,H)
          exit()
  H +=1
    


### FIXED CODE ###

n = int(input())
x = [0]*n
y = [0]*n
h = [0]*n
for i in range(n):
    x[i],y[i],h[i] = map(int,input().split())

H = max(h)
while 1:
  for i in range(101):
    for j in range(101):
      flg =True
      for k in range(n):
        dx,dy = abs(x[k]-i),abs(y[k]-j)
        if max(H-dx-dy,0)!=h[k]:
          flg = False
      if flg:
        print(i,j,H)
        exit()
  H +=1
x=int(input(x, y))
print(x * y)


### FIXED CODE ###

x, y = map(int, input().split())
print(x * y, 2 * (x + y))
n, m, k = map(int, input().split())
mod = 998244353

N = 10**5  # N!まで求める
fact  = [1, 1]  # 階乗の元テーブル
fact_inv = [1, 1]  # 階乗の逆元テーブル
inv = [0, 1]  # 逆元テーブル計算用テーブル 1,2,,...の逆元を求めてる

# 計算 O(1)
def comb(n, r, mod):
    if (r<0 or r>n):
        return 0
    r = min(r, n-r)
    return fact[n] * fact_inv[r] * fact_inv[n-r] % mod

# 順列
def perm(n, r, mod):
    if (r<0 or r>n):
        return 0
    return fact[n] *  fact_inv[n-r] % mod

# 前処理 O(n)
for i in range(2, N + 1):
    fact.append((fact[-1] * i) % mod)
    inv.append((-inv[mod % i] * (mod//i)) % mod)
    fact_inv.append((fact_inv[-1] * inv[-1]) % mod)

ans = 0
for i in range(k+1):
    ans += comb(n-1, i, mod) * m * pow(m-1, n-i-1, mod)
    ans %= mod

print(ans)

### FIXED CODE ###

n, m, k = map(int, input().split())
mod = 998244353

N = 10**6  # N!まで求める
fact  = [1, 1]  # 階乗の元テーブル
fact_inv = [1, 1]  # 階乗の逆元テーブル
inv = [0, 1]  # 逆元テーブル計算用テーブル 1,2,,...の逆元を求めてる

# 計算 O(1)
def comb(n, r, mod):
    if (r<0 or r>n):
        return 0
    r = min(r, n-r)
    return fact[n] * fact_inv[r] * fact_inv[n-r] % mod

# 順列
def perm(n, r, mod):
    if (r<0 or r>n):
        return 0
    return fact[n] *  fact_inv[n-r] % mod

# 前処理 O(n)
for i in range(2, N + 1):
    fact.append((fact[-1] * i) % mod)
    inv.append((-inv[mod % i] * (mod//i)) % mod)
    fact_inv.append((fact_inv[-1] * inv[-1]) % mod)

ans = 0
for i in range(k+1):
    ans += comb(n-1, i, mod) * m * pow(m-1, n-i-1, mod)
    ans %= mod

print(ans)
n = int(input())
B = list(map(int, input().split()))

if B[0] != 1:
	print(-1)
	exit()

cnt = 1
for i in range(1, n):
	if B[i] == 1:
		cnt = 1
	
	if B[i] - 1 <= cnt:
		cnt += 1
	else:
		print(-1)
		exit()

res = []
end = n
for i in reversed(range(n)):
	if B[i] == 1:
		A = B[i + 1 : end]
		res.append(1)
		L = []
		for j in range(len(A)):
			if j + 2 != A[j]:
				L.append(A[j])
				A.pop(j)
			
		L.sort()
		for l in L:
			res.append(l)
		
		for a in A:
			res.append(a)
			
		end = i

for i in res:
	print(i)
		
	

### FIXED CODE ###

import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n = int(input())
    B = list(map(int, input().split()))

    res = []
    for i in range(n):
        L = len(B)
        for j in reversed(range(L)):
            if j + 1 == B[j]:
                res.append(B[j])
                B.pop(j)
                break
        else:
            print(-1)
            exit()

    res = res[::-1]
    for i in res:
        print(i)


if __name__ == '__main__':
    resolve()
a = int(input())
b = int(input())
x = [1,2,3]
del x[a]
del x[b]
print(x[0])

### FIXED CODE ###

a = int(input())
b = int(input())
if a == 1:
  if b == 2:
    print(3)
  else:
    print(2)
elif a == 2:
  if b == 1:
    print(3)
  else:
    print(1)
elif a == 3:
  if b == 1:
    print(2)
  else:
    print(1)
import sys

x = int(raw_input())
print (x * x * x)

### FIXED CODE ###

import sys

x = int(input())
print (x * x * x)
#16D8101023J 久保田凌弥 kubotarouxxx python3

x=int(input())
y=int(input())

w=x*y
z=2*x+2*y

print(w,z)



### FIXED CODE ###

#16D8101023J 久保田凌弥 kubotarouxxx python3

x,y=map(int, input().split())
w=x*y
z=2*x+2*y

print(w,z)

#
a, b = map(int, input().split())
f = a / b
print(int(a / b), a % b, f"{a / b : .5f}")

### FIXED CODE ###

a, b = map(int, input().split())
d = a // b
r = a % b
f = a / b
print("{0} {1} {2:.6f}".format(d, r, f))
N, M, X = map(int,input().split())
A=[]
for i in range(N):
    A.append(list(map(int, input().split())))
    
pr=10**9
for s in range(2**N):
    x_m = [0]*13
    for i in range(N):
        b = (s >> i) & 1
        if b == 1:
            pr_s += A[i][0]
            for j in range(M+1):
                x_m[j] += A[i][j]

    xOk = True
    for j in range(1,M+1):
        if x_m[j] < X:
            xOk = False
    
    if xOk == True:
        pr = min(pr, x_m[0])

if pr<10**9:
    print(pr)
else:
    print(-1)

### FIXED CODE ###

N, M, X = map(int,input().split())
A=[]
for i in range(N):
    A.append(list(map(int, input().split())))
    
pr=10**9
for s in range(2**N):
    x_m = [0]*13
    for i in range(N):
        b = (s >> i) & 1
        if b == 1:
            for j in range(M+1):
                x_m[j] += A[i][j]
 
    xOk = True
    for j in range(1,M+1):
        if x_m[j] < X:
            xOk = False
    
    if xOk == True:
        pr = min(pr, x_m[0])
 
if pr<10**9:
    print(pr)
else:
    print(-1)