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;
namespace mainns {
template <typename T>
int64_t sgn(T val) {
  return (T(0) < val) - (val < T(0));
}
namespace {
inline uint64_t gcdInternal(uint64_t a, uint64_t b) {
  if (b == 0) return a;
  return gcdInternal(b, a % b);
}
inline uint64_t gcdDecompositionInternal(uint64_t a, uint64_t b, int64_t& x,
                                         int64_t& y) {
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  }
  int64_t xx, yy;
  auto gcd = gcdDecompositionInternal(b, a % b, xx, yy);
  x = yy;
  y = xx - (a / b) * yy;
  return gcd;
}
}  // namespace
inline uint64_t greatestCommonDivisor(int64_t a, int64_t b) {
  a *= sgn(a);
  b *= sgn(b);
  if (a < b) std::swap(a, b);
  return gcdInternal(a, b);
}
inline uint64_t gcdDecomposition(int64_t a, int64_t b, int64_t& x, int64_t& y) {
  auto aUnsigned = a * sgn(a);
  auto bUnsigned = b * sgn(b);
  auto gcd = (aUnsigned < bUnsigned)
                 ? gcdDecompositionInternal(aUnsigned, bUnsigned, x, y)
                 : gcdDecompositionInternal(bUnsigned, aUnsigned, y, x);
  x *= sgn(a);
  y *= sgn(b);
  return gcd;
}
template <int64_t MOD>
class Residue {
 public:
  Residue(int64_t from = 0) {
    int64_t remainder = from % MOD;
    if (remainder < 0) remainder += MOD;
    rep_ = remainder;
  }
  bool operator==(Residue<MOD> other) const { return rep_ == other.rep_; }
  Residue<MOD> operator++(int) { return *this = Residue(rep_ + 1); }
  Residue<MOD> operator++() { return *this = Residue(rep_ + 1); }
  Residue<MOD> operator--(int) { return *this = Residue(rep_ - 1); }
  Residue<MOD> operator--() { return *this = Residue(rep_ - 1); }
  Residue<MOD> operator+=(Residue<MOD> v) {
    return *this = Residue(rep_ + v.rep());
  }
  Residue<MOD> operator-=(Residue<MOD> v) {
    return *this = Residue(rep_ - v.rep());
  }
  Residue<MOD> operator*=(Residue<MOD> v) {
    return *this = Residue(rep_ * v.rep());
  }
  Residue<MOD> inversed() const {
    int64_t x, y;
    auto gcd = gcdDecomposition(rep_, MOD, x, y);
    assert(gcd == 1);
    return Residue(x);
  }
  int64_t rep() const { return rep_; }

 private:
  int64_t rep_;
};
template <int64_t MOD>
Residue<MOD> operator+(Residue<MOD> a, Residue<MOD> b) {
  return a += b;
}
template <int64_t MOD>
Residue<MOD> operator-(Residue<MOD> a, Residue<MOD> b) {
  return a -= b;
}
template <int64_t MOD>
Residue<MOD> operator*(Residue<MOD> a, Residue<MOD> b) {
  return a *= b;
}
template <int64_t MOD>
Residue<MOD> operator+(Residue<MOD> a, int64_t b) {
  return a += b;
}
template <int64_t MOD>
Residue<MOD> operator-(Residue<MOD> a, int64_t b) {
  return a -= b;
}
template <int64_t MOD>
Residue<MOD> operator*(Residue<MOD> a, int64_t b) {
  return a *= b;
}
template <int64_t MOD>
std::ostream& operator<<(std::ostream& outStream, Residue<MOD> a) {
  return outStream << a.rep();
}
using CodeforcesResidue = Residue<1000000007>;
class Solver611F {
 public:
  void run();
  int64_t patternLen, width, height;
  string pattern;
  void prolongArray(vector<int64_t>& times, int neededSize,
                    int stepPerPattern) {
    auto startSize = times.size();
    for (int i = startSize; i < neededSize; ++i) {
      if (stepPerPattern > 0)
        times.push_back(times[i - stepPerPattern] + patternLen);
      else
        times.push_back(numeric_limits<int64_t>::max());
    }
  }
};
void Solver611F::run() {
  cin >> patternLen >> height >> width;
  cin >> pattern;
  vector<int64_t> timesToLeft = {0}, timesToRight = {0}, timesToTop = {0},
                  timesToBottom = {0};
  int64_t x = 0, y = 0;
  for (int64_t t = 1; t <= pattern.length(); ++t) {
    auto c = pattern[t - 1];
    if (c == 'U') {
      ++y;
      if (y >= timesToTop.size()) timesToTop.push_back(t);
    }
    if (c == 'D') {
      --y;
      if (-y >= timesToBottom.size()) timesToBottom.push_back(t);
    }
    if (c == 'R') {
      ++x;
      if (x >= timesToRight.size()) timesToRight.push_back(t);
    }
    if (c == 'L') {
      --x;
      if (-x >= timesToLeft.size()) timesToLeft.push_back(t);
      ;
    }
  }
  prolongArray(timesToTop, height + 1, y);
  prolongArray(timesToBottom, height + 1, -y);
  prolongArray(timesToRight, width + 1, x);
  prolongArray(timesToLeft, width + 1, -x);
  vector<int64_t> timesToLeftPS, timesToRightPS;
  auto smartSummator = [](int64_t a, int64_t b) -> int64_t {
    return (max(a, b) == numeric_limits<int64_t>::max())
               ? numeric_limits<int64_t>::max()
               : a + b;
  };
  partial_sum(begin(timesToRight), end(timesToRight),
              back_inserter(timesToRightPS), smartSummator);
  partial_sum(begin(timesToLeft), end(timesToLeft),
              back_inserter(timesToLeftPS), smartSummator);
  int64_t totalHorizontalTimePerLine = 0;
  for (int i = 0; i < width; ++i)
    totalHorizontalTimePerLine =
        smartSummator(min(timesToLeft[i + 1], timesToRight[width - i]),
                      totalHorizontalTimePerLine);
  CodeforcesResidue ans = 0;
  for (int yy = 0; yy < height; ++yy) {
    auto timeToTopOrBottom =
        min(timesToBottom[yy + 1], timesToTop[height - yy]);
    auto it1 =
        upper_bound(begin(timesToLeft), end(timesToLeft), timeToTopOrBottom) -
        begin(timesToLeft) - 1;
    auto it2 =
        upper_bound(begin(timesToRight), end(timesToRight), timeToTopOrBottom) -
        begin(timesToRight) - 1;
    if (it1 + it2 > width) {
      if (totalHorizontalTimePerLine == numeric_limits<int64_t>::max()) {
        cout << -1;
        return;
      }
      ans += totalHorizontalTimePerLine;
    } else {
      ans += timesToLeftPS[it1];
      ans += timesToRightPS[it2];
      ans += (width - it1 - it2) * timeToTopOrBottom;
    }
  }
  cout << ans.rep();
}
}  // namespace mainns
using CurrentSolver = mainns::Solver611F;
int main() {
  ios::sync_with_stdio(false);
  CurrentSolver().run();
  return 0;
}