Type: Default 1000ms 256MiB

Debug

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

问题陈述

给你一个由大写英文字母组成的字符串 SS

SS 执行以下程序,然后输出结果字符串:

只要字符串中包含 WA 作为(连续的)子串,就重复以下操作:

在字符串中所有出现的 WA 中,用 AC 替换最左边的一个。

在这个问题的限制条件下,可以证明这个操作最多重复有限次。

输入格式

一个字符串 SS

输出格式

一行一个字符串表示答案

样例1

input

WWWWW

output

WWWWW

样例2

input

WACWA

output

ACCAC

限制与约定

S|S|代表字符串SS的长度。

对于 20%20\% 的数据,S|S| \le 100100

对于 60%60\% 的数据,S|S| \le 10510^5

对于 100%100\% 的数据,S|S| \le 10610^6

  • 时间限制: 1s1 s
  • 空间限制: 512MB512 MB