ABC

Interview

Time limit1sMemory limit128 MB

Summary
Sort three distinct numbers into A, B, C and print them in an order given by a 3-letter permutation string.
Level

Easy1 of 10

Topics
Sorting, Implementation
Solved
No attempts yet

Problem

Three distinct natural numbers are named A, B, and C after sorting them so that A < B < C. The input gives these three values in arbitrary order.

Print the values of A, B, and C in the order requested by the three-letter string on the second line.

Input

The first line contains three natural numbers, each at most 100, separated by spaces. The numbers are distinct; after sorting them in increasing order, they are A, B, and C.

The second line contains a string of length 3 made from the letters A, B, and C.

Output

Print the values corresponding to the letters in the string, separated by single spaces, on one line.

Examples2

  1. Example 1

    Input
    1 5 3
    ABC
    
    Expected output
    1 3 5
    
  2. Example 2

    Input
    6 4 2
    CAB
    
    Expected output
    6 2 4