Little penguin Polo adores strings. But most of all he adores strings of length n.

One day he wanted to find a string that meets the following conditions:  The string consists of n lowercase English letters (that is, the string's length equals n), exactly k of these letters are distinct.  No two neighbouring letters of a string coincide; that is, if we represent a string as s = s_1s_2... s_{n}, then the following inequality holds, s_{i} ≠ s_{i} + 1(1 ≤ i < n).  Among all strings that meet points 1 and 2, the required string is lexicographically smallest. 

Help him find such string or state that such string doesn't exist.

String x = x_1x_2... x_{p} is lexicographically less than string y = y_1y_2... y_{q}, if either p < q and x_1 = y_1, x_2 = y_2, ... , x_{p} = y_{p}, or there is such number r (r < p, r < q), that x_1 = y_1, x_2 = y_2, ... , x_{r} = y_{r} and x_{r} + 1 < y_{r} + 1. The characters of the strings are compared by their ASCII codes.


-----Input-----

A single line contains two positive integers n and k (1 ≤ n ≤ 10^6, 1 ≤ k ≤ 26) — the string's length and the number of distinct letters.


-----Output-----

In a single line print the required string. If there isn't such string, print "-1" (without the quotes).


-----Examples-----
Input
7 4

Output
ababacd

Input
4 7

Output
-1

Difficulty: competition

Starter code:

Solutions:
import string

rd = lambda: list(map(int, input().split()))

n, k = rd()
if k>26 or k>n or k==1 and n>1:
  print(-1)
elif k==1 and n==1:
  print('a')
else:
  print(('ab'*(n+1>>1))[:n-k+2]+string.ascii_lowercase[2:k])

n, k = map(int, input().split())
if n < k or k > 26: print(-1)
elif k == 1: print('a' if n == 1 else -1)
else: print(('ab' * (n // 2 + 1))[: n - k + 2] + 'cdefghijklmnopqrstuvwxyz'[: k - 2])

import sys
import math
  
n, k = [int(x) for x in (sys.stdin.readline()).split()]

if(k == 1 and n == 1):
    print("a")
    return

if(k == 1 or k > n):
    print(-1)
    return

res = []
t = 2
for i in range(n):
    if(n - (k - 2) > i):
        if(i % 2 == 0):
            res.append('a')
        else:
            res.append('b')
    else:
        res.append(chr(t + 97))
        t += 1
        
print("".join(res))

import sys
import math
  
n, k = [int(x) for x in (sys.stdin.readline()).split()]

if(k == 1 and n == 1):
    print("a")
    return

if(k == 1 or k > n):
    print(-1)
    return

res = ['a', 'b'] * (int(n / 2))
if(n % 2 != 0):
    res.append('a')

t = 2
for i in range(n - (k - 2), n):
    res[i] = (chr(t + 97))
    t += 1   

"""t = 2
for i in range(n):
    if(n - (k - 2) > i):
        if(i % 2 == 0):
            res.append('a')
        else:
            res.append('b')
    else:
        res.append(chr(t + 97))
        t += 1"""
        
print("".join(res))

from string import ascii_lowercase
n, k = [int(x) for x in input().split()]
if n == 1 and k == 1:
	print('a')
	return
if n < k or k == 1:
	print(-1)
	return
print('ab' * ((n - k + 2) // 2) + ('a' if (n + k) % 2 == 1 else '') + ascii_lowercase[2: k])


def main():
    n, k = list(map(int, input().split()))
    if n < k or k == 1 < n:
        print(-1)
    elif (n - k) & 1:
        print('ab' * ((n - k + 1) // 2) + 'acdefghijklmnopqrstuvwxyz'[:k - 1])
    else:
        print('ab' * ((n - k) // 2) + 'abcdefghijklmnopqrstuvwxyz'[:k])


def __starting_point():
    main()

__starting_point()

import sys
(n,k)=map(int,sys.stdin.readline().split())
if (k==1 and n!=1) or k>n:
	print(-1)
elif n==1:
	print('a')
else:

	tmp=n-k+2
	s="ab"*(tmp//2)
	if tmp%2==1:
		s+="a"
	for i in range(2,k):
		s+=chr(ord('a')+i)
	print (s)

a=list(map(int,input().split()))
if(a[0]>1)&(a[1]==1):print(-1)
elif a[0]==a[1]==1:print('a')
elif a[1]>a[0]:print(-1)
else:print('ab'*((a[0]+2-a[1])//2)+'a'*((a[0]-a[1])%2)+''.join([chr(ord('c')+x) for x in range(a[1]-2)]))


# coding: utf-8
letter = [chr(ord('a')+i) for i in range(26)]
n, k = [int(i) for i in input().split()]
if k>n or (k==1 and n>1):
    print(-1)
    return
if k==1:
    print('a')
    return
ans = [letter[i%2] for i in range(n-k+2)]
ans += [letter[2+i] for i in range(k-2)]
print(''.join(ans))


n, k = map(int, input().split())
if k > n or (k == 1 and n > 1):
    print(-1)
    return
if n == 1:
    print('a')
else:
    d = n - k + 2
    ans = 'ab' * (d // 2) + 'a' * (d % 2)
    ind = 2
    for i in range(d, n):
        ans += chr(ord('a') + ind)
        ind +=1
    print(ans)

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

if (k == 1 and n != 1) or k > n:
    print(-1)

elif n == 1 :
    print('a')
else:
    s1 = []
    s2 = []
    for i in range(k-1,1,-1):
        c = chr(97 + i)
        s1.append(c)
        s2.append(c)
    for i in range(n-k+2):
        if i % 2 == 0 :
            s1.append('a')
            s2.append('b')
        else:
            s1.append('b')
            s2.append('a')

    s1 = s1[::-1]
    s2 = s2[::-1]

    s1 = ''.join(s1)
    s2 = ''.join(s2)

    print(min(s1,s2))


n,k=map(int,input().split())
if k>n or k==1 and n!=1:print(-1)
else:
    s=("ab"*(n//2+1))[:n]
    print(s[:-(k-2)]+''.join([chr(97+i) for i in range(2,k)]) if k>2 else s)

n,k = list(map(int,input().split()))
if k>n : print(-1); return
if k==1 and  n>1: print(-1); return
if k==1 and n==1: print('a'); return
s=''
f=1 
for i in range(n+2-k):
    s+='a' if f else 'b'
    f=1-f

c = ord('c')
for i in range(n+2-k,n):
    s+=chr(c)
    c+=1

print(s)

alphabet = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
string = input()
numbers = string.split()
a, b = int(numbers[0]), int(numbers[1])
condition = a > 1 and b == 1
if b > a or condition:
    print(-1)
else:
    if a == 1:
        s = "a"
    else:
        s = ""
        for x in range(a - b + 2):
            s += alphabet[x % 2]
        for x in range(2, b):
            s += alphabet[x]
    print(s)

alphabet = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
string = input()
numbers = string.split()
a, b = int(numbers[0]), int(numbers[1])
condition = a > 1 and b == 1
if b > a or condition:
    print(-1)
else:
    if a == 1:
        s = "a"
    else:
        n = a - b + 2
        s = "ab" * (n // 2)
        if n % 2 == 1:
            s += "a"
        for x in range(2, b):
            s += alphabet[x]
    print(s)

import string
import sys

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

if(k > n or k > 26):
    print(-1)
    return

if(k == 1 and n > 1):
    print(-1)
    return

if(k == 1 and n == 1):
    print('a')
    return

if(k % 2 == 0 and n % 2 == 1):
    rightnum = k - 2
    leftnum = n - rightnum
    leftnum //= 2
    left = 'ab' * leftnum
    left += 'a'
    right = string.ascii_lowercase[2: 2 + rightnum]
    print(left + right)
    return

if(k % 2 == 0 and n % 2 == 0):
    rightnum = k - 2
    leftnum = n - rightnum
    leftnum //= 2
    left = 'ab' * leftnum
    right = string.ascii_lowercase[2:2 + rightnum]
    print(left + right)
    return

if(k % 2 == 1 and n % 2 == 0):
    rightnum = k - 2
    leftnum = n - rightnum
    leftnum //= 2
    left = 'ab' * leftnum
    left += 'a'
    right = string.ascii_lowercase[2: 2 + rightnum]
    print(left + right)
    return
    
if(k % 2 == 1 and n % 2 == 1):
    rightnum = k - 2
    leftnum = n - rightnum
    leftnum //= 2
    left = 'ab' * leftnum
    right = string.ascii_lowercase[2:2 + rightnum]
    print(left + right)
    return


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

if n < k or k > 26: print(-1)

elif k == 1: print('a' if n == 1 else -1)

else: print(('ab' * (n // 2 + 1))[: n - k + 2] + 'cdefghijklmnopqrstuvwxyz'[: k - 2])

n,k=[int(x) for x in input().split()]
if n<k or (k==1 and n>=2):
    print(-1)
    return
if k==1:
    print('a')
    return
st=""
flag=1
for i in range(n-k+2):
    if flag:
        st+='a'
        flag=0
    else:
        st+='b'
        flag=1
num=ord('c')
for i in range(0,k-2):
    st+=chr(num+i)
print(st)
    


n,m=list(map(int,input().split()))
if m>n or m==1 and n>1 :
    print(-1)
    return
if m==1 :
    print('a')
    return
l=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
s=""
for i in range(2,m) :
    s+=l[i]

n-=(m-2)
l=""
l+="ab"*int(n/2)
if (n%2!=0) :
    l+="a"
print(l+s)


li=list(map(int,input().split()))
n=li[0]
k=li[1]
s=""

if k>n or (k<2 and n!=1) or k==0:
    print(-1)
else:
    if n-k==0:
        for i in range(97,97+k):
            s+=chr(i)
    else:
        for i in range(n-(k-2)):
            if i%2==0:
                s+=chr(97)
            else:
                s+=chr(98)
    if n!=k:
        for i in range(99,99+(k-2)):
            s+=chr(i)

print(s)

n,k=map(int,input().split())
if n<k:
    print(-1)
    return
if n==k:
    ans=[chr(i+97) for i in range(k)]
    print(''.join(ans))
    return
if k==1:
    print(-1)
    return
if k==2:
    ans="ab"*(n//2)+"ab"[:n%2]
    print(ans)
    return
rem=k-2
ans="ab"*(n//2)+"ab"[:n%2]
ans=list(ans)
c=99
for i in range(n-rem,n):
    ans[i]=chr(c)
    c+=1 
print(''.join(ans))

n, k = [int(x) for x in input().split()]

if k > n or k == 1 and n > 1:
    print(-1)
elif k == 1 and n == 1:
    print('a')
else:
    first_char = 97
    letters = [chr(x) for x in range(first_char, first_char+k)]

    word = ('ab' * (n+1 // 1))[:n-k+2]
    word += ''.join(letters[2:k])

    print(word)