The polar bears are going fishing. They plan to sail from (s_{x}, s_{y}) to (e_{x}, e_{y}). However, the boat can only sail by wind. At each second, the wind blows in one of these directions: east, south, west or north. Assume the boat is currently at (x, y).  If the wind blows to the east, the boat will move to (x + 1, y).  If the wind blows to the south, the boat will move to (x, y - 1).  If the wind blows to the west, the boat will move to (x - 1, y).  If the wind blows to the north, the boat will move to (x, y + 1). 

Alternatively, they can hold the boat by the anchor. In this case, the boat stays at (x, y). Given the wind direction for t seconds, what is the earliest time they sail to (e_{x}, e_{y})?


-----Input-----

The first line contains five integers t, s_{x}, s_{y}, e_{x}, e_{y} (1 ≤ t ≤ 10^5,  - 10^9 ≤ s_{x}, s_{y}, e_{x}, e_{y} ≤ 10^9). The starting location and the ending location will be different.

The second line contains t characters, the i-th character is the wind blowing direction at the i-th second. It will be one of the four possibilities: "E" (east), "S" (south), "W" (west) and "N" (north).


-----Output-----

If they can reach (e_{x}, e_{y}) within t seconds, print the earliest time they can achieve it. Otherwise, print "-1" (without quotes).


-----Examples-----
Input
5 0 0 1 1
SESNW

Output
4

Input
10 5 3 3 6
NENSWESNEE

Output
-1



-----Note-----

In the first sample, they can stay at seconds 1, 3, and move at seconds 2, 4.

In the second sample, they cannot sail to the destination.

Difficulty: interview

Starter code:

Solutions:
t, sx, sy, ex, ey = map(int, input().split())
d = {'W':max(0, sx - ex), 'E':max(0, ex - sx), 'N':max(0, ey - sy), 'S':max(0, sy - ey)}
for (i, c) in enumerate(input(), 1):
  if d[c] > 0:
    d[c] -= 1
  if any(d.values()) == False:
    print(i)
    break
else:
  print(-1)

i = 0
t, sx, sy, ex, ey = list(map(int, input().split()))
second_string = input()
while i < t:
    if second_string[i] == 'E':
        if sx < ex: sx += 1
    elif second_string[i] == 'W':
        if sx > ex: sx -= 1
    elif second_string[i] == 'N':
        if sy < ey: sy += 1
    else:
        if sy > ey: sy -= 1
    i += 1
    if (sy == ey) and (sx == ex):
        print(i)
        break
    if i == t:
        print(-1)


i=0
t, sx, sy, ex, ey = list(map(int, input().split()))
second_string = input()
while (sy != ey) or (sx != ex):
    if i == t: break
    if second_string[i] == 'E':
        if sx < ex: sx += 1
    elif second_string[i] == 'W':
        if sx > ex: sx -= 1
    elif second_string[i] == 'N':
        if sy < ey: sy += 1
    elif second_string[i] == 'S':
        if sy > ey: sy -= 1
    i += 1
if (sy == ey and sx == ex) is False: print(-1)
else: print(i)




def main():
    ind = {'E': (1, 0), 'S': (0, -1), 'W': (-1, 0), 'N': (0, 1), '#': (0, 0)}

    t, sx, sy, tx, ty = list(map(int, input().split()))
    s = str(input())


    if sx == tx and sy == ty:
        print('0')
        return

    for i in range(0, t):
        if sx != tx and abs(sx+ind[s[i]][0]-tx) < abs(sx-tx): sx += ind[s[i]][0]
        if sy != ty and abs(sy+ind[s[i]][1]-ty) < abs(sy-ty): sy += ind[s[i]][1]
        if sx == tx and sy == ty:
            print(i+1)
            return
        
    print('-1')


def __starting_point():
    main()

__starting_point()

t, x, y, u, v = map(int, input().split())

dx = u - x
dy = v - y

p = input()
e, s, w, n = p.count('E'), p.count('S'), p.count('W'), p.count('N')

if - w > dx or e < dx or - s > dy or n < dy: print(-1)
else:
    for i in range(len(p)):
        if p[i] == 'E':
            if dx > 0: dx -= 1
        elif p[i] == 'S':
            if dy < 0: dy += 1
        elif p[i] == 'W':
            if dx < 0: dx += 1
        else:
            if dy > 0: dy -= 1
        if dx == 0 and dy == 0:
            print(i + 1)
            break

t,sx,sy,ex,ey=tuple(map(int,input().split()))
dx,dy=ex-sx,ey-sy
op={'W':0,'E':0,'S':0,'N':0}
if dx<0:
    op['W']=-dx
if dx>0:
     op['E']=dx
if dy<0:
    op['S']=-dy
if dy>0:
    op['N']=dy
if (dx,dy)==(0,0):
    print(0)
    return
now=0
for wind in input():
    if op[wind]>0:
        op[wind]-=1
    now+=1
    if sum(op.values())==0:
        print(now)
        break
else:
    print(-1)

t, sx, sy, ex, ey = map(int, input().split())
dx, dy = 'E' if ex - sx >= 0 else 'W', 'N' if ey - sy > 0 else 'S'
mx, my = abs(ex - sx), abs(ey - sy)
for i, ch in enumerate(input()):
    if ch == dx and mx > 0:
        mx -= 1
    elif ch == dy and my > 0:
        my -= 1
    if mx == 0 and my == 0:
        print(i + 1)
        return
print(-1)

d = {'E': (1, 0), 'S': (0, -1), 'W': (-1, 0), 'N': (0, 1)}
t, sx, sy, ex, ey = [int(x) for x in input().split()]
s = input()
for i in range(t):
	c = s[i]
	dx, dy = d[c]
	if abs(sx + dx - ex) <= abs(sx - ex) and abs(sy + dy - ey) <= abs(sy - ey):
		sx += dx
		sy += dy
	if sx == ex and sy == ey:
		print(i + 1)
		return
print(-1)


t, sx, sy, ex, ey = [int(x) for x in input().split(' ')]
i = input()

x = ex - sx
y = ey - sy
k = 0
for j in i:
   if y > 0:
      if j == 'N':
         y -= 1
   elif y < 0:
      if j == 'S':
         y += 1

   if x > 0:
      if j == 'E':
         x -= 1
   elif x < 0:
      if j == 'W':
         x += 1

   k += 1
   if x == 0 and y == 0: break

print(k if x == 0 and y == 0 else -1)

N,sx,sy,dx,dy = tuple(int(i) for i in input().split())
A = input()
answered = False
for i in range(len(A)):
	if(A[i]=="N" and sy<dy):
		sy+=1
	elif(A[i]=="S" and sy>dy):
		sy-=1
	elif(A[i]=="E" and sx<dx):
		sx+=1
	elif(A[i]=="W" and sx>dx):
		sx-=1
	
	if(sx==dx and sy==dy):
		print(i+1)
		answered = True
		break

if(not answered):
	print("-1")

from functools import reduce
from operator import *
from math import *
from sys import *
from string import *
from collections import *
setrecursionlimit(10**7)
dX= [-1, 1, 0, 0,-1, 1,-1, 1]
dY= [ 0, 0,-1, 1, 1,-1,-1, 1]
RI=lambda: list(map(int,input().split()))
RS=lambda: input().rstrip().split()
#################################################
t,sx,sy,ex,ey=RI()
needed={c:0 for c in 'NSEW'}
if sx<ex:
    needed['E']=ex-sx
else:
    needed['W']=sx-ex
if sy<ey:
    needed['N']=ey-sy
else:
    needed['S']=sy-ey
cnt={c:0 for c in 'NSEW'}
s=RS()[0]
for i in range(t):
    flag=1
    if needed[s[i]]:
        cnt[s[i]]+=1
    for c in cnt:
        if cnt[c]<needed[c]:
            flag=0
    if flag:
        print(i+1)
        return
print(-1)







def main():
    t, x, y, ex, ey = list(map(int, input().split()))
    x -= ex
    y -= ey
    for i, c in enumerate(input()):
        if x == 0 == y:
            print(i)
            return
        if c == 'E':
            if x < 0:
                x += 1
        elif c == 'W':
            if x > 0:
                x -= 1
        elif c == 'N':
            if y < 0:
                y += 1
        elif c == 'S':
            if y > 0:
                y -= 1
    print(t if x == 0 == y else -1)


def __starting_point():
    main()

__starting_point()

from sys import stdin,stdout
# stdin = open("/Users/seeva92/Workspace/Contests/1.txt","r")
# stdout = open("/Users/seeva92/Workspace/Contests/2.txt","w")
t,sx,sy,ex,ey = map(int,stdin.readline().split())
def main():
	nonlocal t,sx,sy,ex,ey
	s = stdin.readline()
	if sx == ex and sy == ey: 
		stdout.write("0")
		return
	c = 0
	for i in s:
		c+=1
		if i == 'S' and abs(ey - (sy-1)) < abs(ey - sy):						
			sy-=1
		elif i=='N' and abs(ey - (sy+1)) < abs(ey - sy):			
			sy+=1
		elif i=='E' and abs(ex - (sx+1)) < abs(ex - sx):			
			sx+=1
		elif i=='W' and abs(ex - (sx-1)) < abs(ex - sx):			
			sx-=1
		# print(sx,sy)
		if c>t: break;	
		if sx == ex and sy==ey: break
	if c<=t and sx==ex and sy==ey:
		stdout.write(str(c))
	else: stdout.write("-1")
main()

l1 = [int(i) for i in input().split()]
s = [l1[1], l1[2]]
e = [l1[3], l1[4]]
wind = [c for c in input()]

beloved = ['W', 'N']

def sub(num1, num2):
    return num1 - num2

def add(num1, num2):
    return num1 + num2
op = [sub, add]
    
if s[0] < e[0]:
    beloved[0] = 'E'
    op[0] = add
if s[1] > e[1]:
    beloved[1] = 'S'
    op[1] = sub



time = 0
for w in wind:
    if s[0] == e[0] and s[1] == e[1]:
        print(time)
        return

    time += 1

    for i in (0, 1):
        if s[i] == e[i]:
            continue

        if w == beloved[i]:
            s[i] = op[i](s[i], 1)
    
if s[0] == e[0] and s[1] == e[1]:
        print(time)
        return
print(-1)

import math,sys
a = list(map(int,input().split()))
b = list(input())
if a[1] == a[3] and a[2] == a[4]:
    print(0)
    return
flag = False
c = 0
for i in range(len(b)):
    c +=1
    if b[i] == 'S':
        if math.fabs(a[4]-(a[2]-1)) > math.fabs(a[4]-(a[2])):
            continue
        a[2] -= 1
    if b[i] == 'E':
        if math.fabs(a[3]-(a[1]+1)) > math.fabs(a[3]-(a[1])):
            continue
        a[1] += 1
    if b[i] == 'W':
        if math.fabs(a[3]-(a[1]-1)) > math.fabs(a[3]-(a[1])):
            continue
        a[1] -= 1
    if b[i] == 'N':
        if math.fabs(a[4]-(a[2]+1)) > math.fabs(a[4]-(a[2])):
            continue
        a[2] += 1
    if a[1] == a[3] and a[2] == a[4]:
        flag = True
        break


if flag :
    print(c)
else:
    print(-1)



# python2 or 3
import sys, threading, os.path
import collections, heapq, math,bisect
import string
from platform import python_version
sys.setrecursionlimit(10**6)
threading.stack_size(2**27)


def main():
    if os.path.exists('input.txt'):
        input = open('input.txt', 'r')
    else:
        input = sys.stdin
    #--------------------------------INPUT---------------------------------
    t, x1,x2,y1,y2 = list(map(int, input.readline().split()))
    T = t
    dirs = list(str(input.readline().rstrip('\n')))
    for i in range(len(dirs)):
        if t==0 or (x1 == y1 and x2==y2):
            break
        if dirs[i] == 'E':
            if y1>x1:
                x1+=1
            t-=1
        elif dirs[i] == 'S':
            if x2>y2:
                x2-=1
            t-=1
        elif dirs[i] == 'W':
            if y1<x1:
                x1-=1
            t-=1
        elif dirs[i] == 'N':
            if x2<y2:
                x2+=1
            t-=1
    if x1 == y1 and x2==y2:
        output = T-t
    else:
        output= -1
    #-------------------------------OUTPUT----------------------------------
    if os.path.exists('output.txt'):
        open('output.txt', 'w').writelines(str(output))
    else:
        sys.stdout.write(str(output))


def __starting_point():
    main()
#threading.Thread(target=main).start()


__starting_point()

t,sx,sy,ex,ey=map(int,input().split())
w=input()
n=len(w)
w+=" "
ans=-1
i=0
dx=ex-sx
dy=ey-sy
if abs(dx)+abs(dy)>t:
    pass
else:
    while i<=t and i<n:
        if dx==0 and dy==0:
            ans=i
            break
        if dx>=0 and dy>=0:
            if ((w[i]!="E" and w[i]!="N") or (dx==0 and w[i]=="E") or (dy==0 and w[i]=="N")) and i<n:
                i+=1
            if dx>0 and w[i]=="E" and i<n:
                i+=1
                dx-=1
            if dy>0 and w[i]=="N"and i<n:
                i+=1
                dy-=1
        elif dx>=0 and dy<=0:
            if ((w[i]!="E" and w[i]!="S") or (dx==0 and w[i]=="E") or (dy==0 and w[i]=="S")) and i<n:
                i+=1
            if dx>0 and w[i]=="E" and i<n:
                i+=1
                dx-=1
            if dy<0 and w[i]=="S" and i<n:
                i+=1
                dy+=1
        elif dx<=0 and dy>=0:
            if ((w[i]!="W" and w[i]!="N") or (dx==0 and w[i]=="W") or (dy==0 and w[i]=="N")) and i<n:
                i+=1
            if dx<0 and w[i]=="W" and i<n:
                i+=1
                dx+=1
            if dy>0 and w[i]=="N" and i<n:
                i+=1
                dy-=1
        elif dx<=0 and dy<=0:
            if ((w[i]!="W" and w[i]!="S") or (dx==0 and w[i]=="W") or (dy==0 and w[i]=="S")) and i<n:
                i+=1
            if dx<0 and w[i]=="W" and i<n:
                i+=1
                dx+=1
            if dy<0 and w[i]=="S" and i<n:
                i+=1
                dy+=1
if dx==0 and dy==0:
            ans=i
print(ans)  

t, sx, sy, ex, ey = map(int, input().split())
d = {'W':max(0, sx - ex), 'E':max(0, ex - sx), 'N':max(0, ey - sy), 'S':max(0, sy - ey)}
for (i, c) in enumerate(input(), 1):
  if d[c] > 0:
    d[c] -= 1
  if any(d.values()) == False:
    print(i)
    break
else:
  print(-1)

t,x,y,u,v = map(int,input().split())
dic = {}
dic['N'],dic['S'] = (v-y,0) if v>=y else (0,y-v)
dic['E'],dic['W'] = (u-x,0) if u>=x else (0,x-u)
inp = str(input())
for i in range(t):
    dic[inp[i]]-=1
    if dic['N']<1 and dic['S'] < 1 and dic['E'] < 1 and dic['W'] < 1:
        print (i+1)
        break
else:
    print (-1)

import sys

t, sx, sy, ex, ey = list(map(int,input().split()))

inp = input()
movu, movd, movf, movb,dontx, donty = 0, 0, 0, 0, 0, 0

if sx < ex:
    movf = True  
else:
    movb = True 

if ex == sx : dontx = True 

if sy < ey:
    movu = True  
else:
    movd = True 

if ey == sy : donty = True

t = 0  
for c in inp:
    t = t + 1 
    if c == 'S':
        if donty:
            continue 
        if movd:
            sy -= 1 
            if sy == ey: donty = True
    elif c == 'E':
        if dontx: continue 
        if movf:
            sx += 1
            if sx == ex: dontx = True 
    elif c == 'N':
        if donty : continue 
        if movu:
            sy += 1
            if sy == ey: donty = True
    elif c == 'W':
        if dontx: continue 
        if movb:
            sx -= 1
            if sx == ex: dontx = True 

    if sx == ex and sy == ey:
        print(t)
        return

print("-1")



def main():
    (t, sx, sy, ex, ey) = list(map(int, input().split(' ')))
    if sx == ex and sy == ey:
        return 0
    t = 0
    for c in list(input()):
        if sx == ex and sy == ey:
            return t
        if c == 'S':
            if ey < sy:
                sy -= 1
        elif c == 'N':
            if ey > sy:
                sy += 1
        elif c == 'E':
            if ex > sx:
                sx += 1
        elif c == 'W':
            if ex < sx:
                sx -= 1
        t += 1
    if sx == ex and sy == ey:
        return t
    return -1

print(main())


# cook your code here
n,sx,sy,ex,ey = map(int,input().split(' '))

reqx = ex - sx
reqy = ey - sy

# // print reqx

str = input()

for i in range(n):
     if reqx<0:
          if str[i] == 'W':
               reqx+=1
               
     if reqy<0:
          if str[i] == 'S':
               reqy+=1
               
     if reqx>0:
          if str[i] == 'E':
               reqx-=1
     if reqy>0:
          if str[i] == 'N':
               reqy-=1
     if reqx==reqy and reqx == 0:
          print(i+1)
          return
print(-1)

def main():
    t,sx,sy,ex,ey = list(map(int, input().split()))
    nlt = input()
    lst = list(nlt)
    cnt = 0
    fl = False
    for i in range(len(lst)):
        if lst[i] == 'N' and sy < ey:
            sy += 1
        elif lst[i] == 'S' and sy > ey:
            sy -= 1
        elif lst[i] == 'E' and sx < ex:
            sx += 1
        elif lst[i] == 'W' and sx > ex:
            sx -= 1
        cnt += 1
        if sx == ex and sy == ey:
            fl = True
            break
    if fl:
        print(cnt)
    else:
        print(-1)

def __starting_point():
    main()

__starting_point()

# http://codeforces.com/problemset/problem/298/B

d = {'E':(1,0), 'S':(0,-1), 'W':(-1,0), 'N':(0,1)}

t,sx,sy,ex,ey = list(map(int, input().split()))
s = input()

for i in range(t):
    dx,dy = d[s[i]]

    if abs(sx-ex+dx)<=abs(sx-ex) and abs(sy-ey+dy)<=abs(sy-ey):
        sx+=dx
        sy+=dy
    if sx==ex and sy==ey:
        print(i+1)
        return
print(-1)


#!/usr/bin/env python3
#! -*- coding: utf-8 -*-


def main():
	t, sx, sy, ex, ey = list(map(int, input().split()))
	path = input()
	dx, dy = ex - sx, ey - sy
	if not dx and not dy:
		print(0)
		return
	for i, move in enumerate(path):
		#print(dx, dy)
		if dx < 0 and move == 'W':
			dx += 1
		elif dx > 0 and move == 'E':
			dx -= 1
		elif dy < 0 and move == 'S':
			dy += 1
		elif dy > 0 and move == 'N':
			dy -= 1
		if not dx and not dy:
			print(i + 1)
			break
	else:
		print("-1")


def __starting_point():
	main()

__starting_point()