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