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 JAVA):

Solution:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Arrays;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UncheckedIOException;
import java.nio.charset.Charset;
import java.util.StringTokenizer;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.io.BufferedReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author mikit
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        LightScanner in = new LightScanner(inputStream);
        LightWriter out = new LightWriter(outputStream);
        FMinimumBoundingBox solver = new FMinimumBoundingBox();
        solver.solve(1, in, out);
        out.close();
    }

    static class FMinimumBoundingBox {
        public void solve(int testNumber, LightScanner in, LightWriter out) {
            // out.setBoolLabel(LightWriter.BoolLabel.YES_NO_FIRST_UP);
            int n = in.ints();
            int[][] min = new int[2][3], max = new int[2][3];
            ArrayUtil.fill(min, Integer.MAX_VALUE);
            ArrayUtil.fill(max, Integer.MIN_VALUE);

            for (int i = 0; i < n; i++) {
                int x = in.ints(), y = in.ints();
                char d = in.string().charAt(0);
                switch (d) {
                    case 'L':
                        min[0][0] = Math.min(min[0][0], x);
                        max[0][0] = Math.max(max[0][0], x);
                        break;
                    case 'U':
                    case 'D':
                        min[0][1] = Math.min(min[0][1], x);
                        max[0][1] = Math.max(max[0][1], x);
                        break;
                    case 'R':
                        min[0][2] = Math.min(min[0][2], x);
                        max[0][2] = Math.max(max[0][2], x);
                        break;
                }
                switch (d) {
                    case 'D':
                        min[1][0] = Math.min(min[1][0], y);
                        max[1][0] = Math.max(max[1][0], y);
                        break;
                    case 'L':
                    case 'R':
                        min[1][1] = Math.min(min[1][1], y);
                        max[1][1] = Math.max(max[1][1], y);
                        break;
                    case 'U':
                        min[1][2] = Math.min(min[1][2], y);
                        max[1][2] = Math.max(max[1][2], y);
                        break;
                }
            }


            double lower, upper;
            {
                double t = 0;
                double xmin = min(min[0][1], min[0][0] - t, min[0][2] + t);
                double xmax = max(max[0][1], max[0][0] - t, max[0][2] + t);
                double ymin = min(min[1][1], min[1][0] - t, min[1][2] + t);
                double ymax = max(max[1][1], max[1][0] - t, max[1][2] + t);
                lower = (xmax - xmin) * (ymax - ymin);
            }
            {
                double t = 200_000_000d;
                double xmin = min(min[0][1], min[0][0] - t, min[0][2] + t);
                double xmax = max(max[0][1], max[0][0] - t, max[0][2] + t);
                double ymin = min(min[1][1], min[1][0] - t, min[1][2] + t);
                double ymax = max(max[1][1], max[1][0] - t, max[1][2] + t);
                upper = (xmax - xmin) * (ymax - ymin);
            }

            if (Math.min(lower, upper) < 1e-9) {
                out.ans(0).ln();
                return;
            }

            double ans = Double.MAX_VALUE;
            if (lower > upper + 1000.0) {
                for (long i = 400_100_000; i >= 0; i--) {
                    double t = i * 0.5;
                    double xmin = min(min[0][1], min[0][0] - t, min[0][2] + t);
                    double xmax = max(max[0][1], max[0][0] - t, max[0][2] + t);
                    double ymin = min(min[1][1], min[1][0] - t, min[1][2] + t);
                    double ymax = max(max[1][1], max[1][0] - t, max[1][2] + t);
                    double v = (xmax - xmin) * (ymax - ymin);
                    ans = v;
                }
            } else {
                for (long i = 0; i <= 400_000_000; i++) {
                    double t = i * 0.5;
                    double xmin = min(min[0][1], min[0][0] - t, min[0][2] + t);
                    double xmax = max(max[0][1], max[0][0] - t, max[0][2] + t);
                    double ymin = min(min[1][1], min[1][0] - t, min[1][2] + t);
                    double ymax = max(max[1][1], max[1][0] - t, max[1][2] + t);
                    double v = (xmax - xmin) * (ymax - ymin);
                    ans = Math.min(ans, v);
                }
            }
            out.ans(ans, 3).ln();
        }

        private static double min(double x, double y, double z) {
            return x < y && x < z ? x : y < z ? y : z;
        }

        private static double max(double x, double y, double z) {
            return x > y && x > z ? x : y > z ? y : z;
        }

    }

    static class LightWriter implements AutoCloseable {
        private final Writer out;
        private boolean autoflush = false;
        private boolean breaked = true;

        public LightWriter(Writer out) {
            this.out = out;
        }

        public LightWriter(OutputStream out) {
            this(new BufferedWriter(new OutputStreamWriter(out, Charset.defaultCharset())));
        }

        public LightWriter print(char c) {
            try {
                out.write(c);
                breaked = false;
            } catch (IOException ex) {
                throw new UncheckedIOException(ex);
            }
            return this;
        }

        public LightWriter print(String s) {
            try {
                out.write(s, 0, s.length());
                breaked = false;
            } catch (IOException ex) {
                throw new UncheckedIOException(ex);
            }
            return this;
        }

        public LightWriter ans(String s) {
            if (!breaked) {
                print(' ');
            }
            return print(s);
        }

        public LightWriter ans(double x, int n) {
            if (!breaked) {
                print(' ');
            }
            if (x < 0) {
                print('-');
                x = -x;
            }
            x += Math.pow(10, -n) / 2;
            print(Long.toString((long) x)).print('.');
            x -= (long) x;
            for (int i = 0; i < n; i++) {
                x *= 10;
                print((char) ('0' + ((int) x)));
                x -= (int) x;
            }
            return this;
        }

        public LightWriter ans(int i) {
            return ans(Integer.toString(i));
        }

        public LightWriter ln() {
            print(System.lineSeparator());
            breaked = true;
            if (autoflush) {
                try {
                    out.flush();
                } catch (IOException ex) {
                    throw new UncheckedIOException(ex);
                }
            }
            return this;
        }

        public void close() {
            try {
                out.close();
            } catch (IOException ex) {
                throw new UncheckedIOException(ex);
            }
        }

    }

    static class LightScanner {
        private BufferedReader reader = null;
        private StringTokenizer tokenizer = null;

        public LightScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
        }

        public String string() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new UncheckedIOException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int ints() {
            return Integer.parseInt(string());
        }

    }

    static final class ArrayUtil {
        private ArrayUtil() {
        }

        public static void fill(int[] a, int v) {
            Arrays.fill(a, v);
        }

        public static void fill(int[][] a, int v) {
            for (int i = 0; i < a.length; i++) {
                fill(a[i], v);
            }
        }

    }
}