---
# System prepended metadata

title: 13342 - Domo to omoD

---

# 13342 - Domo to omoD

## Brief
Given a prefix expression, please convert it to the postfix expression.

## Input
The first line contains a prefix expression, in which each element is separated with a blank.

It's guaranteed that the number of elements will not exceed 500.

## Output
Print the corresponding postfix expression from the given prefix expression, and separate each element with a blank.

You don't need to print a newline character in this problem.

## Solution
```c=
//by 莊景堯

#include <stdio.h>

int first = 1;

void prefix()
{
    char ch;
    scanf(" %c", &ch);
    
    if (ch >= '0' && ch <= '9')
    {
        if (first)
        {
            printf("%c", ch);
            first = 0;
        }
        else
            printf(" %c", ch);
    }
    else
    {
        prefix();
        prefix();
        
        if (first)
        {
            printf("%c", ch);
            first = 0;
        }
        else
            printf(" %c", ch);
    }
}

int main()
{
    prefix();
}
```