#include <bits/stdc++.h>
using namespace std;
using large = long long;
constexpr int N_max = 100'000;
struct Point {
    int x, y;
};

struct Seg {
    double x0;
    double k;
    double t0;
    double t1;
};

int main() {
    int n;
    cin >> n;

    auto l = vector<Point>();
    auto r = vector<Point>();
    auto u = vector<Point>();
    auto d = vector<Point>();
    for (int i = 0; i < n; i++) {
        Point p;
        char dir;
        cin >> p.x >> p.y >> dir;
        (dir == 'L' ? l : dir == 'R' ? r : dir == 'U' ? u : d).push_back(p);
    }

    auto width = 0LL;
    auto hegiht = 0LL;

    sort(l.begin(), l.end(), [](auto a, auto b) { return a.x < b.x; });
    sort(r.begin(), r.end(), [](auto a, auto b) { return a.x < b.x; });
    sort(u.begin(), u.end(), [](auto a, auto b) { return a.x < b.x; });
    sort(d.begin(), d.end(), [](auto a, auto b) { return a.x < b.x; });

    auto ud_x = vector<int>();
    if (!u.empty() && !d.empty()) {
        ud_x.push_back(min(u.front().x, d.front().x));
        ud_x.push_back(max(u.back().x, d.back().x));
    } else if (!u.empty()) {
        ud_x.push_back(u.front().x);
        ud_x.push_back(u.back().x);
    } else if (!d.empty()) {
        ud_x.push_back(d.front().x);
        ud_x.push_back(d.back().x);
    }

    auto x_max_t = vector<double>(4);
    auto x_max_x = vector<double>(3);
    {
        auto lmax = -1e10;
        auto udmax = -1e22;
        auto rmax = -1e35;
        if (!l.empty())
            lmax = l.back().x;
        if (!ud_x.empty())
            udmax = ud_x.back();
        if (!r.empty())
            rmax = r.back().x;

        auto tr = (lmax - rmax) * 0.5;
        auto tud = (lmax - udmax) * 1.0;

        x_max_t[0] = 0;
        x_max_t[1] = max(0.0, min(1e10, (tr <= tud ? tr : tud)));
        x_max_t[2] = max(0.0, min(1e10, (tr <= tud ? tr : tr + (tr - tud))));
        x_max_t[3] = 1e10;

        x_max_x[0] = lmax;
        x_max_x[1] = udmax;
        x_max_x[2] = rmax;
    }
    auto x_min_t = vector<double>(4);
    auto x_min_x = vector<double>(3);
    {
        auto rmin = 1e10;
        auto udmin = 1e22;
        auto lmin = 1e35;
        if (!r.empty())
            rmin = r.front().x;
        if (!ud_x.empty())
            udmin = ud_x.front();
        if (!l.empty())
            lmin = l.front().x;

        auto tl = (lmin - rmin) * 0.5;
        auto tud = (udmin - rmin) * 1.0;

        x_min_t[0] = 0;
        x_min_t[1] = max(0.0, min(1e10, (tl <= tud ? tl : tud)));
        x_min_t[2] = max(0.0, min(1e10, (tl <= tud ? tl : tl + (tl - tud))));
        x_min_t[3] = 1e10;

        x_min_x[0] = rmin;
        x_min_x[1] = udmin;
        x_min_x[2] = lmin;
    }

    sort(l.begin(), l.end(), [](auto a, auto b) { return a.y < b.y; });
    sort(r.begin(), r.end(), [](auto a, auto b) { return a.y < b.y; });
    sort(u.begin(), u.end(), [](auto a, auto b) { return a.y < b.y; });
    sort(d.begin(), d.end(), [](auto a, auto b) { return a.y < b.y; });

    auto lr_y = vector<int>();
    if (!l.empty() && !r.empty()) {
        lr_y.push_back(min(l.front().y, r.front().y));
        lr_y.push_back(max(l.back().y, r.back().y));
    } else if (!l.empty()) {
        lr_y.push_back(l.front().y);
        lr_y.push_back(l.back().y);
    } else if (!r.empty()) {
        lr_y.push_back(r.front().y);
        lr_y.push_back(r.back().y);
    }

    auto y_max_t = vector<double>(4);
    auto y_max_y = vector<double>(3);
    {
        auto dmax = -1e10;
        auto lrmax = -1e22;
        auto umax = -1e35;
        if (!d.empty())
            dmax = d.back().y;
        if (!lr_y.empty())
            lrmax = lr_y.back();
        if (!u.empty())
            umax = u.back().y;

        auto tu = (dmax - umax) * 0.5;
        auto tlr = (dmax - lrmax) * 1.0;

        y_max_t[0] = 0;
        y_max_t[1] = max(0.0, min(1e10, (tu <= tlr ? tu : tlr)));
        y_max_t[2] = max(0.0, min(1e10, (tu <= tlr ? tu : tu + (tu - tlr))));
        y_max_t[3] = 1e10;

        y_max_y[0] = dmax;
        y_max_y[1] = lrmax;
        y_max_y[2] = umax;
    }
    auto y_min_t = vector<double>(4);
    auto y_min_y = vector<double>(3);
    {
        auto umin = 1e10;
        auto lrmin = 1e22;
        auto dmin = 1e35;
        if (!u.empty())
            umin = u.front().y;
        if (!lr_y.empty())
            lrmin = lr_y.front();
        if (!d.empty())
            dmin = d.front().y;

        auto td = (dmin - umin) * 0.5;
        auto tlr = (lrmin - umin) * 1.0;

        y_min_t[0] = 0;
        y_min_t[1] = max(0.0, min(1e10, (td <= tlr ? td : tlr)));
        y_min_t[2] = max(0.0, min(1e10, (td <= tlr ? td : td + (td - tlr))));
        y_min_t[3] = 1e10;

        y_min_y[0] = umin;
        y_min_y[1] = lrmin;
        y_min_y[2] = dmin;
    }

    auto t_set = set<double>();
    t_set.insert(x_max_t.begin(), x_max_t.end());
    t_set.insert(x_min_t.begin(), x_min_t.end());
    t_set.insert(y_max_t.begin(), y_max_t.end());
    t_set.insert(y_min_t.begin(), y_min_t.end());
    t_set.erase(1e10);

    auto minarea = 1e300;
    for (auto t : t_set) {
        auto xmax = 0.0, xmin = 0.0, ymax = 0.0, ymin = 0.0;
        for (int i = 0; i + 1 < 4; i++) {
            if (x_max_t[i] <= t && t < x_max_t[i + 1]) {
                xmax = x_max_x[i] + (i == 0 ? -t : i == 1 ? 0.0 : t);
                break;
            }
        }
        for (int i = 0; i + 1 < 4; i++) {
            if (x_min_t[i] <= t && t < x_min_t[i + 1]) {
                xmin = x_min_x[i] + (i == 0 ? t : i == 1 ? 0.0 : -t);
                break;
            }
        }
        for (int i = 0; i + 1 < 4; i++) {
            if (y_max_t[i] <= t && t < y_max_t[i + 1]) {
                ymax = y_max_y[i] + (i == 0 ? -t : i == 1 ? 0.0 : t);
                break;
            }
        }
        for (int i = 0; i + 1 < 4; i++) {
            if (y_min_t[i] <= t && t < y_min_t[i + 1]) {
                ymin = y_min_y[i] + (i == 0 ? t : i == 1 ? 0.0 : -t);
                break;
            }
        }
        auto area = (xmax - xmin) * (ymax - ymin);
        minarea = min(area, minarea);
    }

    cout << setprecision(15) << minarea;
    return 0;
}


Measured memory_bytes: 1276