We’re preparing your current view and syncing the latest data.
You are given an integer n. Your task is to find the smallest integer x such that:
The sum of digits of a number is defined as the sum of all its decimal digits.
Return the smallest such x.
The input consists of a single integer n (1 ≤ n ≤ 10^9).
Output the smallest integer x satisfying the conditions.
1 ≤ n ≤ 10^9
Example 1
Input
123
Output
132
Explanation
The sum of digits of 123 is 6. Among numbers not less than 123 with digit sum 6, 132 is the smallest.