#include <algorithm>
#include <iostream>
int main() {
char array[] = "zabgqkzg";
std::sort(array, array+sizeof(array));
for (int i = 0; i < sizeof(array); i++) {
std::cout << array[i] << "\n";
}
}
I2luY2x1ZGUgPGFsZ29yaXRobT4KI2luY2x1ZGUgPGlvc3RyZWFtPgogCmludCBtYWluKCkgewogICAgCiAgICBjaGFyIGFycmF5W10gPSAiemFiZ3FremciOwogICAgCiAgICBzdGQ6OnNvcnQoYXJyYXksIGFycmF5K3NpemVvZihhcnJheSkpOwogICAgCiAgICBmb3IgKGludCBpID0gMDsgaSA8IHNpemVvZihhcnJheSk7IGkrKykgewogICAgICAgIHN0ZDo6Y291dCA8PCBhcnJheVtpXSA8PCAiXG4iOwogICAgfQp9