Time Limit: 2 sec / Memory Limit: 1024 MB
配点 : 100 点
問題文
英小文字と .
のみからなる文字列 S が与えられます。
S を .
で分割したときの末尾の文字列を出力してください。
すなわち、.
を含まない S の接尾辞のうち最長のものを出力してください。
制約
- S は英小文字と
.
からなる、長さ 2 以上 100 以下の文字列 - S には
.
が 1 つ以上含まれる - S の末尾は
.
ではない
入力
入力は以下の形式で標準入力から与えられる。
S
出力
答えを出力せよ。
入力例 1
atcoder.jp
出力例 1
jp
atcoder.jp
の、 .
を含まない最長の接尾辞は jp
です。
入力例 2
translate.google.com
出力例 2
com
S に .
が複数含まれることもあります。
入力例 3
.z
出力例 3
z
S が .
から始まることもあります。
入力例 4
..........txt
出力例 4
txt
S 中で .
が連続することもあります。
Score: 100 points
Problem Statement
You are given a string S consisting of lowercase English letters and the character .
.
Print the last substring when S is split by .
s.
In other words, print the longest suffix of S that does not contain .
.
Constraints
- S is a string of length between 2 and 100, inclusive, consisting of lowercase English letters and
.
. - S contains at least one
.
. - S does not end with
.
.
Input
The input is given from Standard Input in the following format:
S
Output
Print the answer.
Sample Input 1
atcoder.jp
Sample Output 1
jp
The longest suffix of atcoder.jp
that does not contain .
is jp
.
Sample Input 2
translate.google.com
Sample Output 2
com
S may contain multiple .
s.
Sample Input 3
.z
Sample Output 3
z
S may start with .
.
Sample Input 4
..........txt
Sample Output 4
txt
S may contain consecutive .
s.