/*Bismillahir Rahmanir Rahim*///{
#include <bits/stdc++.h>
#include <ext/numeric>
using namespace std; using __gnu_cxx::power;
using ll = long long; using ull = unsigned long long; using ld = long double;
const ll llinf = (1ll<<61)-1; const double eps = 1e-6, ldeps = 1e-9;
struct Dbg { static constexpr auto &os = cout;   // replace by cerr in interactive.
template<class C> static auto dud(C *x)->decltype(os << *x, 0);
template<class C> static char dud(...);
template<class C> typename enable_if<sizeof dud<C>(0)!=1,Dbg&>::type operator<<(const C &x) {os<<x; return *this;}
template<class C> Dbg &dump(C b, C e) {
    for (struct{C i;int j;} i={(*this<<"\n[",b),0}; i.i!=e and i.j<26; i.i++, i.j++) *this<<", "+2*(i.i==b)<<*i.i;
    return *this << ']';
}
template<class C> typename enable_if<sizeof dud<C>(0)==1, Dbg&>::type operator<<(const C &x) {
    return dump(begin(x), end(x));
}
template<class C, size_t X> typename enable_if<!is_same<C, const char>::value, Dbg&>::type operator<<(C (&x)[X]) {
    return dump(begin(x), end(x));
}
template<class B, class C> Dbg &operator<<(const pair<B, C> &x) {return *this<<'{'<<x.first<<", "<<x.second<<'}';}
Dbg &operator<<(ostream&(*x)(std::ostream&)) { os << x; return *this; }
} dbg;
void err(istringstream *iss) { delete iss; }
template<class C, class... Args> void err(istringstream *iss, const C &val, const Args &... args) {
    string name; *iss >> name; if (name.back()==',') name.pop_back();
    dbg << name << " = " << val << "; ", err(iss, args...);
}
#define bug(args...) dbg << __LINE__ << ": ", err(new istringstream(#args), args), dbg << endl
#define cbug(a, args...) if (a) bug(args);
#define ASSERT(a, o, b, args...) if (!((a)o(b))) bug(a, b, ##args), assert((a)o(b));
#define sl(a) int(strlen(a))
#define sz(a) int(a.size())
int T, Q, cn;//}
const int inf = 1000000007, mxn = 100005;

int n, d[2][130];
pair<pair<int, int>, char> a[mxn];

signed main() { cin.tie(0)->sync_with_stdio(0); cin.exceptions(cin.failbit); cout.precision(16), cout.setf(ios::fixed);
/*
Got one WA for not checking adjacent points of answer in ternary search, another WA for trying to extend ternary search by eps.
*/
    d[0]['R'] = 1, d[0]['L'] = -1, d[1]['U'] = 1, d[1]['D'] = -1;
    cin >> n;
    for (int i = 1; i <= n; i++) {
        cin >> a[i].first.first >> a[i].first.second >> a[i].second;
    }
    auto f = [&](bool y, double t)->double {
        double mx = -inf, mn = inf;
        for (int i = 1; i <= n; i++) {
            double np = y ? a[i].first.second+d[1][a[i].second]*t : a[i].first.first+d[0][a[i].second]*t;
            mx = max(mx, np), mn = min(mn, np);
        }
        return mx-mn;
    };
    double lo = 0, hi = 2e8+5;
    int mxIter = 100;
    for (int i = 0; i<mxIter; i++) {
        double mid1 = lo + (hi-lo)/3, mid2 = hi - (hi-lo)/3;
        if (f(0, mid1) <= f(0, mid2)) hi = mid2;
        if (f(0, mid1) >= f(0, mid2)) lo = mid1;
    }
    double bestTimeX = lo;
    lo = 0, hi = 2e8+5;
    for (int i = 0; i<mxIter; i++) {
        double mid1 = lo + (hi-lo)/3, mid2 = hi - (hi-lo)/3;
        if (f(1, mid1) <= f(1, mid2)) hi = mid2;
        if (f(1, mid1) >= f(1, mid2)) lo = mid1;
    }
    double bestTimeY = lo;

    lo = min(bestTimeX, bestTimeY), hi = max(bestTimeX, bestTimeY);
    for (int i = 0; i<mxIter; i++) {
        double mid1 = lo + (hi-lo)/3, mid2 = hi - (hi-lo)/3;
        if (f(0, mid1)*ld(f(1, mid1)) <= f(0, mid2)*ld(f(1, mid2))) hi = mid2;
        if (f(0, mid1)*ld(f(1, mid1)) >= f(0, mid2)*ld(f(1, mid2))) lo = mid1;
    }
    ld mn = llinf;
    for (int i = 0; i < mxIter; i++) {
        mn = min({mn, f(0, lo-i*ldeps)*ld(f(1, lo-i*ldeps)), f(0, lo+i*ldeps)*ld(f(1, lo+i*ldeps))});
    }
    cout << mn << '\n';
}

Measured memory_bytes: 1408