N = int(input()) V = list(map(int, input().split())) result = V[0] def get_best_combination(v, v_list): print(v, v_list) for i in range(len(v_list)): tmp_result = get_best_combination(v+v_list[i],v_list[i+2:]) global result if tmp_result > result: result = tmp_result return v get_best_combination(0,V) print(result)