B - Cyclic Editorial /

Time Limit: 2 sec / Memory Limit: 1024 MiB

配点 : 100

問題文

各桁が 1 以上 9 以下の整数である 3 桁の整数 N が与えられます。

N100 の位を a10 の位を b1 の位を c としたとき、b,c,a をこの順に並べた整数と c,a,b をこの順に並べた整数をそれぞれ出力してください。

制約

  • N は各桁が 1 以上 9 以下の整数である 3 桁の整数

入力

入力は以下の形式で標準入力から与えられる。

N

出力

b,c,a をこの順に並べた整数と c,a,b をこの順に並べた整数をこの順で空白区切りで出力せよ。


入力例 1

379

出力例 1

793 937

379100 の位は 310 の位は 71 の位は 9 です。よって、793937 をそれぞれ出力します。


入力例 2

919

出力例 2

199 991

919100 の位は 910 の位は 11 の位は 9 です。よって、199991 をそれぞれ出力します。

Score : 100 points

Problem Statement

You are given a three-digit integer N where each digit is an integer between 1 and 9, inclusive.

Let a, b, c be the hundreds, tens, ones digits of N, respectively. Print an integer formed by arranging b, c, a in this order, and an integer formed by arranging c, a, b in this order.

Constraints

  • N is a three-digit integer where each digit is an integer between 1 and 9, inclusive.

Input

The input is given from Standard Input in the following format:

N

Output

Print two integers separated by a space in the following order: an integer formed by arranging b, c, a in this order, and an integer formed by arranging c, a, b in this order.


Sample Input 1

379

Sample Output 1

793 937

The hundreds, tens, ones digits of 379 are 3, 7, 9, respectively, so print 793 and 937.


Sample Input 2

919

Sample Output 2

199 991

The hundreds, tens, ones digits of 919 are 9, 1, 9, respectively, so print 199 and 991.