Magic Pass Code

3.3

16 votes
Easy
Problem

Problem Description

Apparently, the key that would take Alice home from her Wonderland adventure is a magic pass code hidden in numbers.

Help her find it! It's the one with the highest sum of its digits!

Input Format

Input consists of several integer n, each separated by a newline character.

Output Format

Output Alice's magic code -- the integer with the maximum sum of its digits!

Constraints

0<n100000

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?