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:
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN

def want(n):

    xmax = float("-inf")
    xmin = float("inf")
    ymax = float("-inf")
    ymin = float("inf")

    if L:
        xmax = max(xmax,L_R - n)
        xmin = min(xmin,L_L - n)
        ymax = max(ymax,LR_U)
        ymin = min(ymin,LR_D)

    if R:
        xmax = max(xmax,R_R + n)
        xmin = min(xmin,R_L + n)
        ymax = max(ymax,LR_U)
        ymin = min(ymin,LR_D)

    if D:
        xmax = max(xmax,UD_R)
        xmin = min(xmin,UD_L)
        ymax = max(ymax,D_U - n)
        ymin = min(ymin,D_D - n)

    if U:
        xmax = max(xmax,UD_R)
        xmin = min(xmin,UD_L)
        ymax = max(ymax,U_U + n)
        ymin = min(ymin,U_D + n)

    #print (xmax-xmin,ymax-ymin)
    return abs(xmax - xmin) * abs(ymax - ymin)

def my_round(val, digit=0):
    p = 10 ** digit
    return (val * p * 2 + 1) // 2 / p


N = int(input())

UD_L = float("inf")
UD_R = float("-inf")
L_L = float("inf")
L_R = float("-inf")
R_L = float("inf")
R_R = float("-inf")

LR_D = float("inf")
LR_U = float("-inf")
D_D = float("inf")
D_U = float("-inf")
U_D = float("inf")
U_U = float("-inf")

U = False
D = False
L = False
R = False

for i in range(N):

    x,y,d = input().split()

    x = int(x)
    y = int(y)

    if d == "L" or d == "R":
        LR_D = min(LR_D,y)
        LR_U = max(LR_U,y)

        if d == "L":

            L_L = min(L_L,x)
            L_R = max(L_R,x)
            L = True

        else: #R

            R_L = min(R_L,x)
            R_R = max(R_R,x)
            R = True

    if d == "D" or d == "U":

        UD_L = min(UD_L,x)
        UD_R = max(UD_R,x)

        if d == "D":

            D_D = min(D_D,y)
            D_U = max(D_U,y)
            D = True

        else: #U

            U_D = min(U_D,y)
            U_U = max(U_U,y)
            U = True

t0 = 0
t3 = 2 * 10 ** 8
last = float("inf")
ans = 1000000000000000000000

while abs(last - ans) > 10 ** (-100):

    t1 = Decimal((t0 * 2 + t3 * 1)) / Decimal(3)
    t2 = Decimal((t0 * 1 + t3 * 2)) / Decimal(3)

    #print (t1,t2,want(t1),want(t2))

    last = ans
    
    if want(t1) <= want(t2):
        ans = want(t1)
        t3 = t2

    else:
        ans = want(t2)
        t0 = t1

    #print (last,ans,t1,t2)

if ans <= 10 ** (-9):
    ans = 0
print ('{:.20g}'.format(ans))