2020-09-20 07:21:18 +00:00
|
|
|
// https://www.luogu.com.cn/record/38654562
|
|
|
|
|
2021-11-19 09:01:13 +00:00
|
|
|
#include <bits/stdc++.h>
|
2020-09-20 07:21:18 +00:00
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
int a, b, c;
|
|
|
|
string s;
|
|
|
|
|
|
|
|
a = b = c = 0;
|
|
|
|
cin >> s;
|
|
|
|
|
2021-11-19 09:01:13 +00:00
|
|
|
for (int i = 0; i < s.size(); i += 5) {
|
|
|
|
cout << s[i] << ' ' << s[i + 3] << ' ';
|
|
|
|
switch (s[i]) {
|
2020-09-20 07:21:18 +00:00
|
|
|
case 'a':
|
2021-11-19 09:01:13 +00:00
|
|
|
if ('0' <= s[i + 3] && s[i + 3] <= '9') {
|
|
|
|
a = s[i + 3] - '0';
|
2020-09-20 07:21:18 +00:00
|
|
|
} else {
|
2021-11-19 09:01:13 +00:00
|
|
|
switch (s[i + 3]) {
|
2020-09-20 07:21:18 +00:00
|
|
|
case 'a':
|
|
|
|
a = a;
|
|
|
|
break;
|
|
|
|
case 'b':
|
|
|
|
a = b;
|
|
|
|
break;
|
|
|
|
case 'c':
|
|
|
|
a = c;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 'b':
|
2021-11-19 09:01:13 +00:00
|
|
|
if ('0' <= s[i + 3] && s[i + 3] <= '9') {
|
|
|
|
b = s[i + 3] - '0';
|
2020-09-20 07:21:18 +00:00
|
|
|
} else {
|
2021-11-19 09:01:13 +00:00
|
|
|
switch (s[i + 3]) {
|
2020-09-20 07:21:18 +00:00
|
|
|
case 'a':
|
|
|
|
b = a;
|
|
|
|
break;
|
|
|
|
case 'b':
|
|
|
|
b = b;
|
|
|
|
break;
|
|
|
|
case 'c':
|
|
|
|
b = c;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 'c':
|
2021-11-19 09:01:13 +00:00
|
|
|
if ('0' <= s[i + 3] && s[i + 3] <= '9') {
|
|
|
|
c = s[i + 3] - '0';
|
2020-09-20 07:21:18 +00:00
|
|
|
} else {
|
2021-11-19 09:01:13 +00:00
|
|
|
switch (s[i + 3]) {
|
2020-09-20 07:21:18 +00:00
|
|
|
case 'a':
|
|
|
|
c = a;
|
|
|
|
break;
|
|
|
|
case 'b':
|
|
|
|
c = b;
|
|
|
|
break;
|
|
|
|
case 'c':
|
|
|
|
c = c;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
printf("%d %d %d\n", a, b, c);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|