Gahee and the Sub-station Name
Time limit1sMemory limit512 MB
Given one line with a station name and an optional sub-station name in parentheses, print the station name and the sub-station name, or '-' if there is none.
- Level
Easy1 of 10
- Topics
- String
- Solved
- No attempts yet
Problem
Some subway stations have a sub-station name in parentheses after the station name. For example, Soongsil Univ Entrance Station has the sub-station name Salpijae. Given the station information, print the station name and the sub-station name.
Input
The first line contains the station information in one of the two formats below.
- {
station_name} - {
station_name} {open_character}{sub_station_name}{close_character}
station_name is the station name, and sub_station_name is the sub-station name.
In the second format, open_character is '(' and close_character is ')'.
Output
Print the station name on the first line and the sub-station name on the second line. If there is no sub-station name, print '-' instead.
Constraints
station_name and sub_station_name satisfy the following.
- They contain only English letters (upper and lower case), the dash '
-', digits, and space characters. - Space characters do not appear consecutively, and the string neither starts nor ends with a space character.
- The length is at least and at most .