Print All Permutations Of A String Iteratively

easy
1. You are given a string. 
2. You have to print all permutations of the given string iteratively.

Input Format

A String

Output Format

All permutations of the given string(one in a line).

Constraints

1 <= length of string <= 15

Example

Input
abc
Output
abc
bac
cab
acb
bca
cba
Previous
Remove Primes

Related Questions