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

Solution:
#include <bits/stdc++.h>
using namespace std;
const int P = 1e9 + 7;
const int N = 5e5 + 5;
struct Point {
  int h1, w1, h2, w2, x, y;
};
int oper[N * 2];
Point opt[N * 2];
int bo[N * 2];
int nex[N * 2];
int main() {
  int n, h, w;
  scanf("%d%d%d", &n, &h, &w);
  for (int i = 1; i <= n; ++i) {
    int &ch = oper[i];
    while (ch = getchar(), !isalpha(ch))
      ;
    oper[i + n] = oper[i];
  }
  opt[0] = (Point){0, 0, 0, 0, 0, 0};
  for (int i = 1; i <= 2 * n; ++i) {
    opt[i] = opt[i - 1];
    if (oper[i] == 'U') {
      --opt[i].x;
      if (opt[i].x < opt[i].h1) {
        opt[i].h1 = opt[i].x;
        bo[i] = 1;
      }
    } else if (oper[i] == 'D') {
      ++opt[i].x;
      if (opt[i].x > opt[i].h2) {
        opt[i].h2 = opt[i].x;
        bo[i] = 2;
      }
    } else if (oper[i] == 'L') {
      --opt[i].y;
      if (opt[i].y < opt[i].w1) {
        opt[i].w1 = opt[i].y;
        bo[i] = 3;
      }
    } else {
      ++opt[i].y;
      if (opt[i].y > opt[i].w2) {
        opt[i].w2 = opt[i].y;
        bo[i] = 4;
      }
    }
  }
  for (int i = 3 * n, t = -1; i >= 0; --i) {
    if (i <= 2 * n) nex[i] = t;
    int bb = 0;
    if (i > 2 * n)
      bb = bo[i - n];
    else
      bb = bo[i];
    if (bb) t = i;
    if (nex[i] > 2 * n) nex[i] -= n;
  }
  Point A = opt[0];
  int i = 0;
  long long num = 0, ans = 0, res = 0;
  while (num < (long long)h * w) {
    if (nex[i] == -1) break;
    A.x += opt[nex[i]].x - opt[i].x;
    A.y += opt[nex[i]].y - opt[i].y;
    res += nex[i] - i;
    if (nex[i] <= i) {
      A.x += opt[n].x;
      A.y += opt[n].y;
      res += n;
    }
    i = nex[i];
    if (bo[i] == 1 || bo[i] == 2) {
      if (A.h2 - A.h1 + 1 <= h) {
        int tmp = max(0, w - (A.w2 - A.w1 + 1) + 1);
        num += tmp;
        ans += (long long)tmp * res % P;
        ans %= P;
        if (bo[i] == 1)
          --A.h1;
        else
          ++A.h2;
      }
    } else {
      if (A.w2 - A.w1 + 1 <= w) {
        int tmp = max(0, h - (A.h2 - A.h1 + 1) + 1);
        num += tmp;
        ans += (long long)tmp * res % P;
        ans %= P;
        if (bo[i] == 3)
          --A.w1;
        else
          ++A.w2;
      }
    }
  }
  if (num < (long long)h * w) ans = -1;
  cout << ans << endl;
  return 0;
}