N = int(input()) A = list(map(int, input().split())) S = input().split() assert all(s == "min" for s in S)