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:
N = int(input())

x_list = [0]*N
y_list = [0]*N
d_list = ["A"]*N

for i in range(N):
    x, y, d = input().split()
    x_list[i] = int(x)
    y_list[i] = int(y)
    d_list[i] = d


def _calc_tv(v_keep, v_down, v_up):

    v_0 = min([v_keep, v_down, v_up])

    if v_down == v_0:
        t_1 = 0
        t_2 = 0
        v_c = v_down
    elif v_keep == v_0:
        t_1 = 0
        t_2 = v_down - v_keep
        v_c = v_keep
    else:
        t1 = v_keep - v_up
        t2 = (v_down - v_up) / 2
        if t1 == min([t1, t2]):
            t_1 = t1
            t_2 = v_down - v_keep
            v_c = v_keep
        else:
            t_1 = (v_down - v_up) / 2
            t_2 = t_1
            v_c = (v_down + v_up) / 2

    return t_1, t_2, v_0, v_c


def calc_tv(v_keep, v_down, v_up, reverse=False):

    if reverse:
        t_1, t_2, v_0, v_c = _calc_tv(-v_keep, -v_up, -v_down)
        return t_1, t_2, -v_0, -v_c

    else:
        return _calc_tv(v_keep, v_down, v_up)


# x_min, x_max
x_sub = [x_list[i] for i in range(N) if d_list[i] in ["D", "U"]]
if len(x_sub) > 0:
    x_min_du = min(x_sub)
    x_max_du = max(x_sub)
else:
    x_min_du = 10**10
    x_max_du = -10**10
x_sub = [x_list[i] for i in range(N) if d_list[i] == "L"]
if len(x_sub) > 0:
    x_min_l = min(x_sub)
    x_max_l = max(x_sub)
else:
    x_min_l = 10**10
    x_max_l = -10**10
x_sub = [x_list[i] for i in range(N) if d_list[i] == "R"]
if len(x_sub) > 0:
    x_min_r = min(x_sub)
    x_max_r = max(x_sub)
else:
    x_min_r = 10**10
    x_max_r = -10**10

t_x_min_1, t_x_min_2, v_x_min_0, v_x_min_1 = calc_tv(x_min_du, x_min_l, x_min_r, reverse=False)
t_x_max_1, t_x_max_2, v_x_max_0, v_x_max_1 = calc_tv(x_max_du, x_max_l, x_max_r, reverse=True)

# y_min, y_max
y_sub = [y_list[i] for i in range(N) if d_list[i] in ["L", "R"]]
if len(y_sub) > 0:
    y_min_lr = min(y_sub)
    y_max_lr = max(y_sub)
else:
    y_min_lr = 10**10
    y_max_lr = -10**10
y_sub = [y_list[i] for i in range(N) if d_list[i] == "D"]
if len(y_sub) > 0:
    y_min_d = min(y_sub)
    y_max_d = max(y_sub)
else:
    y_min_d = 10**10
    y_max_d = -10**10
y_sub = [y_list[i] for i in range(N) if d_list[i] == "U"]
if len(y_sub) > 0:
    y_min_u = min(y_sub)
    y_max_u = max(y_sub)
else:
    y_min_u = 10**10
    y_max_u = -10**10

t_y_min_1, t_y_min_2, v_y_min_0, v_y_min_1 = calc_tv(y_min_lr, y_min_d, y_min_u, reverse=False)
t_y_max_1, t_y_max_2, v_y_max_0, v_y_max_1 = calc_tv(y_max_lr, y_max_d, y_max_u, reverse=True)


def calc_v(t, v_type="x_min"):

    type_ind = ["x_min", "x_max", "y_min", "y_max"].index(v_type)

    t_1 = [t_x_min_1, t_x_max_1, t_y_min_1, t_y_max_1][type_ind]
    t_2 = [t_x_min_2, t_x_max_2, t_y_min_2, t_y_max_2][type_ind]
    v_0 = [v_x_min_0, v_x_max_0, v_y_min_0, v_y_max_0][type_ind]
    v_1 = [v_x_min_1, v_x_max_1, v_y_min_1, v_y_max_1][type_ind]
    c = [1, -1, 1, -1][type_ind]

    if t < t_1:
        return v_0 + c * t
    elif t < t_2:
        return v_1
    else:
        return v_1 - c * (t - t_2)


def calc_s(t):
    return (calc_v(t, "x_max") - calc_v(t, "x_min")) * (calc_v(t, "y_max") - calc_v(t, "y_min"))


t_list = [0]
t_list = t_list + [t_x_min_1, t_x_min_2]
t_list = t_list + [t_x_max_1, t_x_max_2]
t_list = t_list + [t_y_min_1, t_y_min_2]
t_list = t_list + [t_y_max_1, t_y_max_2]
# print(t_list)
res = min([calc_s(t) for t in t_list])
print(res)