logo AlgoBeat OnlineJudge
登录 注册

#216409. [SYSUCPC 2025] SYSU III

内存限制:256 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

As you all know, you are participating in the SYSUCPC (SYSU Constructive Problem Contest) finals. Undoubtedly, the Constructive Kingdom of Sun Yat-sen University is eager for you to tackle some related problems.

Given a string containing only lowercase letters, determine the maximum number of disjoint subsequences of length that can be formed, such that all subsequences are . Formally, a subsequence of a string is a subset of characters of that read from left to right.

A greedy algorithm is currently used: each time, starting from the end, an unused is considered, and it is matched with nearest unused sequentially to form a qualified subsequence, which is then removed.

You are now requested to provide a string such that the answer obtained by the greedy method is , while the correct answer is . If no such exists, output .

输入格式

The only line contains two integers .

输出格式

A string such that the answer obtained by the greedy method is , while the correct answer is . If no such exists, output . The length of must not exceed .

样例

样例输入 1

1 1

样例输出 1

ilovesysu

样例输入 2

2 1

样例输出 2

-1