Question
Parade Banner Votes

In a city parade, there is a long banner with n empty positions.

There are q groups participating in the parade. Each group supports one lowercase English letter from a to z.

For each group, you are given l, r, and c. This means the group gives one vote to letter c for every position from l to r.

After all votes are counted, each position of the banner will show the letter with the maximum number of votes at that position.

If more than one letter has the same maximum number of votes, choose the lexicographically smallest letter.

Your task is to print the final banner.

Input

The first line contains two integers KaTeX can only parse string typed expression and KaTeX can only parse string typed expression — the length of the banner and the number of groups.

Each of the next KaTeX can only parse string typed expression lines contains two integers KaTeX can only parse string typed expression, KaTeX can only parse string typed expression, and one lowercase English letter KaTeX can only parse string typed expression.

Output

Print a single string of length KaTeX can only parse string typed expression — the final banner after all votes are counted.

Example
Example 1:
Input
6 5

1 3 b
2 5 a
4 6 c
3 6 c
1 6 b
Output
bbbccc
Explanation

At positions KaTeX can only parse string typed expression, KaTeX can only parse string typed expression, and KaTeX can only parse string typed expression, letter KaTeX can only parse string typed expression gets the highest votes. At positions KaTeX can only parse string typed expression, KaTeX can only parse string typed expression, and KaTeX can only parse string typed expression, letter KaTeX can only parse string typed expression gets the highest votes. So the final banner is KaTeX can only parse string typed expression.

Online