#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9;
const int mod = inf + 9;
const double eps = 1e-9;
const double pi = acos(-1.0);
int n, a, b, k;
char tmp[100100];
string second;
int binpow(int a, int k) {
  if (k == 0) return 1;
  int ans = binpow(a, k / 2);
  ans = 1ll * ans * ans % mod;
  if (k % 2) ans = ans * 1ll * a % mod;
  return ans;
}
int calc(int A, int B, int m) {
  if (m < 10) {
    int ans = 0;
    for (int i = 0; i < m; i++) {
      ans += binpow(A, i) * 1ll * binpow(B, m - 1 - i) % mod;
      ans %= mod;
    }
    return ans;
  }
  if (m % 2 == 1) {
    int mid = (m - 1) / 2;
    int ans = binpow(A, mid) * 1ll * binpow(B, mid) % mod;
    int T = calc(A, B, mid);
    ans += T * 1ll * binpow(A, mid + 1) % mod;
    ans %= mod;
    ans += T * 1ll * binpow(B, mid + 1) % mod;
    ans %= mod;
    return ans;
  }
  int T = calc(A, B, m / 2);
  int ans = T * 1ll * binpow(A, m / 2) % mod;
  ans += T * 1ll * binpow(B, m / 2) % mod;
  ans %= mod;
  return ans;
}
int calc(int n) {
  int m = (n + 1) / k;
  int A = binpow(a, k);
  int B = binpow(b, k);
  if (a == b)
    return binpow(a, k - 1) * 1ll * m % mod * 1ll * binpow(A, m) % mod;
  int ans = calc(A, B, m);
  ans = ans * 1ll * binpow(a, k - 1) % mod;
  return ans;
}
int calcstupid(int n) {
  int ans = 0;
  for (int i = n; i >= 0; i -= k) {
    ans += binpow(a, i) * 1ll * binpow(b, n - i) % mod;
    ans %= mod;
  }
  return ans;
}
int gcd(int a, int b) {
  if (a == 0 || b == 0) return a + b;
  return gcd(b, a % b);
}
int main() {
  scanf("%d %d %d %d\n", &n, &a, &b, &k);
  scanf("%s", tmp);
  second = tmp;
  if (a == b) {
    int T = binpow(a, n);
    int m = (n + 1) / k;
    int ans = 0;
    for (int i = 0; i < k; i++) {
      int cur = T * 1ll * m % mod;
      if (second[i] == '+')
        ans += cur;
      else
        ans -= cur;
      ans %= mod;
      if (ans < 0) ans += mod;
    }
    ans += mod;
    ans %= mod;
    cout << ans << endl;
    return 0;
  }
  int ans = 0;
  int T = calc(n);
  int d = gcd(a, b);
  for (int i = 0; i < k; i++) {
    int cur = T * 1ll * binpow(b, i) % mod;
    cur = cur * 1ll * binpow(binpow(a, i), mod - 2) % mod;
    if (second[i] == '+')
      ans += cur;
    else
      ans -= cur;
    ans %= mod;
    if (ans < 0) ans += mod;
  }
  ans %= mod;
  ans += mod;
  ans %= mod;
  cout << ans << endl;
  return 0;
}

### Prompt

In cpp, your task is to solve the following problem:

You are given two integers a and b. Moreover, you are given a sequence s_0, s_1, ..., s_{n}. All values in s are integers 1 or -1. It's known that sequence is k-periodic and k divides n+1. In other words, for each k ≤ i ≤ n it's satisfied that s_{i} = s_{i - k}.

Find out the non-negative remainder of division of ∑ _{i=0}^{n} s_{i} a^{n - i} b^{i} by 10^{9} + 9.

Note that the modulo is unusual!

Input

The first line contains four integers n, a, b and k (1 ≤ n ≤ 10^{9}, 1 ≤ a, b ≤ 10^{9}, 1 ≤ k ≤ 10^{5}).

The second line contains a sequence of length k consisting of characters '+' and '-'. 

If the i-th character (0-indexed) is '+', then s_{i} = 1, otherwise s_{i} = -1.

Note that only the first k members of the sequence are given, the rest can be obtained using the periodicity property.

Output

Output a single integer — value of given expression modulo 10^{9} + 9.

Examples

Input

2 2 3 3
+-+


Output

7


Input

4 1 5 1
-


Output

999999228

Note

In the first example:

(∑ _{i=0}^{n} s_{i} a^{n - i} b^{i}) = 2^{2} 3^{0} - 2^{1} 3^{1} + 2^{0} 3^{2} = 7

In the second example:

(∑ _{i=0}^{n} s_{i} a^{n - i} b^{i}) = -1^{4} 5^{0} - 1^{3} 5^{1} - 1^{2} 5^{2} - 1^{1} 5^{3} - 1^{0} 5^{4} = -781 ≡ 999999228 \pmod{10^{9} + 9}.

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9;
const int mod = inf + 9;
const double eps = 1e-9;
const double pi = acos(-1.0);
int n, a, b, k;
char tmp[100100];
string second;
int binpow(int a, int k) {
  if (k == 0) return 1;
  int ans = binpow(a, k / 2);
  ans = 1ll * ans * ans % mod;
  if (k % 2) ans = ans * 1ll * a % mod;
  return ans;
}
int calc(int A, int B, int m) {
  if (m < 10) {
    int ans = 0;
    for (int i = 0; i < m; i++) {
      ans += binpow(A, i) * 1ll * binpow(B, m - 1 - i) % mod;
      ans %= mod;
    }
    return ans;
  }
  if (m % 2 == 1) {
    int mid = (m - 1) / 2;
    int ans = binpow(A, mid) * 1ll * binpow(B, mid) % mod;
    int T = calc(A, B, mid);
    ans += T * 1ll * binpow(A, mid + 1) % mod;
    ans %= mod;
    ans += T * 1ll * binpow(B, mid + 1) % mod;
    ans %= mod;
    return ans;
  }
  int T = calc(A, B, m / 2);
  int ans = T * 1ll * binpow(A, m / 2) % mod;
  ans += T * 1ll * binpow(B, m / 2) % mod;
  ans %= mod;
  return ans;
}
int calc(int n) {
  int m = (n + 1) / k;
  int A = binpow(a, k);
  int B = binpow(b, k);
  if (a == b)
    return binpow(a, k - 1) * 1ll * m % mod * 1ll * binpow(A, m) % mod;
  int ans = calc(A, B, m);
  ans = ans * 1ll * binpow(a, k - 1) % mod;
  return ans;
}
int calcstupid(int n) {
  int ans = 0;
  for (int i = n; i >= 0; i -= k) {
    ans += binpow(a, i) * 1ll * binpow(b, n - i) % mod;
    ans %= mod;
  }
  return ans;
}
int gcd(int a, int b) {
  if (a == 0 || b == 0) return a + b;
  return gcd(b, a % b);
}
int main() {
  scanf("%d %d %d %d\n", &n, &a, &b, &k);
  scanf("%s", tmp);
  second = tmp;
  if (a == b) {
    int T = binpow(a, n);
    int m = (n + 1) / k;
    int ans = 0;
    for (int i = 0; i < k; i++) {
      int cur = T * 1ll * m % mod;
      if (second[i] == '+')
        ans += cur;
      else
        ans -= cur;
      ans %= mod;
      if (ans < 0) ans += mod;
    }
    ans += mod;
    ans %= mod;
    cout << ans << endl;
    return 0;
  }
  int ans = 0;
  int T = calc(n);
  int d = gcd(a, b);
  for (int i = 0; i < k; i++) {
    int cur = T * 1ll * binpow(b, i) % mod;
    cur = cur * 1ll * binpow(binpow(a, i), mod - 2) % mod;
    if (second[i] == '+')
      ans += cur;
    else
      ans -= cur;
    ans %= mod;
    if (ans < 0) ans += mod;
  }
  ans %= mod;
  ans += mod;
  ans %= mod;
  cout << ans << endl;
  return 0;
}

```