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