Problem B
Neumann
There are many ways to define the natural numbers. One of
the more famous ones is John von Neumann’s definition. In his
definition we first define $0$ as the empty set $\varnothing $. Next we define the
successor of a number $x$
as $x \cup \{ x\} $. The
axiom of infinity then guarantees the existence of a set that
contains $0$ and all its
successors. But the finer details of this logic isn’t what this
problem is about. The only thing we ask of here is to print
some natural numbers. Most programming languages do this by
printing out the numbers in base $10$. But we’re going to do things
properly here and print according to this definition.
Note that the elements of a set are not internally ordered, but since all sets in this problem correspond to numbers the elements of a set should be printed in increasing order. For example $\{ \} $ should be printed before $\{ \{ \} \} $ since the first set corresponds to $0$ and the other one corresponds to $1$.
Input
The input contains a single line with a single natural number $0 \leq n \leq 20$.
Output
Print out $n$ as a set using Neumann’s definition as described above.
Sample Input 1 | Sample Output 1 |
---|---|
0 |
{} |
Sample Input 2 | Sample Output 2 |
---|---|
1 |
{{}} |
Sample Input 3 | Sample Output 3 |
---|---|
2 |
{{},{{}}} |