In this problem,
given any natural number *x* with *n* dígits *x*_{1} … *x*_{n},
we say that *y* = *y*_{1} … *y*_{n} is the result of fattening *x*
if, for every *i* between 1 and *n*,
*y*_{i} = max{*x*_{1}, …, *x*_{i}}.
For instance, if we fatten 7 we get 7,
if we fatten 32064781 we get 33366788,
and if we fatten 9000000 we get 9999999.

Write a function

to return the result of fattening *x*.
Yau may implement and use auxiliar procedures.

**Precondition**

It holds 0 < *x* < 10^{9}.

**Observation**
You only need to submit the required procedure;
your main program will be ignored.

Public test cases

**Input/Output**

fatten(7) → 7

fatten(32064781) → 33366788

fatten(9000000) → 9999999

fatten(32064781) → 33366788

fatten(9000000) → 9999999

Information

- Author
- Jordi Cortadella
- Language
- English
- Translator
- Salvador Roura
- Original language
- Catalan
- Other languages
- Catalan
- Official solutions
- C++
- User solutions
- C++