← 返回 goldmansachs 的题目列表Remove All Occurrences of AWS
类型:online_judge
Given a string consisting of uppercase English letters, remove all occurrences of 'AWS' until none remain. After each removal, concatenate the prefix and suffix strings. Return the final string. If the final string is empty, return '-1' as a string.
Input Format
A string s of length 1 ≤ |s| ≤ 10^5
The string contains only uppercase English letters.
Output Format
Return the processed string or '-1'.
Example
Input: AWAWSSG
Output: G
Input: AWSSG
Output: G
Example
Input
AWAWSSG