int main() {
string t;
while (cin >> t) {
int i = 0, len = t.size(), cnt = 1, sign = 1;
for (int i = 0; i < len; i++)
if (t[i] != '#')
t[i] = 'a';//只区分叶子和非叶子
while (i < len) {
if (i == 0)cnt = 1;
string t1 = t.substr(i, cnt), t2 = t1;
reverse(t1.beg...