Олимпиадный тренинг

Задача 34809. Maximum number - 2


Задача

Темы: Цикл for
Given a natural number n and integers a1, a2, ..., an. Find the number of the maximum number that is not a multiple of 3. If there are several numbers with a maximum value that is not a multiple of 3, then the number of the last of them must be found (it is guaranteed that there is at least one number that is not a multiple of 3).

Input: in the first line enter the number N - the number of numbers in the sequence (0<N<100), and then N integers.
Output: print the answer to the problem

Examples
# Input Output
1 7
4
9
6
-3
-4
9
-2
1