#C2694. Circle of Friends Permutations

    ID: 46038 Type: Default 1000ms 256MiB

Circle of Friends Permutations

Circle of Friends Permutations

You are given a fixed list of three friends: Alice, Bob, and Charlie. Your task is to generate all possible arrangements (permutations) of these three friends in a circular order. The output must exactly contain the following six lines:

  • Alice, Bob, Charlie
  • Alice, Charlie, Bob
  • Bob, Alice, Charlie
  • Bob, Charlie, Alice
  • Charlie, Alice, Bob
  • Charlie, Bob, Alice

No additional text or formatting should be output. Although the program does not require any effective input, your solution must read from stdin (even if the input is not used) and write the result to stdout. The expected order of outputs is as shown above.

For reference, the mathematical number of permutations is given by \(3! = 6\).

inputFormat

The program reads a single line from standard input. The input is not used in the computation and can be any non-empty string.

outputFormat

Output exactly 6 lines to standard output. Each line must contain one permutation in the following exact format: Name1, Name2, Name3. The order of the output lines must be:

  1. Alice, Bob, Charlie
  2. Alice, Charlie, Bob
  3. Bob, Alice, Charlie
  4. Bob, Charlie, Alice
  5. Charlie, Alice, Bob
  6. Charlie, Bob, Alice
## sample
start
Alice, Bob, Charlie

Alice, Charlie, Bob Bob, Alice, Charlie Bob, Charlie, Alice Charlie, Alice, Bob Charlie, Bob, Alice

</p>