Largest and Smallest Digits


Submit solution

Points: 100
Time limit: 1.0s
Memory limit: 256M

Author:
Problem types
Allowed languages
Python

Given a non-negative integer \(n\), find the largest and smallest digits occurring in its decimal representation.

Input

One line containing \(n\).

The input satisfies:

  • \(0 \le n \le 10^18\)

Output

Print the largest digit followed by the smallest digit, separated by one space.

Example

Input
12030
Output
3 0

Comments

There are no comments at the moment.