Bob had a string of length
, consisting only of lowercase letters
a
and b
.
He discovered that the string satisfied constraints. Each constraint is a pair of integers
and
, which means that in the substring
(
-based indexing), the number of
a
characters is equal to the number of b
characters.
Unfortunately, Bob lost the string. Your task is to reconstruct a string of length that consists only of characters
a
and b
and satisfies all constraints. If there are multiple solutions, you need to output the lexicographically smallest one. It is guaranteed that the solution exists.
Input Specification
The first line contains two integers and
(
,
), the length of the string and the number of constraints.
Each of the following lines contains two integers
and
(
), representing a constraint as described above. It is guaranteed that
is even.
Output Specification
Output a string of length , consisting of
a
and b
, that satisfies all the given constraints and is lexicographically smallest.
Constraints
Subtask | Points | Additional constraints |
---|---|---|
No additional constraints |
Sample Input
6 2
1 4
3 6
Sample Output
aabbaa
Explanation for Sample
aabbaa
is the lexicographically smallest string which satisfies the given two constraints.
Comments