Problem: There are N points in a two-dimensional plane. The initial coordinates of the i-th point are (x_i, y_i). Now, each point starts moving at a speed of 1 per second, in a direction parallel to the x- or y- axis. You are given a character d_i that represents the specific direction in which the i-th point moves, as follows:

* If d_i = `R`, the i-th point moves in the positive x direction;
* If d_i = `L`, the i-th point moves in the negative x direction;
* If d_i = `U`, the i-th point moves in the positive y direction;
* If d_i = `D`, the i-th point moves in the negative y direction.



You can stop all the points at some moment of your choice after they start moving (including the moment they start moving). Then, let x_{max} and x_{min} be the maximum and minimum among the x-coordinates of the N points, respectively. Similarly, let y_{max} and y_{min} be the maximum and minimum among the y-coordinates of the N points, respectively.

Find the minimum possible value of (x_{max} - x_{min}) \times (y_{max} - y_{min}) and print it.

Constraints

* 1 \leq N \leq 10^5
* -10^8 \leq x_i,\ y_i \leq 10^8
* x_i and y_i are integers.
* d_i is `R`, `L`, `U`, or `D`.

Input

Input is given from Standard Input in the following format:


N
x_1 y_1 d_1
x_2 y_2 d_2
.
.
.
x_N y_N d_N


Output

Print the minimum possible value of (x_{max} - x_{min}) \times (y_{max} - y_{min}).

The output will be considered correct when its absolute or relative error from the judge's output is at most 10^{-9}.

Examples

Input

2
0 3 D
3 0 L


Output

0


Input

5
-7 -10 U
7 -6 U
-8 7 D
-3 3 D
0 -6 R


Output

97.5


Input

20
6 -10 R
-4 -9 U
9 6 D
-3 -2 R
0 7 D
4 5 D
10 -10 U
-1 -8 U
10 -6 D
8 -5 U
6 4 D
0 3 D
7 9 R
9 -4 R
3 10 D
1 9 U
1 -6 U
9 -8 R
6 7 D
7 -3 D


Output

273

Solution (in PYTHON3):

Solution:
import sys,heapq
from collections import deque,defaultdict
printn = lambda x: sys.stdout.write(x)
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
DBG = True  and False
def ddprint(x):
  if DBG:
    print(x)

BIG = 10**18
n = inn()
rx = []
udx = []
lx = []
uy =[]
rly = []
dy = []
for i in range(n):
    x,y,d = input().split()
    x = int(x)
    y = int(y)
    if d=='R':
        rx.append(x)
        rly.append(y)
    elif d=='L':
        lx.append(x)
        rly.append(y)
    elif d=='U':
        udx.append(x)
        uy.append(y)
    elif d=='D':
        udx.append(x)
        dy.append(y)

nor = (len(rx)==0)
nol = (len(lx)==0)
nou = (len(uy)==0)
nod = (len(dy)==0)
noud = nou and nod
norl = nor and nol

if not nor:
    rx.sort()
    rmax  = rx[-1]
    rmin  = rx[0]
if not nol:
    lx.sort()
    lmax  = lx[-1]
    lmin  = lx[0]
if not nou:
    uy.sort()
    umax  = uy[-1]
    umin  = uy[0]
if not nod:
    dy.sort()
    dmax  = dy[-1]
    dmin  = dy[0]
if not noud:
    udx.sort()
    udmax  = udx[-1]
    udmin  = udx[0]
if not norl:
    rly.sort()
    rlmax  = rly[-1]
    rlmin  = rly[0]

ddprint(rx)
ddprint(udx)
ddprint(lx)
#ddprint("max: r {} l {} u {} d {}".format(rmax,lmax,umax,dmax))
#ddprint("min: r {} l {} u {} d {}".format(rmin,lmin,umin,dmin))

def foo(t):
    ddprint("foo t: {}".format(t))
    xmax = -BIG
    if not nor:
        xmax = max(xmax, rmax+t)
    if not noud:
        xmax = max(xmax, udmax)
    if not nol:
        xmax = max(xmax, lmax-t)
    xmin = BIG
    if not nor:
        xmin = min(xmin, rmin+t)
    if not noud:
        xmin = min(xmin, udmin)
    if not nol:
        xmin = min(xmin, lmin-t)

    ymax = -BIG
    if not nou:
        ymax = max(ymax, umax+t)
    if not norl:
        ymax = max(ymax, rlmax)
    if not nod:
        ymax = max(ymax, dmax-t)
    ymin = BIG
    if not nou:
        ymin = min(ymin, umin+t)
    if not norl:
        ymin = min(ymin, rlmin)
    if not nod:
        ymin = min(ymin, dmin-t)

    z = abs((xmax-xmin)*(ymax-ymin))
    ddprint("xmax {} xmin {} ymax {} ymin {} rtn {}".format(xmax,xmin,ymax,ymin,z))
    return z

ts = [0]
if not noud:
    if not nor:
        ts.append(max(0,udmax-rmax))
        ts.append(max(0,udmin-rmin))
    if not nol:
        ts.append(max(0,lmax-udmax))
        ts.append(max(0,lmin-udmin))
if not nol and not nor:
        ts.append(max(0,(lmax-rmax)/2))
        ts.append(max(0,(lmin-rmin)/2))
if not norl:
    if not nou:
        ts.append(max(0,rlmax-umax))
        ts.append(max(0,rlmin-umin))
    if not nod:
        ts.append(max(0,dmax-rlmax))
        ts.append(max(0,dmin-rlmin))
if not nod and not nou:
        ts.append(max(0,(dmax-umax)/2))
        ts.append(max(0,(dmin-umin)/2))

ts = list(set(ts))
mn = BIG
for t in ts:
    mn = min(mn, foo(t))
print(mn)