#include <bits/stdc++.h>
using namespace std;
template <typename T>
class Modular {
 public:
  using Type = typename decay<decltype(T::value)>::type;
  constexpr Modular() : value() {}
  template <typename U>
  Modular(const U& x) {
    value = normalize(x);
  }
  template <typename U>
  static Type normalize(const U& x) {
    Type v;
    if (-mod() <= x && x < mod())
      v = static_cast<Type>(x);
    else
      v = static_cast<Type>(x % mod());
    if (v < 0) v += mod();
    return v;
  }
  const Type& operator()() const { return value; }
  template <typename U>
  explicit operator U() const {
    return static_cast<U>(value);
  }
  constexpr static Type mod() { return T::value; }
  Modular& operator++() { return *this += 1; }
  Modular& operator--() { return *this -= 1; }
  Modular operator++(int) {
    Modular result(*this);
    *this += 1;
    return result;
  }
  Modular operator--(int) {
    Modular result(*this);
    *this -= 1;
    return result;
  }
  Modular& operator+=(const Modular& other) {
    if ((value += other.value) >= mod()) value -= mod();
    return *this;
  }
  Modular& operator-=(const Modular& other) {
    if ((value -= other.value) < 0) value += mod();
    return *this;
  }
  template <typename U>
  Modular& operator+=(const U& other) {
    return *this += Modular(other);
  }
  template <typename U>
  Modular& operator-=(const U& other) {
    return *this -= Modular(other);
  }
  Modular operator-() { return Modular(-value); }
  template <typename U = T>
  typename enable_if<is_same<typename Modular<U>::Type, int>::value,
                     Modular>::type&
  operator*=(const Modular& rhs) {
    value = normalize(static_cast<int64_t>(value) *
                      static_cast<int64_t>(rhs.value));
    return *this;
  }
  template <typename U = T>
  typename enable_if<is_same<typename Modular<U>::Type, int64_t>::value,
                     Modular>::type&
  operator*=(const Modular& rhs) {
    int64_t q = static_cast<int64_t>(static_cast<long double>(value) *
                                     rhs.value / mod());
    value = normalize(value * rhs.value - q * mod());
    return *this;
  }
  template <typename U = T>
  typename enable_if<!is_integral<typename Modular<U>::Type>::value,
                     Modular>::type&
  operator*=(const Modular& rhs) {
    value = normalize(value * rhs.value);
    return *this;
  }
  Modular inverse() const {
    Type a = value, b = mod(), u = 0, v = 1;
    while (a != 0) {
      Type t = b / a;
      b -= t * a;
      swap(a, b);
      u -= t * v;
      swap(u, v);
    }
    assert(b == 1);
    return Modular(u);
  }
  Modular& operator/=(const Modular& other) { return *this *= other.inverse(); }
  template <typename U>
  friend bool operator==(const Modular<U>& lhs, const Modular<U>& rhs);
  template <typename U>
  friend std::istream& operator>>(std::istream& stream, Modular<U>& number);

 private:
  Type value;
};
template <typename T>
bool operator==(const Modular<T>& lhs, const Modular<T>& rhs) {
  return lhs.value == rhs.value;
}
template <typename T, typename U>
bool operator==(const Modular<T>& lhs, U rhs) {
  return lhs == Modular<T>(rhs);
}
template <typename T, typename U>
bool operator==(U lhs, const Modular<T>& rhs) {
  return Modular<T>(lhs) == rhs;
}
template <typename T>
bool operator!=(const Modular<T>& lhs, const Modular<T>& rhs) {
  return !(lhs == rhs);
}
template <typename T, typename U>
bool operator!=(const Modular<T>& lhs, U rhs) {
  return !(lhs == rhs);
}
template <typename T, typename U>
bool operator!=(U lhs, const Modular<T>& rhs) {
  return !(lhs == rhs);
}
template <typename T>
Modular<T> operator+(const Modular<T>& lhs, const Modular<T>& rhs) {
  return Modular<T>(lhs) += rhs;
}
template <typename T, typename U>
Modular<T> operator+(const Modular<T>& lhs, U rhs) {
  return Modular<T>(lhs) += rhs;
}
template <typename T, typename U>
Modular<T> operator+(U lhs, const Modular<T>& rhs) {
  return Modular<T>(lhs) += rhs;
}
template <typename T>
Modular<T> operator-(const Modular<T>& lhs, const Modular<T>& rhs) {
  return Modular<T>(lhs) -= rhs;
}
template <typename T, typename U>
Modular<T> operator-(const Modular<T>& lhs, U rhs) {
  return Modular<T>(lhs) -= rhs;
}
template <typename T, typename U>
Modular<T> operator-(U lhs, const Modular<T>& rhs) {
  return Modular<T>(lhs) -= rhs;
}
template <typename T>
Modular<T> operator*(const Modular<T>& lhs, const Modular<T>& rhs) {
  return Modular<T>(lhs) *= rhs;
}
template <typename T, typename U>
Modular<T> operator*(const Modular<T>& lhs, U rhs) {
  return Modular<T>(lhs) *= rhs;
}
template <typename T, typename U>
Modular<T> operator*(U lhs, const Modular<T>& rhs) {
  return Modular<T>(lhs) *= rhs;
}
template <typename T>
Modular<T> operator/(const Modular<T>& lhs, const Modular<T>& rhs) {
  return Modular<T>(lhs) /= rhs;
}
template <typename T, typename U>
Modular<T> operator/(const Modular<T>& lhs, U rhs) {
  return Modular<T>(lhs) /= rhs;
}
template <typename T, typename U>
Modular<T> operator/(U lhs, const Modular<T>& rhs) {
  return Modular<T>(lhs) /= rhs;
}
template <typename T>
Modular<T> power(const Modular<T>& a, long long b) {
  Modular<T> x = a, res = 1;
  while (b > 0) {
    if (b & 1) res *= x;
    x *= x;
    b >>= 1;
  }
  return res;
}
template <typename T>
string to_string(const Modular<T>& number) {
  return to_string(number());
}
template <typename T>
std::ostream& operator<<(std::ostream& stream, const Modular<T>& number) {
  return stream << number();
}
template <typename T>
std::istream& operator>>(std::istream& stream, Modular<T>& number) {
  stream >> number.value;
  number.value = Modular<T>::normalize(number.value);
  return stream;
}
template <int M>
using ModularConst = Modular<std::integral_constant<int, M>>;
struct VarMod {
  static int value;
};
int VarMod::value;
using Mint7 = ModularConst<(int)1e9 + 7>;
using Mint6 = ModularConst<(int)1e9 + 6>;
struct node {
  Mint7 value;
  Mint6 len;
};
node seq(Mint7 n7, Mint6 n6, int k) {
  Mint7 p10k = power((Mint7)10, k);
  Mint7 t = p10k * 10;
  Mint6 e = n6 - power((Mint6)10, k) + 1;
  Mint7 revt1 = 1 / (t - 1);
  Mint7 sum = (power(t, (int)e) - 1) * revt1;
  Mint7 z = p10k * sum;
  Mint7 cnt = n7 - p10k + 1;
  Mint7 res = z + (sum - cnt) * revt1;
  return {res, e * (k + 1)};
}
node concat(node a, node b) {
  Mint7 value = a.value * power((Mint7)10, (int)b.len) + b.value;
  return {value, a.len + b.len};
}
node multi(node a, int b) {
  if (b == 1) {
    return a;
  }
  if (b % 2 == 1) {
    return concat(multi(a, b - 1), a);
  }
  node z = multi(a, b / 2);
  return concat(z, z);
}
const int N = 100010;
node prec[N];
node big_seq(Mint7 n7, Mint6 n6, int k) {
  node res = seq(n7, n6, k - 1);
  for (int i = k - 2; i >= 0; i--) {
    res = concat(prec[i], res);
  }
  return res;
}
char s[N];
int pos;
node solve_exp() {
  int start = pos;
  Mint7 v7 = 0;
  Mint6 v6 = 0;
  while ('0' <= s[pos] && s[pos] <= '9') {
    v7 = v7 * 10 + (int)(s[pos] - '0');
    v6 = v6 * 10 + (int)(s[pos] - '0');
    pos++;
  }
  int len_v = pos - start;
  if (s[pos] == '+') {
    pos++;
    return concat({v7, len_v}, solve_exp());
  }
  if (s[pos] == '-') {
    pos++;
    int start2 = pos;
    Mint7 w7 = 0;
    Mint6 w6 = 0;
    while ('0' <= s[pos] && s[pos] <= '9') {
      w7 = w7 * 10 + (int)(s[pos] - '0');
      w6 = w6 * 10 + (int)(s[pos] - '0');
      pos++;
    }
    int len_w = pos - start2;
    v7--;
    v6--;
    node v = big_seq(v7, v6, len_v);
    node w = big_seq(w7, w6, len_w);
    Mint6 diff = w.len - v.len;
    Mint7 real_value = w.value - v.value * power((Mint7)10, (int)diff);
    Mint6 real_len = w.len - v.len;
    if (s[pos] == '+') {
      pos++;
      return concat({real_value, real_len}, solve_exp());
    }
    return {real_value, real_len};
  }
  if (s[pos] == '(') {
    int finish = pos;
    pos++;
    node z = solve_exp();
    node res = {0, 0};
    for (int i = start; i < finish; i++) {
      res = multi(res, 10);
      if (s[i] != '0') {
        res = concat(res, multi(z, s[i] - '0'));
      }
    }
    pos++;
    if (s[pos] == '+') {
      pos++;
      return concat(res, solve_exp());
    }
    return res;
  }
  return {v7, len_v};
}
int main() {
  Mint7 v7 = 0;
  Mint6 v6 = 0;
  for (int k = 0; k < N; k++) {
    v7 = v7 * 10 + 9;
    v6 = v6 * 10 + 9;
    prec[k] = seq(v7, v6, k);
  }
  cin >> s;
  pos = 0;
  node res = solve_exp();
  cout << res.value << '\n';
  return 0;
}

### Prompt

Develop a solution in cpp to the problem described below:

Consider the following grammar:

  * <expression> ::= <term> | <expression> '+' <term>
  * <term> ::= <number> | <number> '-' <number> | <number> '(' <expression> ')'
  * <number> ::= <pos_digit> | <number> <digit>
  * <digit> ::= '0' | <pos_digit>
  * <pos_digit> ::= '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'



This grammar describes a number in decimal system using the following rules:

  * <number> describes itself,
  * <number>-<number> (l-r, l ≤ r) describes integer which is concatenation of all integers from l to r, written without leading zeros. For example, 8-11 describes 891011,
  * <number>(<expression>) describes integer which is concatenation of <number> copies of integer described by <expression>,
  * <expression>+<term> describes integer which is concatenation of integers described by <expression> and <term>.



For example, 2(2-4+1)+2(2(17)) describes the integer 2341234117171717.

You are given an expression in the given grammar. Print the integer described by it modulo 109 + 7.

Input

The only line contains a non-empty string at most 105 characters long which is valid according to the given grammar. In particular, it means that in terms l-r l ≤ r holds.

Output

Print single integer — the number described by the expression modulo 109 + 7.

Examples

Input

8-11


Output

891011


Input

2(2-4+1)+2(2(17))


Output

100783079


Input

1234-5678


Output

745428774


Input

1+2+3+4-5+6+7-9


Output

123456789

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
template <typename T>
class Modular {
 public:
  using Type = typename decay<decltype(T::value)>::type;
  constexpr Modular() : value() {}
  template <typename U>
  Modular(const U& x) {
    value = normalize(x);
  }
  template <typename U>
  static Type normalize(const U& x) {
    Type v;
    if (-mod() <= x && x < mod())
      v = static_cast<Type>(x);
    else
      v = static_cast<Type>(x % mod());
    if (v < 0) v += mod();
    return v;
  }
  const Type& operator()() const { return value; }
  template <typename U>
  explicit operator U() const {
    return static_cast<U>(value);
  }
  constexpr static Type mod() { return T::value; }
  Modular& operator++() { return *this += 1; }
  Modular& operator--() { return *this -= 1; }
  Modular operator++(int) {
    Modular result(*this);
    *this += 1;
    return result;
  }
  Modular operator--(int) {
    Modular result(*this);
    *this -= 1;
    return result;
  }
  Modular& operator+=(const Modular& other) {
    if ((value += other.value) >= mod()) value -= mod();
    return *this;
  }
  Modular& operator-=(const Modular& other) {
    if ((value -= other.value) < 0) value += mod();
    return *this;
  }
  template <typename U>
  Modular& operator+=(const U& other) {
    return *this += Modular(other);
  }
  template <typename U>
  Modular& operator-=(const U& other) {
    return *this -= Modular(other);
  }
  Modular operator-() { return Modular(-value); }
  template <typename U = T>
  typename enable_if<is_same<typename Modular<U>::Type, int>::value,
                     Modular>::type&
  operator*=(const Modular& rhs) {
    value = normalize(static_cast<int64_t>(value) *
                      static_cast<int64_t>(rhs.value));
    return *this;
  }
  template <typename U = T>
  typename enable_if<is_same<typename Modular<U>::Type, int64_t>::value,
                     Modular>::type&
  operator*=(const Modular& rhs) {
    int64_t q = static_cast<int64_t>(static_cast<long double>(value) *
                                     rhs.value / mod());
    value = normalize(value * rhs.value - q * mod());
    return *this;
  }
  template <typename U = T>
  typename enable_if<!is_integral<typename Modular<U>::Type>::value,
                     Modular>::type&
  operator*=(const Modular& rhs) {
    value = normalize(value * rhs.value);
    return *this;
  }
  Modular inverse() const {
    Type a = value, b = mod(), u = 0, v = 1;
    while (a != 0) {
      Type t = b / a;
      b -= t * a;
      swap(a, b);
      u -= t * v;
      swap(u, v);
    }
    assert(b == 1);
    return Modular(u);
  }
  Modular& operator/=(const Modular& other) { return *this *= other.inverse(); }
  template <typename U>
  friend bool operator==(const Modular<U>& lhs, const Modular<U>& rhs);
  template <typename U>
  friend std::istream& operator>>(std::istream& stream, Modular<U>& number);

 private:
  Type value;
};
template <typename T>
bool operator==(const Modular<T>& lhs, const Modular<T>& rhs) {
  return lhs.value == rhs.value;
}
template <typename T, typename U>
bool operator==(const Modular<T>& lhs, U rhs) {
  return lhs == Modular<T>(rhs);
}
template <typename T, typename U>
bool operator==(U lhs, const Modular<T>& rhs) {
  return Modular<T>(lhs) == rhs;
}
template <typename T>
bool operator!=(const Modular<T>& lhs, const Modular<T>& rhs) {
  return !(lhs == rhs);
}
template <typename T, typename U>
bool operator!=(const Modular<T>& lhs, U rhs) {
  return !(lhs == rhs);
}
template <typename T, typename U>
bool operator!=(U lhs, const Modular<T>& rhs) {
  return !(lhs == rhs);
}
template <typename T>
Modular<T> operator+(const Modular<T>& lhs, const Modular<T>& rhs) {
  return Modular<T>(lhs) += rhs;
}
template <typename T, typename U>
Modular<T> operator+(const Modular<T>& lhs, U rhs) {
  return Modular<T>(lhs) += rhs;
}
template <typename T, typename U>
Modular<T> operator+(U lhs, const Modular<T>& rhs) {
  return Modular<T>(lhs) += rhs;
}
template <typename T>
Modular<T> operator-(const Modular<T>& lhs, const Modular<T>& rhs) {
  return Modular<T>(lhs) -= rhs;
}
template <typename T, typename U>
Modular<T> operator-(const Modular<T>& lhs, U rhs) {
  return Modular<T>(lhs) -= rhs;
}
template <typename T, typename U>
Modular<T> operator-(U lhs, const Modular<T>& rhs) {
  return Modular<T>(lhs) -= rhs;
}
template <typename T>
Modular<T> operator*(const Modular<T>& lhs, const Modular<T>& rhs) {
  return Modular<T>(lhs) *= rhs;
}
template <typename T, typename U>
Modular<T> operator*(const Modular<T>& lhs, U rhs) {
  return Modular<T>(lhs) *= rhs;
}
template <typename T, typename U>
Modular<T> operator*(U lhs, const Modular<T>& rhs) {
  return Modular<T>(lhs) *= rhs;
}
template <typename T>
Modular<T> operator/(const Modular<T>& lhs, const Modular<T>& rhs) {
  return Modular<T>(lhs) /= rhs;
}
template <typename T, typename U>
Modular<T> operator/(const Modular<T>& lhs, U rhs) {
  return Modular<T>(lhs) /= rhs;
}
template <typename T, typename U>
Modular<T> operator/(U lhs, const Modular<T>& rhs) {
  return Modular<T>(lhs) /= rhs;
}
template <typename T>
Modular<T> power(const Modular<T>& a, long long b) {
  Modular<T> x = a, res = 1;
  while (b > 0) {
    if (b & 1) res *= x;
    x *= x;
    b >>= 1;
  }
  return res;
}
template <typename T>
string to_string(const Modular<T>& number) {
  return to_string(number());
}
template <typename T>
std::ostream& operator<<(std::ostream& stream, const Modular<T>& number) {
  return stream << number();
}
template <typename T>
std::istream& operator>>(std::istream& stream, Modular<T>& number) {
  stream >> number.value;
  number.value = Modular<T>::normalize(number.value);
  return stream;
}
template <int M>
using ModularConst = Modular<std::integral_constant<int, M>>;
struct VarMod {
  static int value;
};
int VarMod::value;
using Mint7 = ModularConst<(int)1e9 + 7>;
using Mint6 = ModularConst<(int)1e9 + 6>;
struct node {
  Mint7 value;
  Mint6 len;
};
node seq(Mint7 n7, Mint6 n6, int k) {
  Mint7 p10k = power((Mint7)10, k);
  Mint7 t = p10k * 10;
  Mint6 e = n6 - power((Mint6)10, k) + 1;
  Mint7 revt1 = 1 / (t - 1);
  Mint7 sum = (power(t, (int)e) - 1) * revt1;
  Mint7 z = p10k * sum;
  Mint7 cnt = n7 - p10k + 1;
  Mint7 res = z + (sum - cnt) * revt1;
  return {res, e * (k + 1)};
}
node concat(node a, node b) {
  Mint7 value = a.value * power((Mint7)10, (int)b.len) + b.value;
  return {value, a.len + b.len};
}
node multi(node a, int b) {
  if (b == 1) {
    return a;
  }
  if (b % 2 == 1) {
    return concat(multi(a, b - 1), a);
  }
  node z = multi(a, b / 2);
  return concat(z, z);
}
const int N = 100010;
node prec[N];
node big_seq(Mint7 n7, Mint6 n6, int k) {
  node res = seq(n7, n6, k - 1);
  for (int i = k - 2; i >= 0; i--) {
    res = concat(prec[i], res);
  }
  return res;
}
char s[N];
int pos;
node solve_exp() {
  int start = pos;
  Mint7 v7 = 0;
  Mint6 v6 = 0;
  while ('0' <= s[pos] && s[pos] <= '9') {
    v7 = v7 * 10 + (int)(s[pos] - '0');
    v6 = v6 * 10 + (int)(s[pos] - '0');
    pos++;
  }
  int len_v = pos - start;
  if (s[pos] == '+') {
    pos++;
    return concat({v7, len_v}, solve_exp());
  }
  if (s[pos] == '-') {
    pos++;
    int start2 = pos;
    Mint7 w7 = 0;
    Mint6 w6 = 0;
    while ('0' <= s[pos] && s[pos] <= '9') {
      w7 = w7 * 10 + (int)(s[pos] - '0');
      w6 = w6 * 10 + (int)(s[pos] - '0');
      pos++;
    }
    int len_w = pos - start2;
    v7--;
    v6--;
    node v = big_seq(v7, v6, len_v);
    node w = big_seq(w7, w6, len_w);
    Mint6 diff = w.len - v.len;
    Mint7 real_value = w.value - v.value * power((Mint7)10, (int)diff);
    Mint6 real_len = w.len - v.len;
    if (s[pos] == '+') {
      pos++;
      return concat({real_value, real_len}, solve_exp());
    }
    return {real_value, real_len};
  }
  if (s[pos] == '(') {
    int finish = pos;
    pos++;
    node z = solve_exp();
    node res = {0, 0};
    for (int i = start; i < finish; i++) {
      res = multi(res, 10);
      if (s[i] != '0') {
        res = concat(res, multi(z, s[i] - '0'));
      }
    }
    pos++;
    if (s[pos] == '+') {
      pos++;
      return concat(res, solve_exp());
    }
    return res;
  }
  return {v7, len_v};
}
int main() {
  Mint7 v7 = 0;
  Mint6 v6 = 0;
  for (int k = 0; k < N; k++) {
    v7 = v7 * 10 + 9;
    v6 = v6 * 10 + 9;
    prec[k] = seq(v7, v6, k);
  }
  cin >> s;
  pos = 0;
  node res = solve_exp();
  cout << res.value << '\n';
  return 0;
}

```