#include <bits/stdc++.h>
using namespace std;
inline char nc() {
  static char buf[100000], *p1 = buf, *p2 = buf;
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
inline int read() {
  register int x = 0, f = 1;
  register char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    x = (x << 3) + (x << 1) + ch - '0', ch = getchar();
  return x * f;
}
inline void write(register int x) {
  if (!x) putchar('0');
  if (x < 0) x = -x, putchar('-');
  static int sta[20];
  register int tot = 0;
  while (x) sta[tot++] = x % 10, x /= 10;
  while (tot) putchar(sta[--tot] + 48);
}
int power(int a, int b) {
  int res = 1;
  while (b) {
    if (b & 1) res = 1ll * res * a % 1000000009;
    a = 1ll * a * a % 1000000009, b >>= 1;
  }
  return res;
}
int n, a, inva, b, k, s[100005];
int main() {
  n = read(), a = read(), b = read(), k = read();
  for (int i = 0; i < k; ++i) {
    char ch = getchar();
    while (ch != '+' && ch != '-') ch = getchar();
    s[i] = (ch == '+') ? 1 : -1;
  }
  inva = power(a, 1000000009 - 2);
  int x = power(a, n), y = 1, sum = 0;
  for (int i = 0; i < k; ++i) {
    sum =
        (0ll + sum + 1ll * s[i] * x * y % 1000000009 + 1000000009) % 1000000009;
    x = 1ll * x * inva % 1000000009, y = 1ll * y * b % 1000000009;
  }
  int p = (n + 1) / k;
  int c = 1ll * power(b, k) * power(inva, k) % 1000000009;
  if (c == 1) {
    printf("%d\n", 1ll * sum * p % 1000000009);
    return 0;
  }
  int mul = 1ll * (power(c, p) - 1 + 1000000009) *
            power(c - 1 + 1000000009, 1000000009 - 2) % 1000000009;
  printf("%d\n", 1ll * sum * mul % 1000000009);
  return 0;
}

### Prompt

Create a solution in CPP for 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;
inline char nc() {
  static char buf[100000], *p1 = buf, *p2 = buf;
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
inline int read() {
  register int x = 0, f = 1;
  register char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    x = (x << 3) + (x << 1) + ch - '0', ch = getchar();
  return x * f;
}
inline void write(register int x) {
  if (!x) putchar('0');
  if (x < 0) x = -x, putchar('-');
  static int sta[20];
  register int tot = 0;
  while (x) sta[tot++] = x % 10, x /= 10;
  while (tot) putchar(sta[--tot] + 48);
}
int power(int a, int b) {
  int res = 1;
  while (b) {
    if (b & 1) res = 1ll * res * a % 1000000009;
    a = 1ll * a * a % 1000000009, b >>= 1;
  }
  return res;
}
int n, a, inva, b, k, s[100005];
int main() {
  n = read(), a = read(), b = read(), k = read();
  for (int i = 0; i < k; ++i) {
    char ch = getchar();
    while (ch != '+' && ch != '-') ch = getchar();
    s[i] = (ch == '+') ? 1 : -1;
  }
  inva = power(a, 1000000009 - 2);
  int x = power(a, n), y = 1, sum = 0;
  for (int i = 0; i < k; ++i) {
    sum =
        (0ll + sum + 1ll * s[i] * x * y % 1000000009 + 1000000009) % 1000000009;
    x = 1ll * x * inva % 1000000009, y = 1ll * y * b % 1000000009;
  }
  int p = (n + 1) / k;
  int c = 1ll * power(b, k) * power(inva, k) % 1000000009;
  if (c == 1) {
    printf("%d\n", 1ll * sum * p % 1000000009);
    return 0;
  }
  int mul = 1ll * (power(c, p) - 1 + 1000000009) *
            power(c - 1 + 1000000009, 1000000009 - 2) % 1000000009;
  printf("%d\n", 1ll * sum * mul % 1000000009);
  return 0;
}

```