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.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        int n = sc.nextInt();
        long[][] x = new long[n][2];
        long xrmax = Long.MIN_VALUE/4;
        long xlmax = Long.MIN_VALUE/4;
        long xmmax = Long.MIN_VALUE/4;
        long xrmin = Long.MAX_VALUE/4;
        long xlmin = Long.MAX_VALUE/4;
        long xmmin = Long.MAX_VALUE/4;
        long yumax = Long.MIN_VALUE/4;
        long ydmax = Long.MIN_VALUE/4;
        long ymmax = Long.MIN_VALUE/4;
        long yumin = Long.MAX_VALUE/4;
        long ydmin = Long.MAX_VALUE/4;
        long ymmin = Long.MAX_VALUE/4;
        for(int i=0; i<n; i++){
            x[i][0] = sc.nextLong();
            x[i][1] = sc.nextLong();
            String t = sc.next();
            switch(t){
                case "R":
                xrmax = Math.max(xrmax, x[i][0]);
                xrmin = Math.min(xrmin, x[i][0]);
                ymmax = Math.max(ymmax, x[i][1]);
                ymmin = Math.min(ymmin, x[i][1]);
                break;
                case "L":
                xlmax = Math.max(xlmax, x[i][0]);
                xlmin = Math.min(xlmin, x[i][0]);
                ymmax = Math.max(ymmax, x[i][1]);
                ymmin = Math.min(ymmin, x[i][1]);
                break;
                case "U":
                yumax = Math.max(yumax, x[i][1]);
                yumin = Math.min(yumin, x[i][1]);
                xmmax = Math.max(xmmax, x[i][0]);
                xmmin = Math.min(xmmin, x[i][0]);
                break;
                case "D":
                ydmax = Math.max(ydmax, x[i][1]);
                ydmin = Math.min(ydmin, x[i][1]);
                xmmax = Math.max(xmmax, x[i][0]);
                xmmin = Math.min(xmmin, x[i][0]);
                break;
            }
        }

        xrmax *= 2;
        xlmax *= 2;
        xmmax *= 2;
        xrmin *= 2;
        xlmin *= 2;
        xmmin *= 2;
        yumax *= 2;
        ydmax *= 2;
        ymmax *= 2;
        yumin *= 2;
        ydmin *= 2;
        ymmin *= 2;

        long ans = Long.MAX_VALUE;
        for(int i=0; i<400000010; i++){
        // for(int i=0; i<100; i++){
            long xmax = xmmax;
            xmax = Math.max(xmax, xrmax + i);
            xmax = Math.max(xmax, xlmax - i);
            long xmin = xmmin;
            xmin = Math.min(xmin, xrmin + i);
            xmin = Math.min(xmin, xlmin - i);
            long ymax = ymmax;
            ymax = Math.max(ymax, yumax + i);
            ymax = Math.max(ymax, ydmax - i);
            long ymin = ymmin;
            ymin = Math.min(ymin, yumin + i);
            ymin = Math.min(ymin, ydmin - i);
            ans = Math.min(ans, (xmax - xmin) * (ymax - ymin));
            // System.out.println(ans);
            // if(i % 10000000 == 0) System.out.println("a");
        }

        System.out.println((double)ans / 4.0);

    }


    private static class FastScanner {
        private final InputStream in = System.in;
        private final byte[] buffer = new byte[1024];
        private int ptr = 0;
        private int buflen = 0;

        private boolean hasNextByte() {
            if (ptr < buflen) {
                return true;
            } else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (buflen <= 0) {
                    return false;
                }
            }
            return true;
        }

        private int readByte() {
            if (hasNextByte())
                return buffer[ptr++];
            else
                return -1;
        }

        private static boolean isPrintableChar(int c) {
            return 33 <= c && c <= 126;
        }

        public boolean hasNext() {
            while (hasNextByte() && !isPrintableChar(buffer[ptr]))
                ptr++;
            return hasNextByte();
        }

        public String next() {
            if (!hasNext())
                throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            int b = readByte();
            while (isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }

        public long nextLong() {
            if (!hasNext())
                throw new NoSuchElementException();
            long n = 0;
            boolean minus = false;
            int b = readByte();
            if (b == '-') {
                minus = true;
                b = readByte();
            }
            if (b < '0' || '9' < b) {
                throw new NumberFormatException();
            }
            while (true) {
                if ('0' <= b && b <= '9') {
                    n *= 10;
                    n += b - '0';
                } else if (b == -1 || !isPrintableChar(b)) {
                    return minus ? -n : n;
                } else {
                    throw new NumberFormatException();
                }
                b = readByte();
            }
        }

        public int nextInt() {
            long nl = nextLong();
            if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
                throw new NumberFormatException();
            return (int) nl;
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }
    }

}