from itertools import pairwise N = int(input()) A = list(map(int, input().split())) S = input() cs = [] for a, b in pairwise(A + A): if a < b: cs.append('<') else: cs.append('>') t = ''.join(cs) p = t.find(S) print(p)