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 sys import stdout
from bisect import bisect_left as binl
from copy import copy, deepcopy
from collections import defaultdict
import math


mod = 1


def intin():
    input_tuple = input().split()
    if len(input_tuple) <= 1:
        return int(input_tuple[0])
    return tuple(map(int, input_tuple))


def intina():
    return [int(i) for i in input().split()]


def intinl(count):
    return [intin() for _ in range(count)]


def modadd(x, y):
    global mod
    return (x + y) % mod


def modmlt(x, y):
    global mod
    return (x * y) % mod


def mod_inv(x):
    # available only when mod is prime
    global mod
    return pow(x, mod - 2, mod)


def gcm(x, y):
    while y != 0:
        z = x % y
        x = y
        y = z
    return x


def combination(x, y):
    assert(x >= y)

    ret = math.factorial(x)
    ret = ret // (math.factorial(x - y) * math.factorial(y))

    return ret


def get_divisors(x):
    retlist = []
    for i in range(1, int(x**0.5) + 3):
        if x % i == 0:
            retlist.append(i)
            retlist.append(x // i)
    return retlist


def get_factors(x):
    retlist = []
    for i in range(2, int(x**0.5) + 3):
        while x % i == 0:
            retlist.append(i)
            x = x // i
    retlist.append(x)
    return retlist


def make_linklist(xylist):
    linklist = {}
    for a, b in xylist:
        linklist.setdefault(a, [])
        linklist.setdefault(b, [])
        linklist[a].append(b)
        linklist[b].append(a)
    return linklist


def calc_longest_distance(linklist, v=1):
    distance_list = {}
    distance_count = 0
    distance = 0
    vlist_previous = []
    vlist = [v]
    nodecount = len(linklist)

    while distance_count < nodecount:
        vlist_next = []
        for v in vlist:
            distance_list[v] = distance
            distance_count += 1
            vlist_next.extend(linklist[v])
        distance += 1
        vlist_to_del = vlist_previous
        vlist_previous = vlist
        vlist = list(set(vlist_next) - set(vlist_to_del))

    max_distance = -1
    max_v = None
    for v, distance in distance_list.items():
        if distance > max_distance:
            max_distance = distance
            max_v = v

    return (max_distance, max_v)


def calc_tree_diameter(linklist, v=1):
    _, u = calc_longest_distance(linklist, v)
    distance, _ = calc_longest_distance(linklist, u)
    return distance


class UnionFind:

    def __init__(self, n):
        self.parent = [i for i in range(n)]

    def root(self, i):
        if self.parent[i] == i:
            return i
        self.parent[i] = self.root(self.parent[i])
        return self.parent[i]

    def unite(self, i, j):
        rooti = self.root(i)
        rootj = self.root(j)
        if rooti == rootj:
            return
        if rooti < rootj:
            self.parent[rootj] = rooti
        else:
            self.parent[rooti] = rootj

    def same(self, i, j):
        return self.root(i) == self.root(j)


###############################################################################


def find_edge(plus, nt, minus):
    ret = []
    if plus is not None and nt is not None and plus <= nt:
        ret.append(nt - plus)
    if minus is not None and nt is not None and minus >= nt:
        ret.append(minus - nt)
    if plus is not None and minus is not None and plus <= minus:
        ret.append((minus - plus) / 2)
    return ret


def calc_coord(t, plus, nt, minus, ismax=False):
    check = []
    if plus is not None:
        check.append(plus + t)
    if nt is not None:
        check.append(nt)
    if minus is not None:
        check.append(minus - t)
    if ismax:
        return max(check)
    return min(check)


def main():
    n = intin()
    xydlist = []
    for _ in range(n):
        line = input()
        line = line.split()
        x = int(line[0])
        y = int(line[1])
        d = line[2]
        xydlist.append((x, y, d))

    xplusmax = None
    xminusmax = None
    xntmax = None

    xplusmin = None
    xminusmin = None
    xntmin = None

    yplusmax = None
    yminusmax = None
    yntmax = None

    yplusmin = None
    yminusmin = None
    yntmin = None

    for x, y, d in xydlist:
        if d == 'R':
            xplusmax = x if xplusmax is None else max(xplusmax, x)
            yntmax = y if yntmax is None else max(yntmax, y)
            xplusmin = x if xplusmin is None else min(xplusmin, x)
            yntmin = y if yntmin is None else min(yntmin, y)
        if d == 'L':
            xminusmax = x if xminusmax is None else max(xminusmax, x)
            yntmax = y if yntmax is None else max(yntmax, y)
            xminusmin = x if xminusmin is None else min(xminusmin, x)
            yntmin = y if yntmin is None else min(yntmin, y)
        if d == 'U':
            xntmax = x if xntmax is None else max(xntmax, x)
            yplusmax = y if yplusmax is None else max(yplusmax, y)
            xntmin = x if xntmin is None else min(xntmin, x)
            yplusmin = y if yplusmin is None else min(yplusmin, y)
        if d == 'D':
            xntmax = x if xntmax is None else max(xntmax, x)
            yminusmax = y if yminusmax is None else max(yminusmax, y)
            xntmin = x if xntmin is None else min(xntmin, x)
            yminusmin = y if yminusmin is None else min(yminusmin, y)

    tlist = [0]
    tlist.extend(find_edge(xplusmax, xntmax, xminusmax))
    tlist.extend(find_edge(xplusmin, xntmin, xminusmin))
    tlist.extend(find_edge(yplusmax, yntmax, yminusmax))
    tlist.extend(find_edge(yplusmin, yntmin, yminusmin))

    tlist = list(set(tlist))
    ans = float('inf')

    for t in tlist:
        x_max = calc_coord(t, xplusmax, xntmax, xminusmax, ismax=True)
        x_min = calc_coord(t, xplusmin, xntmin, xminusmin, ismax=False)
        y_max = calc_coord(t, yplusmax, yntmax, yminusmax, ismax=True)
        y_min = calc_coord(t, yplusmin, yntmin, yminusmin, ismax=False)
        ans = min(ans, (x_max - x_min) * (y_max - y_min))

    if ans == float('inf'):
        print(0)
    else:
        print(ans)


if __name__ == '__main__':
    main()