#include <bits/stdc++.h>
using namespace std;
# define fast ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
# define cases cin >> tests; while(tests--)
# define int long long
# define ch cout << "no rest for the wicked\n\n";
# define ch1(x) cout << '\n' << #x" : " << x << '\n';
# define ch2(x, y) cout << '\n' << #x" : " << x << " || " << #y" : " << y << '\n';
# define lcm(a, b) (((a) * (b))/__gcd(a, b))
# define fore(i, n) for(auto i = 0; i < n; i++)
int powa(int x, int y, int p)
{
int res = 1; // Initialize result
while (y > 0)
{
// If y is odd, multiply x with result
if (y & 1)
res = ((res % p) * (x % p)) % p;
// y must be even now
y = y>>1; // y = y/2
x = ((x % p) * (x % p)) % p;
}
return res % p;
}
void solve()
{
int n, a, b, k;
cin >> n >> a >> b >> k;
string str;
cin >> str;
int ans = 0;
int jj = 1000000009;
for(int i = 0; i < min(k, n+1); i++)
{
// ch1(str[i])
if(str[i] == '+')
{
ans += ((powa(a, n-i, jj) % jj) * (powa(b, i, jj) % jj));
}
else
{
ans -= ((powa(a, n-i, jj) % jj) * (powa(b, i, jj) % jj));
}
}
// cout << ans << endl;
if(k == n+1)
{
int num = ans;
while(num < 0)
{
num += 1000000009;
}
cout << num % 1000000009;
return;
}
// ans += (((ans * pow(b, k)) / pow(a, k)) * ((n+1) / k));
int rat = powa(b, k, jj) / powa(a, k, jj);
int series = n+1;
series /= k;
ans = ((((ans % jj) * ((powa(rat, series, jj))%jj) % jj) - 1) / (rat - 1));
// cout << ans % (1000000009);
// cout << ans - (ans / 1000000009);
int num = ans;
while(num < 0)
{
num += 1000000009;
}
cout << num % 1000000009;
}
signed main()
{
fast;
int tests = 1;
// cases
solve();
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgojIGRlZmluZSBmYXN0IGlvczo6c3luY193aXRoX3N0ZGlvKDApOyBjaW4udGllKDApOyBjb3V0LnRpZSgwKTsKIyBkZWZpbmUgY2FzZXMgY2luID4+IHRl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wgbWluKGssIG4rMSk7IGkrKykKICAgIHsKICAgICAgICAvLyBjaDEoc3RyW2ldKQogICAgICAgIGlmKHN0cltpXSA9PSAnKycpCiAgICAgICAgewogICAgICAgICAgICBhbnMgKz0gKChwb3dhKGEsIG4taSwgamopICUgamopICogKHBvd2EoYiwgaSwgamopICUgamopKTsKICAgICAgICB9CiAgICAgICAgZWxzZQogICAgICAgIHsKICAgICAgICAgICAgYW5zIC09ICgocG93YShhLCBuLWksIGpqKSAlIGpqKSAqIChwb3dhKGIsIGksIGpqKSAlIGpqKSk7CiAgICAgICAgfQogICAgfQogICAgLy8gY291dCA8PCBhbnMgPDwgZW5kbDsKICAgIGlmKGsgPT0gbisxKQogICAgewogICAgICAgIGludCBudW0gPSBhbnM7CiAgICAgICAgd2hpbGUobnVtIDwgMCkKICAgICAgICB7CiAgICAgICAgICAgIG51bSArPSAxMDAwMDAwMDA5OwogICAgICAgIH0KICAgICAgICBjb3V0IDw8IG51bSAlIDEwMDAwMDAwMDk7CiAgICAgICAgcmV0dXJuOwogICAgfQogICAgLy8gYW5zICs9ICgoKGFucyAqIHBvdyhiLCBrKSkgLyBwb3coYSwgaykpICogKChuKzEpIC8gaykpOwogICAgaW50IHJhdCA9IHBvd2EoYiwgaywgamopIC8gcG93YShhLCBrLCBqaik7CiAgICBpbnQgc2VyaWVzID0gbisxOwogICAgc2VyaWVzIC89IGs7CiAgICBhbnMgPSAoKCgoYW5zICUgamopICogKChwb3dhKHJhdCwgc2VyaWVzLCBqaikpJWpqKSAlIGpqKSAtIDEpIC8gKHJhdCAtIDEpKTsKICAgIC8vIGNvdXQgPDwgYW5zICUgKDEwMDAwMDAwMDkpOwogICAgLy8gY291dCA8PCBhbnMgLSAoYW5zIC8gMTAwMDAwMDAwOSk7CiAgICBpbnQgbnVtID0gYW5zOwogICAgd2hpbGUobnVtIDwgMCkKICAgIHsKICAgICAgICBudW0gKz0gMTAwMDAwMDAwOTsKICAgIH0KICAgIGNvdXQgPDwgbnVtICUgMTAwMDAwMDAwOTsKfQoKc2lnbmVkIG1haW4oKQp7CiAgICBmYXN0OwogICAgaW50IHRlc3RzID0gMTsKICAgIAogICAgLy8gY2FzZXMKICAgIHNvbHZlKCk7CiAgICAKICAgIHJldHVybiAwOwp9