import sys; input = sys.stdin.readline N = int(input()); R = [] for i in map(int, input().split()): lo, hi = 0, len(R) while lo