Problem: Limak is a little polar bear. His parents told him to clean a house before the New Year's Eve. Their house is a rectangular grid with h rows and w columns. Each cell is an empty square.

He is a little bear and thus he can't clean a house by himself. Instead, he is going to use a cleaning robot.

A cleaning robot has a built-in pattern of n moves, defined by a string of the length n. A single move (character) moves a robot to one of four adjacent cells. Each character is one of the following four: 'U' (up), 'D' (down), 'L' (left), 'R' (right). One move takes one minute.

A cleaning robot must be placed and started in some cell. Then it repeats its pattern of moves till it hits a wall (one of four borders of a house). After hitting a wall it can be placed and used again.

Limak isn't sure if placing a cleaning robot in one cell will be enough. Thus, he is going to start it w·h times, one time in each cell. Maybe some cells will be cleaned more than once but who cares?

Limak asks you one question. How much time will it take to clean a house? Find and print the number of minutes modulo 109 + 7. It's also possible that a cleaning robot will never stop — then print "-1" (without the quotes) instead.

Placing and starting a robot takes no time, however, you must count a move when robot hits a wall. Take a look into samples for further clarification.

Input

The first line contains three integers n, h and w (1 ≤ n, h, w ≤ 500 000) — the length of the pattern, the number of rows and the number of columns, respectively.

The second line contains a string of length n — the pattern of n moves. Each character is one of uppercase letters 'U', 'D', 'L' or 'R'.

Output

Print one line with the answer.

If a cleaning robot will never stop, print "-1" (without the quotes). Otherwise, print the number of minutes it will take to clean a house modulo 109 + 7.

Examples

Input

1 10 2
R


Output

30


Input

3 4 6
RUL


Output

134


Input

4 1 500000
RLRL


Output

-1

Note

In the first sample house is a grid with 10 rows and 2 columns. Starting a robot anywhere in the second column will result in only one move (thus, one minute of cleaning) in which robot will hit a wall — he tried to go right but there is no third column. Starting a robot anywhere in the first column will result in two moves. The total number of minutes is 10·1 + 10·2 = 30.

In the second sample a started robot will try to move "RULRULRULR..." For example, for the leftmost cell in the second row robot will make 5 moves before it stops because of hitting an upper wall.

Solution (in JAVA):

Solution:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @author Pavel Mavrin
 */
public class F {

    private static final long MOD = (long) (1e9+7);

    private void solve() throws IOException {
        int n = nextInt();
        int h = nextInt();
        int w = nextInt();
        String s = next();
        int[] dx = new int[n];
        int[] dy = new int[n];
        for (int i = 0; i < n; i++) {
            int d = "UDLR".indexOf(s.charAt(i));
            dx[i] = new int[]{0, 0, -1, 1}[d];
            dy[i] = new int[]{-1, 1, 0, 0}[d];
        }
        int[] x1 = new int[w + h];
        int[] x2 = new int[w + h];
        int[] y1 = new int[w + h];
        int[] y2 = new int[w + h];
        int[] p = new int[w + h];

        int m = 1;
        int x = 0;
        int y = 0;
        boolean ok = false;
        for (int i = 0; i < n; i++) {
            x += dx[i];
            y += dy[i];
            if (x < x1[m - 1] || x > x2[m - 1] || y < y1[m - 1] || y > y2[m - 1]) {
                x1[m] = Math.min(x1[m - 1], x);
                x2[m] = Math.max(x2[m - 1], x);
                y1[m] = Math.min(y1[m - 1], y);
                y2[m] = Math.max(y2[m - 1], y);
                p[m] = i + 1;
                m++;
                if ((x2[m - 1] - x1[m - 1] + 1) > w || (y2[m - 1] - y1[m - 1] + 1) > h) {
                    ok = true;
                    break;
                }
            }
        }

        int sx = x;
        int sy = y;

        if (!ok) {
            if (x == 0 && y == 0) {
                out.println(-1);
                return;
            }
            int[] q = new int[m];
            int qn = 0;
            int xx1 = x1[m - 1];
            int xx2 = x2[m - 1];
            int yy1 = y1[m - 1];
            int yy2 = y2[m - 1];
            for (int i = 0; i < m; i++) {
                int xxx1 = x + x1[i];
                int yyy1 = y + y1[i];
                int xxx2 = x + x2[i];
                int yyy2 = y + y2[i];
                if (xxx1 < xx1 || xxx2 > xx2 || yyy1 < yy1 || yyy2 > yy2) {
                    q[qn++] = i;
                    xx1 = Math.min(xx1, xxx1);
                    xx2 = Math.max(xx2, xxx2);
                    yy1 = Math.min(yy1, yyy1);
                    yy2 = Math.max(yy2, yyy2);
                }
            }

            x = 0;
            y = 0;
            int nn = 0;

            while (true) {
                x += sx;
                y += sy;
                nn += n;
                nn %= MOD;
                for (int i = 0; i < qn; i++) {
                    x1[m] = Math.min(x1[m - 1], x + x1[q[i]]);
                    x2[m] = Math.max(x2[m - 1], x + x2[q[i]]);
                    y1[m] = Math.min(y1[m - 1], y + y1[q[i]]);
                    y2[m] = Math.max(y2[m - 1], y + y2[q[i]]);
                    p[m] = p[q[i]] + nn;
                    p[m] %= MOD;
                    m++;
                    if ((x2[m - 1] - x1[m - 1] + 1) > w || (y2[m - 1] - y1[m - 1] + 1) > h) {
                        ok = true;
                        break;
                    }
                }
                if (ok) break;
            }
        }
//        for (int i = 0; i < m; i++) {
//            System.out.println(x1[i] + " " + x2[i] + " " + y1[i] + " " + y2[i] + " " + p[i]);
//        }
        long res = 0;
        for (int i = 0; i < m - 1; i++) {
            int h1 = y2[i] - y1[i] + 1;
            int h2 = y2[i + 1] - y1[i + 1] + 1;
            int w1 = x2[i] - x1[i] + 1;
            int w2 = x2[i + 1] - x1[i + 1] + 1;
            if (h2 > h1) {
                res += 1l * p[i + 1] * (w - w1 + 1);
                res %= MOD;
            } else {
                res += 1l * p[i + 1] * (h - h1 + 1);
                res %= MOD;
            }
        }
        out.println(res);
    }


    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st;
    PrintWriter out = new PrintWriter(System.out);

    String next() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    public static void main(String[] args) throws IOException {
        new F().run();
    }

    private void run() throws IOException {
        solve();
        out.close();
    }

}