n | lines = [] | n | text = [] |
| while True: | | while True: |
n | input_line = input().strip() | n | line = input().strip() |
| if not input_line: | | if not line: |
| break | | break |
n | lines.append(input_line) | n | text.append(line) |
| largest_number = None | | max_number = None |
| for input_line in lines: | | for line in text: |
| tokens = input_line.split() | | words = line.split() |
| for token in tokens: | | for word in words: |
| if token.startswith('+'): | | if word.startswith('+'): |
| continue | | continue |
| try: | | try: |
n | num = int(token) | n | number = int(word) |
| if largest_number is None or num > largest_number: | | if max_number is None or number > max_number: |
| largest_number = num | | max_number = number |
| except ValueError: | | except ValueError: |
| continue | | continue |
t | print(largest_number if largest_number is not None else 0) | t | print(max_number if max_number is not None else 0) |