#include <bits/stdc++.h>
#pragma GCC diagnostic ignored "-Wunused-const-variable"
#pragma GCC diagnostic ignored "-Wunused-variable"
using namespace std;
clock_t __start;
mt19937_64 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
const long double eps = 1e-8l;
const long long INF = 1e9 + 10;
const long long MOD = 1e9 + 9;
const long double Pi = acosl(-1.0l);
int __loc = 1;
int __io_opt = 1;
int __fileIO = 0;
int __MulTest = 0;
const char* __fin = "in";
const char* __fout = "out";
const char* __err = "err";
void prec();
void load();
void solve();
void __time(string s) {
  if (!__loc) return;
  cerr << s + ". Time: " << ((long double)clock() - __start) / CLOCKS_PER_SEC
       << '\n';
}
struct app {
  void __io_set() {
    __loc = 0;
    if (__io_opt) {
      ios_base::sync_with_stdio(0);
      cin.tie(0);
      cout.tie(0);
    }
    cout.precision(9);
    cout.setf(ios::fixed | ios::showpoint);
    if (__loc || __fileIO) {
      freopen(__fin, "r", stdin);
      freopen(__fout, "w", stdout);
    }
    if (__loc) freopen(__err, "w", stderr);
  }
  app() {
    __io_set();
    __start = clock();
    prec();
    __time("Precalc finised");
    int ts = 1;
    if (__MulTest) cin >> ts;
    while (ts--) {
      load();
      solve();
    }
    __time("Program finished");
  }
};
int main() { app x; }
long long pw(long long a, long long b) {
  if (b == 0) return 1;
  if (b % 2 == 0) {
    long long ans = pw(a, b / 2);
    return (ans * ans) % MOD;
  }
  return a * pw(a, b - 1) % MOD;
}
long long inv(long long a) { return pw(a, MOD - 2); }
void prec() {}
long long n, a, b, k, ans = 0;
string s;
void load() { cin >> n >> a >> b >> k >> s; }
long long sprog(long long b1, long long q, long long ln) {
  if (q == 1ll) return (b1 * ln) % MOD;
  return ((((b1 * (pw(q, ln) - 1ll))) % MOD) * inv(q - 1ll)) % MOD;
}
void solve() {
  long long len = (n + 1) / k;
  if (0) log(len);
  for (int i = 0; i < k; i++) {
    long long b1 = (pw(a, n - i) * pw(b, i)) % MOD;
    long long q = (pw(b, k) * inv(pw(a, k))) % MOD;
    long long lan = sprog(b1, q, len);
    if (0) log(lan);
    if (s[i] == '+')
      ans = (lan + ans) % MOD;
    else
      ans = (ans - lan + MOD) % MOD;
  }
  cout << ans;
}

### Prompt

Construct a CPP code solution to the problem outlined:

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>
#pragma GCC diagnostic ignored "-Wunused-const-variable"
#pragma GCC diagnostic ignored "-Wunused-variable"
using namespace std;
clock_t __start;
mt19937_64 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
const long double eps = 1e-8l;
const long long INF = 1e9 + 10;
const long long MOD = 1e9 + 9;
const long double Pi = acosl(-1.0l);
int __loc = 1;
int __io_opt = 1;
int __fileIO = 0;
int __MulTest = 0;
const char* __fin = "in";
const char* __fout = "out";
const char* __err = "err";
void prec();
void load();
void solve();
void __time(string s) {
  if (!__loc) return;
  cerr << s + ". Time: " << ((long double)clock() - __start) / CLOCKS_PER_SEC
       << '\n';
}
struct app {
  void __io_set() {
    __loc = 0;
    if (__io_opt) {
      ios_base::sync_with_stdio(0);
      cin.tie(0);
      cout.tie(0);
    }
    cout.precision(9);
    cout.setf(ios::fixed | ios::showpoint);
    if (__loc || __fileIO) {
      freopen(__fin, "r", stdin);
      freopen(__fout, "w", stdout);
    }
    if (__loc) freopen(__err, "w", stderr);
  }
  app() {
    __io_set();
    __start = clock();
    prec();
    __time("Precalc finised");
    int ts = 1;
    if (__MulTest) cin >> ts;
    while (ts--) {
      load();
      solve();
    }
    __time("Program finished");
  }
};
int main() { app x; }
long long pw(long long a, long long b) {
  if (b == 0) return 1;
  if (b % 2 == 0) {
    long long ans = pw(a, b / 2);
    return (ans * ans) % MOD;
  }
  return a * pw(a, b - 1) % MOD;
}
long long inv(long long a) { return pw(a, MOD - 2); }
void prec() {}
long long n, a, b, k, ans = 0;
string s;
void load() { cin >> n >> a >> b >> k >> s; }
long long sprog(long long b1, long long q, long long ln) {
  if (q == 1ll) return (b1 * ln) % MOD;
  return ((((b1 * (pw(q, ln) - 1ll))) % MOD) * inv(q - 1ll)) % MOD;
}
void solve() {
  long long len = (n + 1) / k;
  if (0) log(len);
  for (int i = 0; i < k; i++) {
    long long b1 = (pw(a, n - i) * pw(b, i)) % MOD;
    long long q = (pw(b, k) * inv(pw(a, k))) % MOD;
    long long lan = sprog(b1, q, len);
    if (0) log(lan);
    if (s[i] == '+')
      ans = (lan + ans) % MOD;
    else
      ans = (ans - lan + MOD) % MOD;
  }
  cout << ans;
}

```