/
実行時間制限: 2 sec / メモリ制限: 1024 MiB
問題文
英大文字と英小文字からなる文字列 S が与えられます。
ここで、S には英大文字と英小文字がそれぞれ少なくとも 1 つ以上ずつ含まれることが保証されます。
S から英大文字のみを順番を保って抜き出した文字列と、S から英小文字のみを順番を保って抜き出した文字列をそれぞれ出力してください。
制約
- S は英大文字と英小文字からなる長さ 2 以上 100 以下の文字列
- S は英大文字と英小文字をそれぞれ 1 つ以上ずつ含む。
入力
入力は以下の形式で標準入力から与えられる。
S
出力
2 行出力せよ。
1 行目には S から英大文字のみを順番を保って抜き出した文字列を、
2 行目には S から英小文字のみを順番を保って抜き出した文字列を出力せよ。
入力例 1
aFGdbcE
出力例 1
FGE adbc
S= aFGdbcE から英大文字のみを順番を保って抜き出した文字列は FGE、英小文字のみを順番を保って抜き出した文字列は adbc です。
よって、1 行目には FGE を、2 行目には adbc を出力します。
入力例 2
zZyZz
出力例 2
ZZ zyz
Problem Statement
You are given a string S consisting of uppercase and lowercase English letters.
Here, S is guaranteed to have at least one uppercase and one lowercase letter.
Print the string obtained by extracting the uppercase characters in S, and the string obtained by extracting the lowercase characters in S, preserving the order.
Constraints
- S is a string of length between 2 and 100, inclusive, consisting of uppercase and lowercase English letters.
- S contains at least one uppercase character, and at least one lowercase character.
Input
The input is given from Standard Input in the following format:
S
Output
Print two lines.
The first line should contain the string obtained by extracting the uppercase letters in S preserving the order.
The second line should contain the string obtained by extracting the lowercase letters in S preserving the order.
Sample Input 1
aFGdbcE
Sample Output 1
FGE adbc
The uppercase letters extracted from S= aFGdbcE form the string FGE when joined in order, and the lowercase letters form adbc.
Thus, the first line should contain FGE, and the second should contain adbc.
Sample Input 2
zZyZz
Sample Output 2
ZZ zyz