Harryxun/stf_run huggingface dataset:
N=int(input())
l=list(map(int,input().split()))
a=1
if N%2==0:
  if N!=set(l)*2:
    a=0
else:
  if l.count(0)!=1 or N!=2*len(set(l))+1:
    ans=0
  else:
    ans=0
if a:
  print((2**(N//2))%(10**9+7))
else:
  print(0)

### FIXED CODE ###

N=int(input())
l=list(map(int,input().split()))
a=1
if N%2==0:
    if len(l)!=len(set(l))*2:
        a=0
else:
    if l.count(0) == 1:
        l.remove(0)
        if len(l) != 2*len(set(l)):
            a = 0
    else:
        a=0
if a:
      print((2**(N//2))%(10**9+7))
else:
      print(0)
n,x = map(int, input().split())
l = list(map(int, input().split()))

ans = 1
t = 0
for i in range(x):
  t += l[i]
  if t <= x:
    ans += 1

print(ans)

### FIXED CODE ###

n,x = map(int, input().split())
l = list(map(int, input().split()))

s = 1
d = 0
for i in l:
  d += i
  if d <= x:
    s += 1
print(s)
import sys
s=input()
if("C" in s and "F" in s):
  for i in range(len(s)):
    if(s[i]=="C"):c=i
  for i in range(len(s))[::-1]:
    if(s[i]==="F"):f=i
  if(c<f):
    print("Yes")
    sys.exit()
print("No")


### FIXED CODE ###

import sys
s=input()
if("C" in s and "F" in s):
  for i in range(len(s)):
    if(s[i]=="C"):
      c=i
      break
  for i in range(len(s))[::-1]:
    if(s[i]=="F"):
      f=i
      break
  if(c<f):
    print("Yes")
    sys.exit()
print("No")
X, N = [int(i) for i in input().split()]
if N == 0:
    print(X)
else:
    Ps = set([int(i) for i in input().split()])
    if not X in Ps:
        print(X)

    diff = 0
    while True:
        if not X - diff in Ps:
            print(X - diff)
            break
        if not X + diff in Ps:
            print(X + diff)
            break
        diff += 1

### FIXED CODE ###

#!python
given = [int(i) for i in input().split()]
ans = [1,2,3,4,5]

for i in range(len(ans)):
    if ans[i] != given[i]:
        print(ans[i])
        break
import numpy as np

h,w=map(int,input().split())
s=[input() for i in range(h)]

l=[[0 for i in range(w)] for j in range(h)]
r=[[0 for i in range(w)] for j in range(h)]
d=[[0 for i in range(w)] for j in range(h)]
u=[[0 for i in range(w)] for j in range(h)]

for i in range(h):
    for j in range(w):
        if s[i][j]==".":
            if j == o:
                l[i][j]=1
            else:
                l[i][j]=l[i][j-1]+1

for i in range(h):
    for i in range(h-1,-1,-1):
        if s[i][j]==".":
            if j == w-1:
                r[i][j]=1
            else:
                r[i][j]=r[i][j+1]+1

for j in range(w):
    for i in range(h-1,-1,-1):
        if s[i][j]==".":
            if i == h-1:
                d[i][j]=1
            else:
                d[i][j]=d[i+1][j]+1

for j in range(w):
    for i in range(h):
        if s[i][j]=".":
            if i == 0:
                u[i][j]=1
            else:
                i[i][j]=u[i-1][j]+1

ans=0
x=[[0 for i in range(w)] for j in range(h)]
for i in range(h):
    for j in range(w):
        x[i][j] = l[i][j]+r[i][j]+u[i][j]+d[i][j]-3
    ans=max(ans,max(x[i]))

print(ans)

### FIXED CODE ###

import numpy as np

h,w=map(int,input().split())
s=[]
for i in range(h):
    s.append(list(input()))
grid=(np.array(s) ==".") *1

l=np.zeros((h,w),dtype=int)
r=np.zeros((h,w),dtype=int)
u=np.zeros((h,w),dtype=int)
d=np.zeros((h,w),dtype=int)

for j in range(w):
    if j == 0:
        l[:,j] = grid[:,j]
    else:
        l[:,j] = (l[:,j-1]+1) * grid[:,j]
for j in range(w-1,-1,-1):
    if j == (w-1):
        r[:,j] = grid[:,j]
    else:
        r[:,j] = (r[:,j+1] +1)*grid[:,j]

for i in range(h):
    if i == 0:
        u[i,:]=grid[i,:]
    else:
        u[i,:]=(u[i-1,:]+1)*grid[i,:]
for i in range(h-1,-1,-1):
    if i==(h-1):
        d[i,:]=grid[i,:]
    else:
        d[i,:]=(d[i+1,:]+1)*grid[i,:]


ans=np.max(l+r+u+d-3)
print(ans)
from fractions import gcd
from functools import reduce

def gcd(*numbers):
    return reduce(gcd, numbers)

def gcd_list(numbers):
    return reduce(gcd, numbers)

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

print(gcd_list(list_aaa))



### FIXED CODE ###

from fractions import gcd
from functools import reduce

def gcd_list(numbers):
    return reduce(gcd, numbers)

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

print(gcd_list(list_aaa))
n, k = map(int, input().split())
a = list(map(int, input().split()))
l = 1
m = []

for i in range(10000):
    if a[l - 1] in m: #ループが始まったかどうか
        for j in range(len(m)):
            if m[j] == a[l - 1]:
                cnt = j #ループ開始までの端数
                loop = len(m) - cnt #ループの長さ
                break
    else:
        m.append(a[l - 1])
        l = a[l - 1]
        continue
    break

l = 0 #ループの始まり

l = m[(k - cnt)%(loop) - 1 + cnt]

print(l)

### FIXED CODE ###

import sys
input = sys.stdin.readline

def main():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    l = [-1]*n
    now = 0
    order = 0
    l[0] = 0
    s = {}
    ans = -100

    for i in range(n):
        a[i] -= 1

    while k > 0:
        k -= 1
        now = a[now]
        order += 1
        if l[now] != -1: #既に訪問済の場合
            loop = order - l[now]
            k %= loop
        if k == 0:
            ans = now + 1
            break
        l[now] = order #転送順で何番目の町かを記録

    print(max(ans, -1))

main()
H,W=map(int, input().split())
S=[input() for _ in range(H)]

U=[[-1]*W for _ in range(H)]
D=[[-1]*W for _ in range(H)]
L=[[-1]*W for _ in range(H)]
R=[[-1]*W for _ in range(H)]

def u(i,j):
    if U[i][j]==-1 or U[i][j]==-2:
        if S[i][j]=='#':
            U[i][j]==-2
        elif i==0:
            U[i][j]=0
        elif U[i-1][j]==-1:
            u(i-1,j)
            if U[i-1][j]==-2:
                U[i][j]=0
            else:
                U[i][j]=U[i-1][j]+1
        elif U[i-1][j]==-2:
            U[i][j]=0
        else:
            U[i][j]=U[i-1][j]+1

def d(i,j):
    if D[i][j]==-1 or D[i][j]==-2:
        if S[i][j]=='#':
            D[i][j]==-2
        elif i==H-1:
            D[i][j]=0
        elif D[i+1][j]==-1:
            d(i+1,j)
            if D[i+1][j]==-2:
                D[i][j]=0
            else:
                D[i][j]=D[i+1][j]+1
        elif D[i+1][j]==-2:
            D[i][j]=0
        else:
            D[i][j]=D[i+1][j]+1

def l(i,j):
    if L[i][j]==-1 or L[i][j]==-2:
        if S[i][j]=='#':
            L[i][j]==-2
        elif j==0:
            L[i][j]=0
        elif L[i][j-1]==-1:
            l(i,j-1)
            if L[i][j-1]==-2:
                L[i][j]=0
            else:
                L[i][j]=L[i][j-1]+1
        elif L[i][j-1]==-2:
            L[i][j]=0
        else:
            L[i][j]=L[i][j-1]+1

def r(i,j):
    if R[i][j]==-1 or R[i][j]==-2:
        if S[i][j]=='#':
            R[i][j]==-2
        elif j==W-1:
            R[i][j]=0
        elif R[i][j+1]==-1:
            r(i,j+1)
            if R[i][j+1]==-2:
                R[i][j]=0
            else:
                R[i][j]=R[i][j+1]+1
        elif R[i][j+1]==-2:
            R[i][j]=0
        else:
            R[i][j]=R[i][j+1]+1

def udlr(i,j):
    if S[i][j]=='#':
        U[i][j]=D[i][j]=L[i][j]=R[i][j]=-2
        return 0
    else:
        if U[i][j]==-1:
            u(i,j)
        if D[i][j]==-1:
            d(i,j)
        if L[i][j]==-1:
            l(i,j)
        if R[i][j]==-1:
            r(i,j)
        return U[i][j]+D[i][j]+L[i][j]+R[i][j]+1

x=0
for i in range(H):
    for j in range(W):
        x=max(x,max(x,udlr(i,j)))
print(x)


### FIXED CODE ###

H,W = map(int,input().split())
G=[input() for _ in range(H)]
A_u=[[0 for _ in range(W)] for _ in range(H)]
A_d=[[0 for _ in range(W)] for _ in range(H)]
A_r=[[0 for _ in range(W)] for _ in range(H)]
A_l=[[0 for _ in range(W)] for _ in range(H)]
for h in range(H):
  for w in range(1,W):
    if G[h][w-1] == '.':
      A_r[h][w] = A_r[h][w-1]+1
  for w in range(W-2,-1,-1):
    if G[h][w+1] == '.':
      A_l[h][w] = A_l[h][w+1]+1
for w in range(W):
  for h in range(1,H):
    if G[h-1][w] == '.':
      A_d[h][w] = A_d[h-1][w]+1
  for h in range(H-2,-1,-1):
    if G[h+1][w] == '.':
      A_u[h][w] = A_u[h+1][w]+1
ans=0
for h in range(H):
  for w in range(W):
    if G[h][w] == '.':
      ans = max(ans,A_r[h][w]+A_l[h][w]+A_d[h][w]+A_u[h][w]+1)
print(ans)
print(-int(input()+2*int(input()))


### FIXED CODE ###

print(-int(input())+2*int(input()))
n, m = map(int, input().split()) #n:問題数 m:提出回数
ac = [0] * n
pen = [0] * n
pen_count = 0
for i in range(m):
    p, s = input().split()#p = 1, s = "WA"
    p = int(p) - 1
    if ac[p] == "AC":
        continue
    elif s == "AC":
        ac[p] = "AC"
    else:
        pen[p] += 1

for i in range(n):
    if ac[i] == "AC":
        pen_count += pen[i]

print(ac.count("AC"), pen_count)

### FIXED CODE ###

c = input()
a_list= list('abcdefghijklmnopqrstuvwxyz')
for i in range(0, len(a_list)):
    if a_list[i] == c:
        i += 1
        print(a_list[i])
S = input()

week = ["SUN","MOM","TUE","WED","THU","FRI","SAT"]

print(len(week)-week.index(S))

### FIXED CODE ###

S = input()

week = ["SUN","MON","TUE","WED","THU","FRI","SAT"]

print(len(week)-week.index(S))
n=int(input())
elements= input().split()
q=int(input())
actions=[]
for i in range(q):
    actions.append(input().split())
 
dict={}
for e in elements:
    count=dict.get(e,0)
    count+=1
    dict[e]=count
 
sum=0
for key in dict.keys():
    sum+=int(key)* dict[key]

for act in actions:
    count=dict.get(act[0],0)
    sum+=(int(act[1])-int(act[0]))*count
    count+=dict.get(act[1],0)
    dict[act[1]]=count
    del dict[act[0]]
 
    print(str(sum))

### FIXED CODE ###

n=int(input())
elements= input().split()
q=int(input())
actions=[]
for i in range(q):
    actions.append(input().split())
 
dict={}
for e in elements:
    count=dict.get(e,0)
    count+=1
    dict[e]=count
 
sum=0
for key in dict.keys():
    sum+=int(key)* dict[key]

for act in actions:
    count=dict.get(act[0],0)
    sum+=(int(act[1])-int(act[0]))*count
    count+=dict.get(act[1],0)
    dict[act[1]]=count
    dict[act[0]]=0
 
    print(str(sum))
a,b=map(input().split())
if a==b:
  print("H")
else:
  print("D")

### FIXED CODE ###

a,b=input().split()
if a==b:
  print("H")
else:
  print("D")
def main():
    n = int(input())
    h = list(map(int, input().split(' ')))
    l = [h[i] - h[i + 1] for i in range(n-1)]
    print('Yes' if check(l) else 'No')


def check(l):
    if len(l) <= 1:
        return True
    else:
        return check(l[1::]) if l[0] + l[1] <= 1 else False


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    n = int(input())
    h = list(map(int, input().split(' ')))

    ans = True
    MAX = h[0]
    for i in range(n):
        if h[i] > MAX:
            MAX = h[i]
        elif h[i] < MAX - 1:
            ans = False
        else:
            continue
        
    print('Yes' if ans else 'No')


if __name__ == '__main__':
    main()
s,t=map(str,input().split())
a,b=map(int,input().split())
q=input()
print("{x} {y}".format(a-1,b) if q==s else "{x} {y}".format(a,b-1))


### FIXED CODE ###

s,t=map(str,input().split())
a,b=map(int,input().split())
q=input()
print("{} {}".format(a-1,b) if q==s else "{} {}".format(a,b-1))
Not found

### FIXED CODE ###

from itertools import permutations
 
n = int(input())
p = tuple(map(int, input().split()))
q = tuple(map(int, input().split()))
a = list(permutations(range(1, n + 1)))
print(abs(a.index(p) - a.index(q)))
n = int(input())
li = []
if n==1:
  print(0)
else:
  for i in range(1000000):
    if n==1:
      break
    if i==0 or i==1 or n%i!=0:
      continue
    j = i
    cnt = 0
    while(n%j==0):
      if flg==0:
        flg = 1
      n /= j
      cnt += 1
    li.append(cnt)
  if flg==0:
    print(1)
  else:
    ans = 0
    for e in li:
      i = 1
      while(e-i>=0):
        e -= i
        i += 1
        ans += 1
    print(ans)

### FIXED CODE ###

n = int(input())
li = []
flg = 0
for i in range(1000000):
  if n==1:
    break
  if i==0 or i==1 or n%i!=0:
    continue
  j = i
  cnt = 0
  while(n%j==0):
    if flg==0:
      flg = 1
    n /= j
    cnt += 1
  li.append(cnt)
if flg==0 and n!=1:
  print(1)
elif flg==0 and n==1:
  print(0)
elif n==1:
  ans = 0
  for e in li:
    i = 1
    while(e-i>=0):
      e -= i
      i += 1
      ans += 1
  print(ans)
else:
  ans = 1
  for e in li:
    i = 1
    while(e-i>=0):
      e -= i
      i += 1
      ans += 1
  print(ans)
import math
import sys
row=int(input())
lis=[list(map(int,input().split())) for i in range(row)]
for i in range(len(lis) - 1):
  d_t = lis[i + 1, 0] - lis[i, 0]
  man_dis = math.abs(lis[i + 1, 1] - lis[i, 1]) + math.abs(lis[i + 1, 2] - lis[i, 2])
  if d_t < man_dis or d_t % 2 - man_dis % 2 != 0:
    print("No")
    sys.exit()
print("Yes")

### FIXED CODE ###

import sys
lis =list()
lis.append([0, 0, 0])
sys.stdin.readline()
for e in sys.stdin:
  lis.append(list(map(int, e.split())))
for i in range(len(lis) - 1):
  d_t = lis[i + 1][0] - lis[i][0]
  man_dis = abs(lis[i + 1][1] - lis[i][1]) + abs(lis[i + 1][2] - lis[i][2])
  if d_t < man_dis or d_t % 2 - man_dis % 2 != 0:
    print("No")
    sys.exit()
print("Yes")
a,b,c=input().split()
a=int(a)
b=int(b)
c=int(c)
if ((100*a+10*b+c)%4)=0:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

a,b,c=input().split()
a=int(a)
b=int(b)
c=int(c)
if ((100*a+10*b+c)%4)==0:
  print("YES")
else:
  print("NO")
s = int(input())
w = int(input())

if s =< w:
  print("unsafe")
else:
  print("safe)

### FIXED CODE ###

S,W=(int(x) for x in input().split())

if S <= W:
  print('unsafe')
else:
  print('safe')
#include <bits/stdc++.h>
using namespace std;

int main() {
    int K, S; cin >> K >> S;
    long long ans = 0;
    for (int x = 0; x <= K; ++x) {
        for (int y = 0; y <= K; ++y) {
            for (int z = 0; z <= K; ++z) {
                if (x + y + z == S) ans++;
            }
        }
    }
    cout << ans << endl;
}

### FIXED CODE ###

K, S = map(int, input().split())

ans = 0
for x in range(K + 1):
    for y in range(K + 1):
        z = S - (x + y)
        if 0 <= z and z <= K:
            ans += 1

print(ans)
import numpy as np
n,k = map(int,input().split())
s = list(input())
 
l0 = []
l1 = []
pred = s[0]
if s[0] == "0":
    l0.append(1)
    l1.append(0)
else:
    l1.append(1)
 
for i in range(1,n):
    if pred == s[i]:
        if s[i] == "0":
            l0[-1] += 1
        else:
            l1[-1] += 1
    else:
        if s[i] == "0":
            l0.append(1)
        else:
            l1.append(1)
    pred = s[i]
if s[-1] == "0":    
    l1.append(0)

ans = 0
if k >= len(l0):
    print(n)
else:
    nl1 = len(l1)
    for i in range(nl1-k):
        ans = max(ans,(sum(l0[i:i+k])+sum(l1[i:i+k+1])))
    print(ans)

### FIXED CODE ###

n,k = map(int,input().split())
s = list(input())
 
l0 = []
l1 = []
pred = s[0]
if s[0] == "0":
    l0.append(1)
    l1.append(0)
else:
    l1.append(1)
 
for i in range(1,n):
    if pred == s[i]:
        if s[i] == "0":
            l0[-1] += 1
        else:
            l1[-1] += 1
    else:
        if s[i] == "0":
            l0.append(1)
        else:
            l1.append(1)
    pred = s[i]
if s[-1] == "0":    
    l1.append(0)
 
ans = sum(l0[:k])+sum(l1[:k+1])
tmp = ans
for i in range(k,min(len(l0),len(l1))):
    tmp -= l0[i-k]
    tmp -= l1[i-k]
    tmp += l0[i]
    tmp += l1[i+1]
    ans = max(ans, tmp)
print(ans)
N = int(input())
for i in range(N):
    if math.floor(i * 1.08) == N:
        print(i)
        exit(0)
print(':(')

### FIXED CODE ###

import math
N = int(input())
f = False
for i in range(N+1):
    if math.floor(i * 1.08) == N:
        print(i)
        f = True
        break
if not f:
    print(':(')
a=input().split()
    a=list(a)
    b=input().split()
    b=list(b)
    n=len(a)
    N=1
    for i in range(n):
      if(a[i]!=b[-(i+1)]):
        N=0
    if(N==1):
      print("YES")
    else:
      print("NO")
      

### FIXED CODE ###

a=input()
a=list(a)
b=input()
b=list(b)
n=len(a)
j=1
for i in range(n):
  if(a[i]!=b[-(i+1)]):
    j=0
if(j==1):
  print("YES")
else:
  print("NO")
N = int(input())
X = str(input())
X10 = int(X,2)

one_num = X.count("1")
answer = []
for i in range(N):
    target = int(X[i])
    if target == 0:
        plus = pow(2,N-i-1)
        ones = one_num + 1
    else:
        plus = -pow(2,N-i-1)
        ones = one_num-1
    Xnow = X10+plus
    count = 0
    if Xnow == 0:
        answer.append(count)
        continue
    else:
        Xnow = Xnow%ones
        count+=1
        while Xnow > 0:
            Xnow2 = bin(Xnow)
            ones = Xnow2.count("1")
            Xnow = Xnow%ones
            count+=1
        answer.append(count)
    print(*count,sep="\n")


### FIXED CODE ###

N = int(input())
x2 = input()
x10 = int(x2, 2)
popc =  x2.count("1")
#print("x10", x10)
#print("popc", popc)
#popc: Nを2進数で表したときの1の個数

#以下で1つフリップさせた時の入力に対する余りを事前に計算
if popc <= 1:
    xp = x10%(popc+1)
    xm = 0
else:
    xp = x10%(popc+1)
    xm = x10%(popc-1)
#print("xp", xp)
#print("xm", xm)

#以下でフリップさせた場所のみを計算
for i in range(N):
    if x2[i] == "1":
        if popc == 1:
            print(0)
            continue
        tmp = (xm - pow(2, N-i-1, popc-1))%(popc-1)
    else:
        tmp = (xp + pow(2, N-i-1, popc+1))%(popc+1)
        
    #print("tmp", tmp)
    ans = 1
    while tmp > 0:
        tmp %= bin(tmp).count("1")
        ans += 1
    print(ans)
# import numpy as np
def main():
  N,M =map(int, input().split())
  s,c=[],[]
  for i in range(M):
    si,ci = map(int, input().split())
    s.append(si)
    c.append(ci)
  
  res=[0]*N
  for si,ci in zip(s,c):
    if res[si-1]== 0:
      res[si-1]=str(ci)	
    elif res[si-1]!= str(ci):
      print(-1)
      exit()
#  print(res)
      
#  for i in range(N):
#    if res[i] =='':
#      res[i]=str(0)
  
  if res==['0']*N:
    print(-1)
    exit()
  su = int("".join(res))
  if su < 10**(N-1):
    print(-1)
    exit()
    
  print(int("".join(res)))
  
    
if __name__=="__main__":
  main()

### FIXED CODE ###

# import numpy as np
def main():
  N,M =map(int, input().split())
  s,c=[],[]
  for i in range(M):
    si,ci = map(int, input().split())
    s.append(si)
    c.append(ci)
  
  res=['']*N
  for si,ci in zip(s,c):
    if res[si-1]== '':
      res[si-1]=str(ci)	
    elif res[si-1]!= str(ci):
      print(-1)
      exit()

  
  if res[0]=='0':
    if N==1:
      print(0)
      exit()
    else:
      print(-1)
      exit()
  elif res[0]=='':
    res[0]=str(1)
   
  for i in range(N):
    if res[i]=='':
      res[i]=str(0)
  if M==0 and N==1:
    print(0)
    exit()
  print(int("".join(res)))
  
    
if __name__=="__main__":
  main()
p,q = map(int,input().split())
print(p * q / 2)

### FIXED CODE ###

p,q,r=map(int,input().split())
print(p*q//2)
import math
from math import radians
from cmath import sqrt
a,b,c = map(int, raw_input().split)
s = (a * b  *  math.sin(radians(c))) /2
c = sqrt(pow(a,2) + pow(b,2) - 2*a*b*math.cos(radians(c)))
print s
print a + b +c
print s*2 /a

### FIXED CODE ###

import math
a, b, C = map(int, raw_input().split())
S = (a * b * math.sin(math.radians(C))) / 2
c = math.sqrt(a*a + b*b - 2*a*b*math.cos(math.radians(C)))
print("%f" % (S))
print("%f" % ( a + b + c))
print("%f" % ((S * 2) / a))
cards =[]
symbol = ['S','H','C','D']

for sym in symbol:
  for i in range(1,14):
    cards.append(sym + '' + str(i))
    
n = int(input())
for j in range(n):
  cards.remove(input())

for card in cards:
  print(card)


### FIXED CODE ###

n = int(input())
card =[i+" "+str(j) for i in ["S","H","C","D"] for j in range(1,14)]
for i in range(n):
    card.remove(input())
for i in card:
    print(i)
n,k = map(int,input().split())
l, count = [], 0
for _ in range(k):
    input()
    l.append(list(map(int,input().split())))
for i in range(1,n):
    if i not in l[i-1]:
        count += 1
print(count)

### FIXED CODE ###

n, k = map(int, input().split())
s = set(range(1, n+1))
for _ in range(k):
    d = int(input())
    for i in input().split():
        s.discard(int(i))
print(len(s))
a,b=map(int, input().split())
print(a*b +' '+2*a*b)

### FIXED CODE ###

a,b=map(int, input().split())
print(a*b,2*a+2*b)
L=[26**i for i in range(12)]
#print(L)
gun=[sum(L[1:i])for i in range(2,12)]
#print(gun)
N=int(input())
i=0
while N > gun[i]:
  i += 1
#print(i)
if i != 0:
  N = N - gun[i-1] #これを26進法
N -= 1
#print(N)
L=[]
for k in range(1,i+2):
   L.append(N//(26**(i+1-k)))
   N = N % (26**(i+1-k))
#print(L)
L=[chr(i+97) for i in L]
#print(L)
print(''.join(L))

### FIXED CODE ###

L=[26**i for i in range(13)]
#print(L)
gun=[sum(L[1:i])for i in range(2,13)]
#print(gun)
N=int(input())
i=0
while N > gun[i]:
  i += 1
#print(i)
if i != 0:
  N = N - gun[i-1] #これを26進法
N -= 1
#print(N)
L=[]
for k in range(1,i+2):
   L.append(N//(26**(i+1-k)))
   N = N % (26**(i+1-k))
#print(L)
L=[chr(i+97) for i in L]
#print(L)
print(''.join(L))
N = int(input())
if(N >= 105):
  print(!)
else:
  print(0)

### FIXED CODE ###

N = int(input())
countans = 1
if(N < 105):
  print(0)
elif(N < 107):
    print(1)
else:
    for i in range(107, N+1, 2):
        count = 1
        for j in range(1, int(N/2)):
            if(i%j == 0):
                count += 1
        if(count == 8):
            countans += 1
    print(countans)
A,B = map(int,input().split())


if (B-A)%2=1:
  print("IMPOSSIBLE")
  
else:
  print((B-A)/2)

### FIXED CODE ###

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

if (B%2!=A%2):
  print("IMPOSSIBLE")
  
else:
  print((B+A)//2)
if __name__ == '__main__':
    N, M = map(int, input().split())
    A = sorted(map(int, input().split()), reverse=True)
    p = 0
    while 0 < M:
        if N == 1:
            p = 0
        elif N == 2:
            p = A.index(max(A[0], A[1]))
        else:
            p = A.index(max(A[p - 1], A[p], A[p + 1])) if p != 0 else A.index(max(A[p], A[p + 1], A[p + 2]))

        A[p] //= 2
        M -= 1

    ret = 0
    for a in A:
        ret += a
    print(ret)

### FIXED CODE ###

import heapq
if __name__ == '__main__':
    N, M = map(int, input().split())
    A = list(map(lambda x: int(x) * (-1), input().split()))
    heapq.heapify(A)
    for _ in range(M):
        tmp = heapq.heappop(A)
        heapq.heappush(A, -(-tmp // 2))
    print(-sum(A))
# -*- coding: utf-8 -*-
"""
Created on Sun Feb  3 21:07:35 2019

@author: Yamazaki Kenichi
"""

N,M = map(int,input().split())
X = list(map(int,input().split()))

X.sort()
A = []

for i in range(M-1):
    A.append(X[i+1]-X[i])
A.sort()

ans = X[M-1]-X[0]
if M !=1:
    for i in range(M-2,M-2-(N-1),-1):
        ans = ans - A[i] 
print(ans)

### FIXED CODE ###

    # -*- coding: utf-8 -*-
"""
Created on Sun Feb  3 21:07:35 2019

@author: Yamazaki Kenichi
"""

N,M = map(int,input().split())
X = list(map(int,input().split()))

if N >= M:
    ans = 0

else:
    X.sort()
    A = []
    for i in range(M-1):
        A.append(X[i+1]-X[i])
    A.sort()
    ans = X[M-1]-X[0]

    for i in range(M-2,M-2-(N-1),-1):
        ans = ans - A[i] 
print(ans)
n = int(input())
a = list(map(int, input().split()))
ans = [0]*n
def choose2(n):
    return n * (n - 1) // 2
total = 0
for i in range(1,n+1):
    total += choose2(a.count(i))
for i in range(n):
    ans[i] = total
    ans[i] -= a.count(a[i]) - 1
print(*ans[:], sep='\n')


### FIXED CODE ###

n, m = list(map(int, input().split()))
def factorial(x):
    f = 1
    for i in range(1, x+1):
        f *= i
    return f
ans = 0
if n < 2 and m < 2:
    ans = 0
    print(ans)
elif n < 2:
    ans = int(factorial(m) / (factorial(2) * factorial(m - 2)))
    print(ans)
elif m < 2:
    ans = int(factorial(n) / (factorial(2) * factorial(n - 2)))
    print(ans)
else:
    ans = int(factorial(m) / (factorial(2) * factorial(m - 2)) + factorial(n) / (factorial(2) * factorial(n - 2)))
    print(ans)
N = int(input())
T = int(input())
A = int(input())
H = list(map(int, input().split()))

ans_l = []

for i in range(N):
    mater = H[i]
    Temp = (T - (mater*0.006))
    ans = abs(A - Temp)
    ans_l.append(ans)


ans_mini = min(ans_l)

ans_posi =[]

for h in range(N):
    if ans_l[h] == ans_mini:
        ans2 = h+1
        ans_posi.append(ans2)


for j in ans_posi:
    print(j,end="")

### FIXED CODE ###

N = int(input())
T,A = map(int, input().split())
H = list(map(int, input().split()))


ans_l = []

for i in range(N):
    mater = H[i]
    Temp = (T - (mater*0.006))
    ans = abs(A - Temp)
    ans_l.append(ans)


ans_mini = min(ans_l)

ans_posi =[]

for h in range(N):
    if ans_l[h] == ans_mini:
        ans2 = h+1
        ans_posi.append(ans2)


for j in ans_posi:
    print(j,end="")