CF558E A Simple Task
Description
This task is very simple. Given a string $ S $ of length $ n $ and $ q $ queries each query is on the format $ i $ $ j $ $ k $ which means sort the substring consisting of the characters from $ i $ to $ j $ in non-decreasing order if $ k=1 $ or in non-increasing order if $ k=0 $ .
Output the final string after applying the queries.
Input Format
N/A
Output Format
N/A
Explanation/Hint
First sample test explanation:




