Problem J: CCC19J4 Flipper

Problem J: CCC19J4 Flipper

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 114  Solved: 40
[Submit] [Status] [Web Board] [Creator:]

Description

English:
You are trying to pass the time while at the optometrist. You notice there is a grid of four numbers: 

1 2 

3 4 
You see lots of mirrors and lenses at the optometrist, and wonder how flipping the grid horizontally or vertically would change the grid. 
Specifically, a “horizontal” flip (across the horizontal centre line) would take the original grid of four numbers and result in: 

3 4

 1 2 
A “vertical” flip (across the vertical centre line) would take the original grid of four numbers and result in: 

2 1

 4 3 
Your task is to determine the final orientation of the numbers in the grid after a sequence of horizontal and vertical flips. 


Chinese:

你想在验光师那里消磨时间。你注意到这里有一个由四个数字组成的网格:

1 2

3 4

你在验光师那里看到很多镜子和透镜,你会想知道水平或垂直翻转网格会如何改变网格。

具体来说,一个“水平”翻转(越过水平中心线)将使用最初的4个数字网格,结果是:

3 4

1 2

一个“垂直”翻转(越过垂直中心线)会得到最初的四个数字网格,结果是:

2 1

4 3

您的任务是确定在一系列水平和垂直翻转之后网格中数字的最终方向。



Input

The input consists of one line, composed of a sequence of at least one and at most 1 000 000 characters. Each character is either H, representing a horizontal flip, or V, representing a vertical flip. For 8 of the 15 available marks, there will be at most 1 000 characters in the input.  


输入由一行组成,由至少一个且最多1000000个字符的序列组成。 每个字符都是代表水平翻转的H或代表垂直翻转的V。 对于15个可用标记中的8个,输入中最多包含1000个字符。

Output

Output the final orientation of the four numbers. Specifically, each of the two lines of output will contain two integers, separated by one space. 


输出四个数字的最终方向。 具体来说,两行输出中的每行将包含两个整数,以一个空格分隔。

Sample Input Copy

VVHH

Sample Output Copy

1 2
3 4