Text from the official booklet. Refer to the PDF for original mathematical notation, formatting, and linked input files. Printed samples and inputs are reproduced as published.
Scenario: A STEM awareness campaign wants to generate unique hashtags based on the initials of notable women in STEM. A campaign focuses on Marie Curie (Physics & Chemistry), Ada Lovelace (Computer Science), and Rosalind Franklin (Biology). They use their initials (mar) to generate unique permutations for hashtag variations: ● mar, mra, amr, arm, rma, ram Problem Statement: Given a string S (1 ≤ |S| ≤ 8), consisting of lowercase letters, representing the initials of STEM pioneers, print all unique permutations in lexicographical (alphabetical) order, one per line. Sample Input: mar Sample Output: amr arm mar mra ram rma Your Input: ada