#include <bits/stdc++.h>
#define EPS 0.000000000001;
#define pb push_back
#define mp make_pair
#define s second
#define f first
#define clr(i, j)   memset(i, j, sizeof i)
#define opt     ios_base::sync_with_stdio(NULL);cin.tie(NULL);cout.tie(NULL);
using namespace std;
typedef  long long ll;
typedef unsigned long long ull ;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef pair<int, pii> piii;
typedef pair<ll, ll> pll;
const ll mod = 1e9+9;
//=================================
ll power(ll x, ll y)
{
    if(y == 0)
        return 1;
    if(y == 1)
        return x;
    ll temp = power(x, y/2)%mod;
    temp *= temp;
    temp %= mod;
    if(y%2 == 1)
        temp *= x;
    return temp % mod;
}
int main()
{
    opt;
    ll n, a, b, k, ans = 0;
    cin >> n >> a >> b >> k;
    n++;
    string s;
    cin >> s;
    ll term = 0;
    for(int i=0; i<k; i++)
    {
        ll co = (s[i]=='+')? 1 : -1;
        term += (co * ((power(a, k-1-i) * power(b, i)))%mod)%mod;
        //cout << (co * ((power(a, k-1-i) * power(b, i)))%mod)%mod << endl;
        term %= mod;
    }
    for(int i=0; i<n/k; i++)
    {
        ll co = (power(a, (n-k) - (i*k)) * power(b, i*k))%mod;
        //cout << co << endl;
        ans += (term * co)%mod;
        ans %= mod;
    }
    while(ans < 0)
        ans += mod;
    cout << ans << endl;
}


#include <bits/stdc++.h>

#define fr first
#define sc second
#define OK puts("OK");
#define pb push_back
#define mk make_pair
#define int long long

using namespace std;

const int inf = (int)1e9 + 9;
const int N = (int)2e5 + 7;

int n,a,b,k;
int sum,r;
int ans;

string s;

int binpow (int a,int b) {
      int res = 1;
      while (b) {
            if (b & 1)
                  res *= a;
            a *= a;
            b /= 2ll;

            a %= inf;
            res %= inf;
      }
      return (res % inf);
}
int f (int x) {
      if (x == 0)
            return 1;
      return ((binpow(b,x) * (binpow(binpow(a,x),inf - 2))) % inf);
}
main () {
      cin >> n >> a >> b >> k;
      cin >> s;

      for (int i = 0; i <= (int)(n / k); i ++) {
            sum += f(k * i);
            sum %= inf;
      }
      r = binpow(a,n);

      for (int i = 0; i < s.size(); i ++) {
            if (s[i] == '-') {
                  ans -= ((f(i) * r) % inf * sum) % inf;
                  if (ans < 0)
                        ans += inf;
            }
            else {
                  ans += ((f(i) * r) % inf * sum) % inf;
                  ans %= inf;
            }
      }
      cout << ans << endl;
}


#include <bits/stdc++.h>

#define fr first
#define sc second
#define OK puts("OK");
#define pb push_back
#define mk make_pair
#define int long long

using namespace std;

const int inf = (int)1e9 + 9;
const int N = (int)2e5 + 7;

int n,a,b,k;
int sum,r;
int ans;
int aa,bb,cc;

string s;

int binpow (int a,int b) {
      int res = 1;
      while (b) {
            if (b & 1)
                  res *= a;
            a *= a;
            b /= 2ll;

            a %= inf;
            res %= inf;
      }
      return (res % inf);
}
int f (int x) {
      if (x == 0) return 1;
      return ((binpow(b,x) * (binpow(binpow(a,x),inf - 2))) % inf);
}
main () {
      scanf ("%I64d%I64d%I64d%I64d", &n,&a,&b,&k);
      cin >> s;

      bb = (n / k);

      cc = ((binpow(max(a,b),k * (bb + 1)) + inf - binpow(min(a,b),k * (bb + 1))) % inf * binpow(a,k)) % inf;
      sum = (binpow(a,k * (bb + 1)) * ((binpow(max(a,b),k) + inf - binpow(min(a,b),k)) % inf)) % inf;
      sum = (cc * binpow(sum,inf - 2)) % inf;

      aa = binpow(a,k);
      cc = binpow(b,k);

      r = binpow(a,n);

      if (aa == cc) {

            bb ++;
            for (int i = 0; i < s.size(); i ++) {
                  if (s[i] == '-') {
                        ans -= (((r * f(i)) % inf) * bb) % inf;
                        if (ans < 0)
                              ans += inf;
                  }
                  else {
                        ans += (((r * f(i)) % inf) * bb) % inf;
                        ans %= inf;
                  }
            }
            cout << ans << endl;
            return 0;
      }
      for (int i = 0; i < s.size(); i ++) {
            if (s[i] == '-') {
                  ans -= (((f(i) * r) % inf * sum) % inf);
                  if (ans < 0)
                        ans += inf;
            }
            else {
                  ans += (((f(i) * r) % inf * sum) % inf);
                  ans %= inf;
            }
      }
      cout << ans << endl;
}


#include <bits/stdc++.h>

#define fr first
#define sc second
#define OK puts("OK");
#define pb push_back
#define mk make_pair
#define int long long

using namespace std;

const int inf = (int)1e9 + 9;
const int N = (int)2e5 + 7;

int n,a,b,k;
int sum,r;
int ans;
int aa,bb,cc;

string s;

int binpow (int a,int b) {
      int res = 1;
      while (b) {
            if (b & 1)
                  res *= a;
            a *= a;
            b /= 2ll;

            a %= inf;
            res %= inf;
      }
      return (res % inf);
}
int f (int x) {
      if (x == 0) return 1;
      return ((binpow(b,x) * (binpow(binpow(a,x),inf - 2))) % inf);
}
main () {
      scanf ("%I64d%I64d%I64d%I64d", &n,&a,&b,&k);
      cin >> s;

      bb = (n / k);

      cc = ((binpow(max(a,b),k * (bb + 1)) + inf - binpow(min(a,b),k * (bb + 1))) % inf * binpow(a,k)) % inf;

      sum = (binpow(a,k * (bb + 1)) * ((binpow(max(a,b),k) + inf - binpow(min(a,b),k)) % inf)) % inf;

      sum = (cc * binpow(sum,inf - 2)) % inf;

      sum = max(sum,1ll);

      r = binpow(a,n);

      for (int i = 0; i < s.size(); i ++) {
            if (s[i] == '-') {
                  ans -= (((f(i) * r) % inf * sum) % inf);
                  if (ans < 0)
                        ans += inf;
            }
            else {
                  ans += (((f(i) * r) % inf * sum) % inf);
                  ans %= inf;
            }
      }
      cout << ans << endl;
}


#include <bits/stdc++.h>

#define fr first
#define sc second
#define OK puts("OK");
#define pb push_back
#define mk make_pair
#define int long long

using namespace std;

const int inf = (int)1e9 + 9;
const int N = (int)2e5 + 7;

int n,a,b,k;
int sum,r;
int ans;
int aa,bb,cc;

string s;

int binpow (int a,int b) {
      int res = 1;
      while (b) {
            if (b & 1)
                  res *= a;
            a *= a;
            b /= 2ll;

            a %= inf;
            res %= inf;
      }
      return (res % inf);
}
int f (int x) {
      if (x == 0) return 1;
      return ((binpow(b,x) * (binpow(binpow(a,x),inf - 2))) % inf);
}
main () {
      scanf ("%I64d%I64d%I64d%I64d", &n,&a,&b,&k);
      cin >> s;

      bb = (n / k);

      cc = ((binpow(binpow(a,k),(bb + 1)) - binpow(binpow(b,k),(bb + 1)) + inf) % inf * binpow(a,k)) % inf;

      sum = (binpow(binpow(a,k),(bb + 1)) * ((binpow(a,k) - binpow(b,k) + inf) % inf)) % inf;

      sum = (cc * binpow(sum,inf - 2)) % inf;

      r = binpow(a,n);

      for (int i = 0; i < s.size(); i ++) {
            if (s[i] == '-') {
                  ans -= (((f(i) * r) % inf * sum) % inf);
                  if (ans < 0)
                        ans += inf;
            }
            else {
                  ans += (((f(i) * r) % inf * sum) % inf);
                  ans %= inf;
            }
      }
      cout << ans << endl;
}


#include <bits/stdc++.h>

#define fr first
#define sc second
#define OK puts("OK");
#define pb push_back
#define mk make_pair
#define int long long

using namespace std;

const int inf = (int)1e9 + 9;
const int N = (int)2e5 + 7;

int n,a,b,k;
int sum,r;
int ans;
int aa,bb,cc;

string s;

int binpow (int a,int b) {
      int res = 1;
      while (b) {
            if (b & 1)
                  res *= a;
            a *= a;
            b /= 2ll;

            a %= inf;
            res %= inf;
      }
      return (res % inf);
}
int f (int x) {
      if (x == 0) return 1;
      return ((binpow(b,x) * (binpow(binpow(a,x),inf - 2))) % inf);
}
main () {
      scanf ("%I64d%I64d%I64d%I64d", &n,&a,&b,&k);
      cin >> s;

      bb = (n / k);

      cc = ((binpow(max(a,b),k * (bb + 1)) + inf - binpow(min(a,b),k * (bb + 1))) % inf * binpow(a,k)) % inf;
      sum = (binpow(a,k * (bb + 1)) * ((binpow(max(a,b),k) + inf - binpow(min(a,b),k)) % inf)) % inf;
      sum = (cc * binpow(sum,inf - 2)) % inf;

      aa = binpow(a,k);
      cc = binpow(b,k);

      r = binpow(a,n);

      if (aa == cc) {
            for (int i = 0; i < s.size(); i ++) {
                  if (s[i] == '-') {
                        ans -= r;
                        if (ans < 0)
                              ans += inf;
                  }
                  else {
                        ans += r;
                        ans %= inf;
                  }
            }
            bb = (n + 1) / k;
            cout << (ans * bb) % inf << endl;
            return 0;
      }

      for (int i = 0; i < s.size(); i ++) {
            if (s[i] == '-') {
                  ans -= (((f(i) * r) % inf * sum) % inf);
                  if (ans < 0)
                        ans += inf;
            }
            else {
                  ans += (((f(i) * r) % inf * sum) % inf);
                  ans %= inf;
            }
      }
      cout << ans << endl;
}


#include <bits/stdc++.h>

#define fr first
#define sc second
#define OK puts("OK");
#define pb push_back
#define mk make_pair
#define int long long

using namespace std;

const int inf = (int)1e9 + 9;
const int N = (int)2e5 + 7;

int n,a,b,k;
int sum,r;
int ans;
int aa,bb,cc;

string s;

int binpow (int a,int b) {
      int res = 1;
      while (b) {
            if (b & 1)
                  res *= a;
            a *= a;
            b /= 2ll;

            a %= inf;
            res %= inf;
      }
      return (res % inf);
}
int f (int x) {
      if (x == 0) return 1;
      return ((binpow(b,x) * (binpow(binpow(a,x),inf - 2))) % inf);
}
main () {
      scanf ("%I64d%I64d%I64d%I64d", &n,&a,&b,&k);
      cin >> s;

      bb = (n / k);

      cc = ((binpow(binpow(a,k),(bb + 1)) + inf - binpow(binpow(b,k),(bb + 1))) % inf * binpow(a,k)) % inf;

      sum = (binpow(binpow(a,k),(bb + 1)) * ((binpow(a,k) + inf - binpow(b,k)) % inf)) % inf;

      sum = (cc * binpow(sum,inf - 2)) % inf;

      r = binpow(a,n);

      for (int i = 0; i < s.size(); i ++) {
            if (s[i] == '-') {
                  ans -= ((f(i) * r) % inf * sum) % inf;
                  if (ans < 0)
                        ans += inf;
            }
            else {
                  ans += ((f(i) * r) % inf * sum) % inf;
                  ans %= inf;
            }
      }
      cout << ans << endl;
}


#include <bits/stdc++.h>

#define fr first
#define sc second
#define OK puts("OK");
#define pb push_back
#define mk make_pair
#define int long long

using namespace std;

const int inf = (int)1e9 + 9;
const int N = (int)2e5 + 7;

int n,a,b,k;
int sum,r;
int ans;
int aa,bb,cc;

string s;

int binpow (int a,int b) {
      int res = 1;
      while (b) {
            if (b & 1)
                  res *= a;
            a *= a;
            b /= 2ll;

            a %= inf;
            res %= inf;
      }
      return (res % inf);
}
int f (int x) {
      if (x == 0) return 1;
      return ((binpow(b,x) * (binpow(binpow(a,x),inf - 2))) % inf);
}
main () {
      scanf ("%I64d%I64d%I64d%I64d", &n,&a,&b,&k);
      cin >> s;

      bb = (n / k);

      cc = ((binpow(max(a,b),k * (bb + 1)) + inf - binpow(min(a,b),k * (bb + 1))) % inf * binpow(a,k)) % inf;
      sum = (binpow(a,k * (bb + 1)) * ((binpow(max(a,b),k) + inf - binpow(min(a,b),k)) % inf)) % inf;
      sum = (cc * binpow(sum,inf - 2)) % inf;

      aa = binpow(a,k);
      cc = binpow(b,k);

      if (aa == cc) {
            sum = binpow(a,k * bb);
            sum = binpow(sum,inf - 2) % inf;
      }
      r = binpow(a,n);

      for (int i = 0; i < s.size(); i ++) {
            if (s[i] == '-') {
                  ans -= (((f(i) * r) % inf * sum) % inf);
                  if (ans < 0)
                        ans += inf;
            }
            else {
                  ans += (((f(i) * r) % inf * sum) % inf);
                  ans %= inf;
            }
      }
      cout << ans << endl;
}


#include <bits/stdc++.h>

#define fr first
#define sc second
#define OK puts("OK");
#define pb push_back
#define mk make_pair
#define int long long

using namespace std;

const int inf = (int)1e9 + 9;
const int N = (int)2e5 + 7;

int n,a,b,k;
int sum,r;
int ans;
int aa,bb,cc;

string s;

int binpow (int a,int b) {
      int res = 1;
      while (b) {
            if (b & 1)
                  res *= a;
            a *= a;
            b /= 2ll;

            a %= inf;
            res %= inf;
      }
      return (res % inf);
}
int f (int x) {
      if (x == 0) return 1;
      return ((binpow(b,x) * (binpow(binpow(a,x),inf - 2))) % inf);
}
main () {
      scanf ("%I64d%I64d%I64d%I64d", &n,&a,&b,&k);
      cin >> s;

      bb = (n / k);

      cc = ((binpow(max(a,b),k * (bb + 1)) + inf - binpow(min(a,b),k * (bb + 1))) % inf * binpow(a,k)) % inf;
      sum = (binpow(a,k * (bb + 1)) * ((binpow(max(a,b),k) + inf - binpow(min(a,b),k)) % inf)) % inf;
      sum = (cc * binpow(sum,inf - 2)) % inf;

      aa = binpow(a,k);
      cc = binpow(b,k);

      r = binpow(a,n);

      if (aa == cc) {
            for (int i = 0; i < s.size(); i ++) {
                  if (s[i] == '-') {
                        ans -= (r * ((n - i) / k + 1)) % inf;
                        if (ans < 0)
                              ans += inf;
                  }
                  else {
                        ans += (r * ((n - i) / k + 1)) % inf;
                        ans %= inf;
                  }
            }
            cout << ans<< endl;
            return 0;
      }

      for (int i = 0; i < s.size(); i ++) {
            if (s[i] == '-') {
                  ans -= (((f(i) * r) % inf * sum) % inf);
                  if (ans < 0)
                        ans += inf;
            }
            else {
                  ans += (((f(i) * r) % inf * sum) % inf);
                  ans %= inf;
            }
      }
      cout << ans << endl;
}


#include <bits/stdc++.h>

#define fr first
#define sc second
#define OK puts("OK");
#define pb push_back
#define mk make_pair
#define int long long

using namespace std;

const int inf = (int)1e9 + 9;
const int N = (int)2e5 + 7;

int n,a,b,k;
int sum,r;
int ans;
int aa,bb,cc;

string s;

int binpow (int a,int b) {
      int res = 1;
      while (b) {
            if (b & 1)
                  res *= a;
            a *= a;
            b /= 2ll;

            a %= inf;
            res %= inf;
      }
      return (res % inf);
}
int f (int x) {
      if (x == 0) return 1;
      return ((binpow(b,x) * (binpow(binpow(a,x),inf - 2))) % inf);
}
main () {
      scanf ("%I64d%I64d%I64d%I64d", &n,&a,&b,&k);
      cin >> s;

      bb = (n / k);

      cc = ((binpow(max(a,b),k * (bb + 1)) + inf - binpow(min(a,b),k * (bb + 1))) % inf * binpow(a,k)) % inf;
      sum = (binpow(a,k * (bb + 1)) * ((binpow(max(a,b),k) + inf - binpow(min(a,b),k)) % inf)) % inf;
      sum = (cc * binpow(sum,inf - 2)) % inf;

      aa = binpow(a,k);
      cc = binpow(b,k);

      r = binpow(a,n);

      if (aa == cc) {
            sum = binpow(a,k * bb);
            sum = binpow(sum,inf - 2) % inf;

            for (int i = 0; i < s.size(); i ++) {
                  if (s[i] == '-') {
                        ans -= r;
                        if (ans < 0)
                              ans += inf;
                  }
                  else {
                        ans += r;
                        ans %= inf;
                  }
            }
            cout << ans << endl;
            return 0;
      }

      for (int i = 0; i < s.size(); i ++) {
            if (s[i] == '-') {
                  ans -= (((f(i) * r) % inf * sum) % inf);
                  if (ans < 0)
                        ans += inf;
            }
            else {
                  ans += (((f(i) * r) % inf * sum) % inf);
                  ans %= inf;
            }
      }
      cout << ans << endl;
}


#include <bits/stdc++.h>

#define fr first
#define sc second
#define OK puts("OK");
#define pb push_back
#define mk make_pair
#define int long long

using namespace std;

const int inf = (int)1e9 + 9;
const int N = (int)2e5 + 7;

int n,a,b,k;
int sum,r;
int ans;
int aa,bb,cc;

string s;

int binpow (int a,int b) {
      int res = 1;
      while (b) {
            if (b & 1)
                  res *= a;
            a *= a;
            b /= 2ll;

            a %= inf;
            res %= inf;
      }
      return (res % inf);
}
int f (int x) {
      if (x == 0) return 1;
      return ((binpow(b,x) * (binpow(binpow(a,x),inf - 2))) % inf);
}
main () {
      scanf ("%I64d%I64d%I64d%I64d", &n,&a,&b,&k);
      cin >> s;

      bb = (n / k);

      cc = ((binpow(a,k * (bb + 1)) + inf - binpow(b,k * (bb + 1))) % inf * binpow(a,k)) % inf;

      sum = (binpow(a,k * (bb + 1)) * ((binpow(a,k) + inf - binpow(b,k)) % inf)) % inf;

      sum = (cc * binpow(sum,inf - 2)) % inf;

      r = binpow(a,n);

      for (int i = 0; i < s.size(); i ++) {
            if (s[i] == '-') {
                  ans -= ((f(i) * r) % inf * sum) % inf;
                  if (ans < 0)
                        ans += inf;
            }
            else {
                  ans += ((f(i) * r) % inf * sum) % inf;
                  ans %= inf;
            }
      }
      cout << ans << endl;
}


#include <bits/stdc++.h>

#define fr first
#define sc second
#define OK puts("OK");
#define pb push_back
#define mk make_pair
#define int long long

using namespace std;

const int inf = (int)1e9 + 9;
const int N = (int)2e5 + 7;

int n,a,b,k;
int sum,r;
int ans;
int aa,bb,cc;

string s;

int binpow (int a,int b) {
      int res = 1;
      while (b) {
            if (b & 1)
                  res *= a;
            a *= a;
            b /= 2ll;

            a %= inf;
            res %= inf;
      }
      return (res % inf);
}
int f (int x) {
      if (x == 0) return 1;
      return ((binpow(b,x) * (binpow(binpow(a,x),inf - 2))) % inf);
}
main () {
      scanf ("%I64d%I64d%I64d%I64d", &n,&a,&b,&k);
      cin >> s;

      bb = (n / k);

      cc = ((binpow(max(a,b),k * (bb + 1)) + inf - binpow(min(a,b),k * (bb + 1))) % inf * binpow(a,k)) % inf;

      sum = (binpow(a,k * (bb + 1)) * ((binpow(max(a,b),k) + inf - binpow(min(a,b),k)) % inf)) % inf;

      sum = (cc * binpow(sum,inf - 2)) % inf;

      r = binpow(a,n);

      for (int i = 0; i < s.size(); i ++) {
            if (s[i] == '-') {
                  ans -= (((f(i) * r) % inf * sum) % inf);
                  if (ans < 0)
                        ans += inf;
            }
            else {
                  ans += (((f(i) * r) % inf * sum) % inf);
                  ans %= inf;
            }
      }
      cout << ans << endl;
}


#include <bits/stdc++.h>

#define fr first
#define sc second
#define OK puts("OK");
#define pb push_back
#define mk make_pair
#define int long long

using namespace std;

const int inf = (int)1e9 + 9;
const int N = (int)2e5 + 7;

int n,a,b,k;
int sum,r;
int ans;
int aa,bb,cc;

string s;

int binpow (int a,int b) {
      int res = 1;
      while (b) {
            if (b & 1)
                  res *= a;
            a *= a;
            b /= 2ll;

            a %= inf;
            res %= inf;
      }
      return (res % inf);
}
int f (int x) {
      if (x == 0) return 1;
      return ((binpow(b,x) * (binpow(binpow(a,x),inf - 2))) % inf);
}
main () {
      scanf ("%I64d%I64d%I64d%I64d", &n,&a,&b,&k);
      cin >> s;

      bb = (n / k);

      cc = ((binpow(max(a,b),k * (bb + 1)) + inf - binpow(min(a,b),k * (bb + 1))) % inf * binpow(a,k)) % inf;
      sum = (binpow(a,k * (bb + 1)) * ((binpow(max(a,b),k) + inf - binpow(min(a,b),k)) % inf)) % inf;
      sum = (cc * binpow(sum,inf - 2)) % inf;

      aa = binpow(a,k);
      cc = binpow(b,k);

      r = binpow(a,n);

      if (aa == cc) {

            for (int i = 0; i < s.size(); i ++) {
                  if (s[i] == '-') {
                        ans -= (((r * f(i)) % inf) * bb) % inf;
                        if (ans < 0)
                              ans += inf;
                  }
                  else {
                        ans += (((r * f(i)) % inf) * bb) % inf;
                        ans %= inf;
                  }
            }
            cout << ans << endl;
            return 0;
      }
      for (int i = 0; i < s.size(); i ++) {
            if (s[i] == '-') {
                  ans -= (((f(i) * r) % inf * sum) % inf);
                  if (ans < 0)
                        ans += inf;
            }
            else {
                  ans += (((f(i) * r) % inf * sum) % inf);
                  ans %= inf;
            }
      }
      cout << ans << endl;
}


#include <bits/stdc++.h>

#define fr first
#define sc second
#define OK puts("OK");
#define pb push_back
#define mk make_pair
#define int long long

using namespace std;

const int inf = (int)1e9 + 9;
const int N = (int)2e5 + 7;

int n,a,b,k;
int sum,r;
int ans;
int aa,bb,cc;

string s;

int binpow (int a,int b) {
      int res = 1;
      while (b) {
            if (b & 1)
                  res *= a;
            a *= a;
            b /= 2ll;

            a %= inf;
            res %= inf;
      }
      return (res % inf);
}
int f (int x) {
      if (x == 0) return 1;
      return ((binpow(b,x) * (binpow(binpow(a,x),inf - 2))) % inf);
}
main () {
      scanf ("%I64d%I64d%I64d%I64d", &n,&a,&b,&k);
      cin >> s;

      bb = (n / k);

      cc = ((binpow(max(a,b),k * (bb + 1)) + inf - binpow(min(a,b),k * (bb + 1))) % inf * binpow(a,k)) % inf;
      sum = (binpow(a,k * (bb + 1)) * ((binpow(max(a,b),k) + inf - binpow(min(a,b),k)) % inf)) % inf;
      sum = (cc * binpow(sum,inf - 2)) % inf;

      aa = binpow(a,k);
      cc = binpow(b,k);

      r = binpow(a,n);

      if (aa == cc) {
            for (int i = 0; i < s.size(); i ++) {
                  if (s[i] == '-') {
                        ans -= r;
                        if (ans < 0)
                              ans += inf;
                  }
                  else {
                        ans += r;
                        ans %= inf;
                  }
            }
            cout << (ans * bb) % inf << endl;
            return 0;
      }

      for (int i = 0; i < s.size(); i ++) {
            if (s[i] == '-') {
                  ans -= (((f(i) * r) % inf * sum) % inf);
                  if (ans < 0)
                        ans += inf;
            }
            else {
                  ans += (((f(i) * r) % inf * sum) % inf);
                  ans %= inf;
            }
      }
      cout << ans << endl;
}


#include <bits/stdc++.h>

#define fr first
#define sc second
#define OK puts("OK");
#define pb push_back
#define mk make_pair
#define int long long

using namespace std;

const int inf = (int)1e9 + 9;
const int N = (int)2e5 + 7;

int n,a,b,k;
int sum,r;
int ans;
int aa,bb,cc;

string s;

int binpow (int a,int b) {
      int res = 1;
      while (b) {
            if (b & 1)
                  res *= a;
            a *= a;
            b /= 2ll;

            a %= inf;
            res %= inf;
      }
      return (res % inf);
}
int f (int x) {
      if (x == 0) return 1;
      return ((binpow(b,x) * (binpow(binpow(a,x),inf - 2))) % inf);
}
main () {
      scanf ("%I64d%I64d%I64d%I64d", &n,&a,&b,&k);
      cin >> s;

      bb = (n / k);

      cc = ((binpow(max(a,b),k * (bb + 1)) + inf - binpow(min(a,b),k * (bb + 1))) % inf * binpow(a,k)) % inf;
      sum = (binpow(a,k * (bb + 1)) * ((binpow(max(a,b),k) + inf - binpow(min(a,b),k)) % inf)) % inf;
      sum = (cc * binpow(sum,inf - 2)) % inf;

      aa = binpow(a,k);
      cc = binpow(b,k);

      r = binpow(a,n);

      if (aa == cc) {
            for (int i = 0; i < s.size(); i ++) {
                  if (s[i] == '-') {
                        ans -= r;
                        if (ans < 0)
                              ans += inf;
                  }
                  else {
                        ans += r;
                        ans %= inf;
                  }
            }
            cout << (ans * (bb + 1)) % inf << endl;
            return 0;
      }

      for (int i = 0; i < s.size(); i ++) {
            if (s[i] == '-') {
                  ans -= (((f(i) * r) % inf * sum) % inf);
                  if (ans < 0)
                        ans += inf;
            }
            else {
                  ans += (((f(i) * r) % inf * sum) % inf);
                  ans %= inf;
            }
      }
      cout << ans << endl;
}


#include <bits/stdc++.h>

#define fr first
#define sc second
#define OK puts("OK");
#define pb push_back
#define mk make_pair
#define int long long

using namespace std;

const int inf = (int)1e9 + 9;
const int N = (int)2e5 + 7;

int n,a,b,k;
int sum,r;
int ans;
int aa,bb,cc;

string s;

int binpow (int a,int b) {
      int res = 1;
      while (b) {
            if (b & 1)
                  res *= a;
            a *= a;
            b /= 2ll;

            a %= inf;
            res %= inf;
      }
      return (res % inf);
}
int f (int x) {
      if (x == 0) return 1;
      return ((binpow(b,x) * (binpow(binpow(a,x),inf - 2))) % inf);
}
main () {
      scanf ("%I64d%I64d%I64d%I64d", &n,&a,&b,&k);
      cin >> s;

      bb = (n / k);

      cc = ((binpow(max(a,b),k * (bb + 1)) + inf - binpow(min(a,b),k * (bb + 1))) % inf * binpow(a,k)) % inf;
      sum = (binpow(a,k * (bb + 1)) * ((binpow(max(a,b),k) + inf - binpow(min(a,b),k)) % inf)) % inf;
      sum = (cc * binpow(sum,inf - 2)) % inf;

      aa = binpow(a,k);
      cc = binpow(b,k);

      r = binpow(a,n);

      if (aa == cc) {
            bb = (n + 1) / k;

            for (int i = 0; i < s.size(); i ++) {
                  if (s[i] == '-') {
                        ans -= (r * bb) % inf;
                        if (ans < 0)
                              ans += inf;
                  }
                  else {
                        ans += (r * bb) % inf;
                        ans %= inf;
                  }
            }
            cout << ans<< endl;
            return 0;
      }

      for (int i = 0; i < s.size(); i ++) {
            if (s[i] == '-') {
                  ans -= (((f(i) * r) % inf * sum) % inf);
                  if (ans < 0)
                        ans += inf;
            }
            else {
                  ans += (((f(i) * r) % inf * sum) % inf);
                  ans %= inf;
            }
      }
      cout << ans << endl;
}


#include <bits/stdc++.h>

#define mod 1000000009

long long power(long long x, long long y){
    long long res = 1;
    while (y > 0){
        if (y & 1){
            res = res*x;
            res %= mod;
        }
        y = y>>1;
        x = x*x;
        x %= mod;
    }
    return res;
}

int main(){
    long long n, a, b, k;
    scanf("%I64d %I64d %I64d %I64d", &n, &a, &b, &k);
    int s[k];
    char inter;
    scanf("%*c");
    for(int i = 0; i < k; i++){
        scanf("%c", &inter);
        if(inter == '+') s[i] = 1;
        else s[i] = -1;
    }
    long long A, B = 1, res = 0;
    for(int i = 0; i <= n; i++){
        A = power(a, n-i);
        res += (s[i%k]*A*B)%mod;
        res %= mod;
        B *= b;
        B %= mod;
    }
    if(res < 0) res += mod;
    printf("%I64d", res);
    return 0;
}


#include <bits/stdc++.h>

#define mod 1000000009

long long power(long long x, long long y){
    long long res = 1;
    while (y > 0){
        if (y & 1){
            res = res*x;
            res += mod;
            res %= mod;
        }
        y = y>>1;
        x = x*x;
        x += mod;
        x %= mod;
    }
    return res;
}

int main(){
    long long n, a, b, k;
    scanf("%I64d %I64d %I64d %I64d", &n, &a, &b, &k);
    int s[k];
    char inter;
    scanf("%*c");
    for(int i = 0; i < k; i++){
        scanf("%c", &inter);
        if(inter == '+') s[i] = 1;
        else s[i] = -1;
    }
    long long A, B = 1, res = 0;
    for(int i = 0; i < k; i++){
        A = power(a, n-i);
        res += (s[i%k]*A*B)%mod;
        res %= mod;
        B *= b;
        B %= mod;
    }
    if(k < n+1){
        if(res < 0) res += mod;
        res = res*((power(a, n+1) - power(b, n+1)+mod)%mod);
        res %= mod;
        long long inv = power(a, (n+1-k)*(mod-2));
        long long dif = (power(a,k) - power(b,k)+mod)%mod;
        inv = inv * power(dif, mod-2);
        inv %= mod;
        /*
        long long nor = power(a, n)*(a-b);
        nor += mod;
        nor %= mod;
        */
        res *= inv;
        res %= mod;
    }
    printf("%I64d", res);
    return 0;
}


#include <bits/stdc++.h>

#define mod 1000000009

long long power(long long x, long long y){
    long long res = 1;
    while (y > 0){
        if (y & 1){
            res = res*x;
            res %= mod;
        }
        y = y>>1;
        x = x*x;
        x %= mod;
    }
    return res;
}

int main(){
    long long n, a, b, k;
    scanf("%I64d %I64d %I64d %I64d", &n, &a, &b, &k);
    int s[k];
    char inter;
    scanf("%*c");
    for(int i = 0; i < k; i++){
        scanf("%c", &inter);
        if(inter == '+') s[i] = 1;
        else s[i] = -1;
    }
    long long A, B = 1, res = 0;
    for(int i = 0; i <= n; i++){
        A = power(a, n-i);
        res += (s[i%k]*A*B)%mod;
        B *= b;
        B %= mod;
    }
    if(res < 0) res += mod;
    printf("%I64d", res);
    return 0;
}


#include <bits/stdc++.h>

#define mod 1000000009

long long power(long long x, long long y){
    long long res = 1;
    while (y > 0){
        if (y & 1){
            res = res*x;
            res += mod;
            res %= mod;
        }
        y = y>>1;
        x = x*x;
        x += mod;
        x %= mod;
    }
    return res;
}

int main(){
    long long n, a, b, k;
    scanf("%I64d %I64d %I64d %I64d", &n, &a, &b, &k);
    int s[k];
    char inter;
    scanf("%*c");
    for(int i = 0; i < k; i++){
        scanf("%c", &inter);
        if(inter == '+') s[i] = 1;
        else s[i] = -1;
    }
    long long A, B = 1, res = 0;
    for(int i = 0; i < k; i++){
        A = power(a, n-i);
        res += (s[i%k]*A*B)%mod;
        res %= mod;
        B *= b;
        B %= mod;
    }
    if(k < n+1){
        if(res < 0) res += mod;
        res = res*((power(a, n+1) - power(b, n+1)+mod)%mod);
        res %= mod;
        long long inv = power(a, (n+1-k)*(mod-2));
        long long dif = (power(a,k) - power(b,k)+mod)%mod;
        inv = inv * power(dif, mod-2);
        inv %= mod;
        /*
        long long nor = power(a, n)*(a-b);
        nor += mod;
        nor %= mod;
        */
        res *= inv;
        res %= mod;
        res = (res+mod)%mod;
    }
    printf("%I64d", res);
    return 0;
}


#include <bits/stdc++.h>

#define mod 1000000009

long long power(long long x, long long y){
    long long res = 1;
    while (y > 0){
        if (y & 1){
            res = res*x;
            res += mod;
            res %= mod;
        }
        y = y>>1;
        x = x*x;
        x += mod;
        x %= mod;
    }
    return res;
}

int main(){
    long long n, a, b, k;
    scanf("%I64d %I64d %I64d %I64d", &n, &a, &b, &k);
    int s[k];
    char inter;
    scanf("%*c");
    for(int i = 0; i < k; i++){
        scanf("%c", &inter);
        if(inter == '+') s[i] = 1;
        else s[i] = -1;
    }
    long long A, B = 1, res = 0;
    for(int i = 0; i < k; i++){
        A = power(a, n-i);
        res += (s[i%k]*A*B)%mod;
        res %= mod;
        B *= b;
        B %= mod;
    }
    if(k < n+1){
        if(res < 0) res += mod;
        res = res*((power(a, n+1) - power(b, n+1)+mod)%mod);
        res %= mod;
        long long inv = power(a, (n+1-k)*(mod-2));
        long long dif = (power(a,k) - power(b,k)+mod)%mod;
        inv = inv * power(dif, mod-2);
        inv %= mod;
        res *= inv;
        res = res % mod;
        res = res + mod;
        res = res % mod;
    }
    printf("%I64d", res);
    return 0;
}


#include <bits/stdc++.h>

#define mod 1000000009

long long power(long long x, long long y){
    long long res = 1;
    while (y > 0){
        if (y & 1){
            res = res*x;
            res += mod;
            res %= mod;
        }
        y = y>>1;
        x = x*x;
        x += mod;
        x %= mod;
    }
    return res;
}

int main(){
    long long n, a, b, k;
    scanf("%I64d %I64d %I64d %I64d", &n, &a, &b, &k);
    int s[k];
    char inter;
    scanf("%*c");
    for(int i = 0; i < k; i++){
        scanf("%c", &inter);
        if(inter == '+') s[i] = 1;
        else s[i] = -1;
    }
    long long A, B = 1, res = 0;
    for(int i = 0; i < k; i++){
        A = power(a, n-i);
        res += (s[i%k]*A*B)%mod;
        res %= mod;
        B *= b;
        B %= mod;
    }
    if(k < n+1){
        if(res < 0) res += mod;
        res = res*((power(a, n+1) - power(b, n+1)+mod)%mod);
        res %= mod;
        long long inv = power(a, (n+1-k)*(mod-2));
        long long dif = (power(a,k) - power(b,k)+mod)%mod;
        inv = inv * power(dif, mod-2);
        inv %= mod;
        res *= inv;
        res %= mod;
        res += mod;
        res %= mod;
    }
    printf("%I64d", res);
    return 0;
}


#include <bits/stdc++.h>

#define mod 1000000009

long long power(long long x, long long y){
    long long res = 1;
    while (y > 0){
        if (y & 1){
            res = res*x;
            res %= mod;
        }
        y = y>>1;
        x = x*x;
        x %= mod;
    }
    return res;
}

int main(){
    long long n, a, b, k;
    scanf("%I64d %I64d %I64d %I64d", &n, &a, &b, &k);
    int s[k];
    char inter;
    scanf("%*c");
    for(int i = 0; i < k; i++){
        scanf("%c", &inter);
        if(inter == '+') s[i] = 1;
        else s[i] = -1;
    }
    long long A, B = 1, res = 0;
    for(int i = 0; i < k; i++){
        A = power(a, n-i);
        res += (s[i%k]*A*B)%mod;
        res %= mod;
        B *= b;
        B %= mod;
    }
    if(res < 0) res += mod;
    long long resAcum = res;
    long long inv = power(a, n*k-2*k);
    long long mul = power(b, k);
    for(int i = 1; (n+1) > i*k; i++){
        res *= mul;
        res %= mod;
        res *= inv;
        res %= mod;
        resAcum += res;
        resAcum %= mod;
    }
    printf("%I64d", resAcum);
    return 0;
}


#include <bits/stdc++.h>

#define mod 1000000009

long long power(long long x, long long y){
    long long res = 1;
    while (y > 0){
        if (y & 1){
            res = res*x;
            res += mod;
            res %= mod;
        }
        y = y>>1;
        x = x*x;
        x += mod;
        x %= mod;
    }
    return res;
}

int main(){
    long long n, a, b, k;
    scanf("%I64d %I64d %I64d %I64d", &n, &a, &b, &k);
    int s[k];
    char inter;
    scanf("%*c");
    for(int i = 0; i < k; i++){
        scanf("%c", &inter);
        if(inter == '+') s[i] = 1;
        else s[i] = -1;
    }
    long long A, B = 1, res = 0;
    for(int i = 0; i < k; i++){
        A = power(a, n-i);
        res += (s[i%k]*A*B)%mod;
        res %= mod;
        B *= b;
        B %= mod;
    }
    if(k < n+1){
        if(res < 0) res += mod;
        res = res*((power(a, n+1) - power(b, n+1)+mod)%mod);
        res %= mod;
        long long inv = power(a, n*(mod-2));
        inv = inv * power(a-b, mod-2);
        inv %= mod;
        long long nor = power(a, n)*(a-b);
        nor += mod;
        nor %= mod;
        res *= inv;
        res %= mod;
    }
    printf("%I64d", res);
    return 0;
}


#include <bits/stdc++.h>

#define mod 1000000009

long long power(long long x, long long y){
    long long res = 1;
    while (y > 0){
        if (y & 1){
            res = res*x;
            res += mod;
            res %= mod;
        }
        y = y>>1;
        x = x*x;
        x += mod;
        x %= mod;
    }
    return res;
}

int main(){
    long long n, a, b, k;
    scanf("%I64d %I64d %I64d %I64d", &n, &a, &b, &k);
    int s[k];
    char inter;
    scanf("%*c");
    for(int i = 0; i < k; i++){
        scanf("%c", &inter);
        if(inter == '+') s[i] = 1;
        else s[i] = -1;
    }
    long long A, B = 1, res = 0;
    for(int i = 0; i < k; i++){
        A = power(a, n-i);
        res += (s[i%k]*A*B)%mod;
        res %= mod;
        B *= b;
        B %= mod;
    }
    if(k < n+1){
        if(res < 0) res += mod;
        res = res*((power(a, ((n+1)/k)) - power(b, ((n+1)/k)))+mod);
        res %= mod;
        long long inv = power(a, ((n+1)*(mod-2))/k - (mod-2));
        inv = inv * power(a-b, mod-2);
        inv %= mod;
        /*
        long long nor = power(a, (n+1)/k - 1)*(a-b);
        nor += mod;
        nor %= mod;
        */
        res *= inv;
        res %= mod;
    }
    printf("%I64d", res);
    return 0;
}


#include <bits/stdc++.h>

#define mod 1000000009

long long power(long long x, long long y){
    long long res = 1;
    while (y > 0){
        if (y & 1){
            res = res*x;
            res += mod;
            res %= mod;
        }
        y = y>>1;
        x = x*x;
        x += mod;
        x %= mod;
    }
    return res;
}

int main(){
    long long n, a, b, k;
    scanf("%I64d %I64d %I64d %I64d", &n, &a, &b, &k);
    int s[k];
    char inter;
    scanf("%*c");
    for(int i = 0; i < k; i++){
        scanf("%c", &inter);
        if(inter == '+') s[i] = 1;
        else s[i] = -1;
    }
    long long A, B = 1, res = 0;
    for(int i = 0; i < k; i++){
        A = power(a, n-i);
        res += (s[i%k]*A*B)%mod;
        res %= mod;
        B *= b;
        B %= mod;
    }
    if(k < n+1){
        if(res < 0) res += mod;
        res = res*((power(a, n+1) - power(b, n+1)+mod)%mod);
        res %= mod;
        long long inv = power(a, (n+1-k)*(mod-2));
        long long dif = (power(a,k) - power(b,k)+mod)%mod;
        inv = inv * power(dif, mod-2);
        inv %= mod;
        res *= inv;
    }
    res = res % mod;
    res = res + mod;
    res = res % mod;
    printf("%I64d", res);
    return 0;
}


#include <bits/stdc++.h>

#define mod 1000000009

long long power(long long x, long long y){
    long long res = 1;
    while (y > 0){
        if (y & 1){
            res = res*x;
            res += mod;
            res %= mod;
        }
        y = y>>1;
        x = x*x;
        x += mod;
        x %= mod;
    }
    return res;
}

int main(){
    long long n, a, b, k;
    scanf("%I64d %I64d %I64d %I64d", &n, &a, &b, &k);
    int s[k];
    char inter;
    scanf("%*c");
    for(int i = 0; i < k; i++){
        scanf("%c", &inter);
        if(inter == '+') s[i] = 1;
        else s[i] = -1;
    }
    long long A, B = 1, res = 0;
    for(int i = 0; i < k; i++){
        A = power(a, n-i);
        res += (s[i%k]*A*B)%mod;
        res %= mod;
        B *= b;
        B %= mod;
    }
    if(k < n+1){
        if(res < 0) res += mod;
        res = res*((power(a, n+1) - power(b, n+1)+mod)%mod);
        res %= mod;
        long long inv = power(a, (n+1-k)*(mod-2));
        long long dif = (power(a,k) - power(b,k)+mod)%mod;
        inv = inv * power(dif, mod-2);
        inv %= mod;
        res *= inv;
        if(n != 813){
            res = res % mod;
            res = res + mod;
            res = res % mod;
        }
        else{
            printf("%I64d\n", res);
            res = res % mod;
            printf("%I64d\n", res);
            res = res + mod;
            printf("%I64d\n", res);
            res = res % mod;
            printf("%I64d\n", res);
        }
    }
    printf("%I64d", res);
    return 0;
}


#include <bits/stdc++.h>

#define mod 1000000009

long long power(long long x, long long y){
    long long res = 1;
    while (y > 0){
        if (y & 1){
            res = res*x;
            res += mod;
            res %= mod;
        }
        y = y>>1;
        x = x*x;
        x += mod;
        x %= mod;
    }
    return res;
}

int main(){
    long long n, a, b, k;
    scanf("%I64d %I64d %I64d %I64d", &n, &a, &b, &k);
    int s[k];
    char inter;
    scanf("%*c");
    for(int i = 0; i < k; i++){
        scanf("%c", &inter);
        if(inter == '+') s[i] = 1;
        else s[i] = -1;
    }
    long long A, B = 1, res = 0;
    for(int i = 0; i < k; i++){
        A = power(a, n-i);
        res += (s[i%k]*A*B)%mod;
        res %= mod;
        B *= b;
        B %= mod;
    }
    if(k < n+1){
        if(res < 0) res += mod;
        res = res*((power(a, n+1) - power(b, n+1)+mod)%mod);
        res %= mod;
        long long inv = power(a, (n+1-k)*(mod-2));
        long long dif = (power(a,k) - power(b,k)+mod)%mod;
        inv = inv * power(dif, mod-2);
        inv %= mod;
        res *= inv;
        if(n != 813){
            res = res % mod;
            res = res + mod;
            res = res % mod;
        }
        else{
            printf("%I64dA", res);
            res = res % mod;
            printf("%I64dA", res);
            res = res + mod;
            printf("%I64dA", res);
            res = res % mod;
            printf("%I64d", res);
        }
    }
    res = 10;
    printf("%I64d", res);
    return 0;
}


#include <bits/stdc++.h>

#define mod 1000000009

long long power(long long x, long long y){
    long long res = 1;
    while (y > 0){
        if (y & 1){
            res = res*x;
            res += mod;
            res %= mod;
        }
        y = y>>1;
        x = x*x;
        x += mod;
        x %= mod;
    }
    return res;
}

int main(){
    long long n, a, b, k;
    scanf("%I64d %I64d %I64d %I64d", &n, &a, &b, &k);
    int s[k];
    char inter;
    scanf("%*c");
    for(int i = 0; i < k; i++){
        scanf("%c", &inter);
        if(inter == '+') s[i] = 1;
        else s[i] = -1;
    }
    long long A, B = 1, res = 0;
    for(int i = 0; i < k; i++){
        A = power(a, n-i);
        res += (s[i%k]*A*B)%mod;
        res %= mod;
        B *= b;
        B %= mod;
    }
    if(k < n+1){
        if(res < 0) res += mod;
        res = res*((power(a, n+1) - power(b, n+1)+mod)%mod);
        res %= mod;
        long long inv = power(a, (n+1-k)*(mod-2));
        long long dif = (power(a,k) - power(b,k)+mod)%mod;
        inv = inv * power(dif, mod-2);
        inv %= mod;
        /*
        long long nor = power(a, n)*(a-b);
        nor += mod;
        nor %= mod;
        */
        res *= inv;
        res %= mod;
        res += mod;
        res %= mod;
    }
    printf("%I64d", res);
    return 0;
}


#include <bits/stdc++.h>

#define mod 1000000009

long long power(long long x, long long y){
    long long res = 1;
    while (y > 0){
        if (y & 1){
            res = res*x;
            res += mod;
            res %= mod;
        }
        y = y>>1;
        x = x*x;
        x += mod;
        x %= mod;
    }
    return res;
}

int main(){
    long long n, a, b, k;
    scanf("%I64d %I64d %I64d %I64d", &n, &a, &b, &k);
    int s[k];
    char inter;
    scanf("%*c");
    for(int i = 0; i < k; i++){
        scanf("%c", &inter);
        if(inter == '+') s[i] = 1;
        else s[i] = -1;
    }
    long long A, B = 1, res = 0;
    for(int i = 0; i < k; i++){
        A = power(a, n-i);
        res += (s[i%k]*A*B)%mod;
        res %= mod;
        B *= b;
        B %= mod;
    }
    if(k < n+1){
        if(res < 0) res += mod;
        res = res*((power(a, n+1) - power(b, n+1)+mod)%mod);
        res %= mod;
        long long inv = power(a, (n+1-k)*(mod-2));
        long long dif = (power(a,k) - power(b,k)+mod)%mod;
        inv = inv * power(dif, mod-2);
        inv %= mod;
        res *= inv;
        if(n != 813){
            res = res % mod;
            res = res + mod;
            res = res % mod;
        }
        else{
            res = res % mod;
            res = res + mod;
            res = res % mod;
            printf("%I64d", res);
            return 0;
        }
    }
    printf("%I64d", res);
    return 0;
}


#include <bits/stdc++.h>

#define mod 1000000009

long long power(long long x, long long y){
    long long res = 1;
    while (y > 0){
        if (y & 1){
            res = res*x;
            res += mod;
            res %= mod;
        }
        y = y>>1;
        x = x*x;
        x += mod;
        x %= mod;
    }
    return res;
}

int main(){
    long long n, a, b, k;
    scanf("%I64d %I64d %I64d %I64d", &n, &a, &b, &k);
    int s[k];
    char inter;
    scanf("%*c");
    for(int i = 0; i < k; i++){
        scanf("%c", &inter);
        if(inter == '+') s[i] = 1;
        else s[i] = -1;
    }
    long long A, B = 1, res = 0;
    for(int i = 0; i < k; i++){
        A = power(a, n-i);
        res += (s[i%k]*A*B)%mod;
        res %= mod;
        B *= b;
        B %= mod;
    }
    if(k < n+1){
        if(res < 0) res += mod;
        res = res*((power(a, n+1) - power(b, n+1)+mod)%mod);
        res %= mod;
        long long inv = power(a, (n+1-k)*(mod-2));
        long long dif = (power(a,k) - power(b,k)+mod)%mod;
        inv = inv * power(dif, mod-2);
        inv %= mod;
        res *= inv;
        if(n != 813){
            res = res % mod;
            res = res + mod;
            res = res % mod;
        }
        else{
            printf("%I64d\n", res);
            res = res % mod;
            printf("%I64d\n", res);
            res = res + mod;
            printf("%I64d\n", res);
            res = res % mod;
            printf("%I64d\n", res);
        }
    }
    res = 10;
    printf("%I64d", res);
    return 0;
}


#include <bits/stdc++.h>

#define mod 1000000009

long long power(long long x, long long y){
    long long res = 1;
    while (y > 0){
        if (y & 1){
            res = res*x;
            res %= mod;
        }
        y = y>>1;
        x = x*x;
        x %= mod;
    }
    return res;
}

int main(){
    long long n, a, b, k;
    scanf("%I64d %I64d %I64d %I64d", &n, &a, &b, &k);
    int s[k];
    char inter;
    scanf("%*c");
    for(int i = 0; i < k; i++){
        scanf("%c", &inter);
        if(inter == '+') s[i] = 1;
        else s[i] = -1;
    }
    long long A, B = 1, res = 0;
    for(int i = 0; i < k; i++){
        A = power(a, n-i);
        res += (s[i%k]*A*B)%mod;
        res %= mod;
        B *= b;
        B %= mod;
    }
    if(res < 0) res += mod;
    long long resAcum = res;
    long long inv = power(a, mod*k-2*k);
    long long mul = power(b, k);
    for(int i = 1; (n+1) > i*k; i++){
        res *= mul;
        res %= mod;
        res *= inv;
        res %= mod;
        resAcum += res;
        resAcum %= mod;
    }
    printf("%I64d", resAcum);
    return 0;
}


#include <bits/stdc++.h>

#define mod 1000000009

long long power(long long x, long long y){
    long long res = 1;
    while (y > 0){
        if (y & 1){
            res = res*x;
            res += mod;
            res %= mod;
        }
        y = y>>1;
        x = x*x;
        x += mod;
        x %= mod;
    }
    return res;
}

int main(){
    long long n, a, b, k;
    scanf("%I64d %I64d %I64d %I64d", &n, &a, &b, &k);
    int s[k];
    char inter;
    scanf("%*c");
    for(int i = 0; i < k; i++){
        scanf("%c", &inter);
        if(inter == '+') s[i] = 1;
        else s[i] = -1;
    }
    long long A, B = 1, res = 0;
    for(int i = 0; i < k; i++){
        A = power(a, n-i);
        res += (s[i%k]*A*B)%mod;
        res %= mod;
        B *= b;
        B %= mod;
    }
    if(k < n+1){
        if(res < 0) res += mod;
        res = res*((power(a, n+1) - power(b, n+1)+mod)%mod);
        res %= mod;
        long long inv = power(a, (n+1-k)*(mod-2));
        long long dif = (power(a,k) - power(b,k)+mod)%mod;
        inv = inv * power(dif, mod-2);
        inv %= mod;
        res *= inv;
        if(n != 813){
            res = res % mod;
            res = res + mod;
            res = res % mod;
        }
        else{
            printf("%I64dA", res);
            res = res % mod;
            printf("%I64dA", res);
            res = res + mod;
            printf("%I64dA", res);
            res = res % mod;
            printf("%I64d", res);
        }
    }
    printf("%I64d", res);
    return 0;
}


#include <bits/stdc++.h>

#define mod 1000000009

long long power(long long x, long long y){
    long long res = 1;
    while (y > 0){
        if (y & 1){
            res = res*x;
            res += mod;
            res %= mod;
        }
        y = y>>1;
        x = x*x;
        x += mod;
        x %= mod;
    }
    return res;
}

int main(){
    long long n, a, b, k;
    scanf("%I64d %I64d %I64d %I64d", &n, &a, &b, &k);
    int s[k];
    char inter;
    scanf("%*c");
    long long A, B = 1, res = 0;
    for(int i = 0; i < k; i++){
        scanf("%c", &inter);
        if(inter == '+') s[i] = 1;
        else s[i] = -1;
        A = power(a, n-i);
        res += (s[i]*A*B)%mod;
        res %= mod;
        B *= b;
        B %= mod;
    }
    if(res < 0) res += mod;
    if(k < n+1){
        if(power(a, k) != power(b, k)){
            res = res*((power(a, n+1) - power(b, n+1)+mod)%mod);
            res %= mod;
            long long inv = power(a, (n+1-k)*(mod-2));
            long long dif = (power(a,k) - power(b,k)+mod)%mod;
            inv = inv * power(dif, mod-2);
            inv %= mod;
            res *= inv;
        }
        else{
            res *= (n+1)/k;
        }
    }
    res = res % mod;
    res = res + mod;
    res = res % mod;
    printf("%I64d", res);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long n,a,b,k,i,j,s,t,ans,q,v;
long long c[100010],d[100010];
char ch;
long long ksm(long long x,long long y)
{
        long long temp=1;
        x=x%q;
        while (y>0)
        {
                if (y%2==1) temp=temp*x%q;
                x=x*x%q;
                y=y/2;
        }
        return temp;
}
int main()
{
        q=1000000009;
        scanf("%I64d%I64d%I64d%I64d",&n,&a,&b,&k);
        n++;
        for (i=1;i<=k;i++)
        {
                ch=getchar();
                while (ch!='+'&&ch!='-') ch=getchar();
                if (ch=='+') c[i]=1; else c[i]=q-1;
        }
        ans=0;
        d[1]=ksm(a,n-1);
        t=b*ksm(a,q-2)%q;
        for (i=2;i<=k;i++)
        {
                d[i]=d[i-1]*t%q;
        }
        s=0;
        for (i=1;i<=k;i++)
        {
                d[i]=d[i]*c[i]%q;
                s=(s+d[i])%q;
        }
        t=ksm(t,k);
        v=n/k;
        ans=s*(ksm(t,v)-1)%q;
        ans=ans*ksm(t-1,q-2)%q;
        while (ans<0) ans+=q;
        cout<<ans<<endl;
}


#include<bits/stdc++.h>
using namespace std;
long long n,a,b,k,i,j,s,t,ans,q,v;
long long c[100010],d[100010];
char ch;
long long ksm(long long x,long long y)
{
        long long temp=1;
        while (y>0)
        {
                if (y%2==1) temp=temp*x%q;
                x=x*x%q;
                y=y/2;
        }
        return temp;
}
int main()
{
        q=1e9+9;
        cin>>n>>a>>b>>k;
        n++;
        ch=getchar();
        if (n<k) k=n;
        for (i=1;i<=k;i++)
        {
                ch=getchar();
                if (ch=='+') c[i]=1; else c[i]=-1;
        }
        ans=0;
        d[1]=ksm(a,n-1);
        t=b*ksm(a,q-2)%q;
        for (i=2;i<=k;i++)
        {
                d[i]=d[i-1]*t%q;
        }
        s=0;
        for (i=1;i<=k;i++)
        {
                d[i]=d[i]*c[i]%q;
                s=(s+d[i])%q;
        }
        t=ksm(t,k);
        v=n/k;
        ans=s*(ksm(t,v)-1)%q;
        ans=ans*ksm(t-1,q-2)%q;
        v=n%k;
        t=ksm(t,v);
        for (i=1;i<=v;i++)
        {
                d[i]=d[i]*t%q;
                ans=(ans+d[i])%q;
        }
        while (ans<0) ans+=q;
        cout<<ans<<endl;
}


#include<bits/stdc++.h>
using namespace std;
long long n,a,b,k,i,j,s,t,ans,q,v;
long long c[100010],d[100010];
char ch;
long long ksm(long long x,long long y)
{
        long long temp=1;
        while (y>0)
        {
                if (y%2==1) temp=temp*x%q;
                x=x*x%q;
                y=y/2;
        }
        return temp;
}
int main()
{
        q=1e9+9;
        cin>>n>>a>>b>>k;
        n++;
        ch=getchar();
        if (n<k) k=n;
        for (i=1;i<=k;i++)
        {
                ch=getchar();
                if (ch=='+') c[i]=1; else c[i]=-1;
        }
        ans=0;
        d[1]=ksm(a,n-1);
        t=b*ksm(a,q-2)%q;
        for (i=2;i<=k;i++)
        {
                d[i]=d[i-1]*t%q;
        }
        s=0;
        for (i=1;i<=k;i++)
        {
                d[i]=d[i]*c[i]%q;
                s=(s+d[i])%q;
        }
        t=ksm(t,k);
        v=n/k;
        ans=s*(ksm(t,v)-1)%q;
        ans=ans*ksm(t-1,q-2)%q;
        t=ksm(t,v);
        for (i=1;i<=n%k;i++)
        {
                d[i]=d[i]*t%q;
                ans=(ans+d[i])%q;
        }
        while (ans<0) ans+=q;
        cout<<ans<<endl;
}


#include<bits/stdc++.h>
using namespace std;
long long n,a,b,k,i,j,s,t,ans,q,v;
long long c[100010],d[100010];
char ch;
long long ksm(long long x,long long y)
{
        long long temp=1;
        while (y>0)
        {
                if (y%2==1) temp=temp*x%q;
                x=x*x%q;
                y=y/2;
        }
        return temp;
}
int main()
{
        q=1e9+9;
        cin>>n>>a>>b>>k;
        n++;
        ch=getchar();
        if (n<k) k=n;
        for (i=1;i<=k;i++)
        {
                ch=getchar();
                if (ch=='+') c[i]=1; else c[i]=-1;
        }
        ans=0;
        d[1]=ksm(a,n-1);
        t=b*ksm(a,q-2)%q;
        for (i=2;i<=k;i++)
        {
                d[i]=d[i-1]*t%q;
        }
        s=0;
        for (i=1;i<=k;i++)
        {
                d[i]=d[i]*c[i]%q;
                while (d[i]<0) d[i]+=q;
                s=(s+d[i])%q;
        }
        t=ksm(t,k);
        v=n/k;
        ans=s*(ksm(t,v)-1)%q;
        ans=ans*ksm(t-1,q-2)%q;
        t=ksm(t,v);
        for (i=1;i<=n%k;i++)
        {
                d[i]=d[i]*t%q;
                ans=(ans+d[i])%q;
        }
        while (ans<0) ans+=q;
        cout<<ans<<endl;
}


#include<bits/stdc++.h>
using namespace std;
long long n,a,b,k,i,j,s,t,ans,q,v;
long long c[100010],d[100010];
char ch;
long long ksm(long long x,long long y)
{
        long long temp=1;
        while (y>0)
        {
                if (y%2==1) temp=temp*x%q;
                x=x*x%q;
                y=y/2;
        }
        return temp;
}
int main()
{
        q=1e9+9;
        cin>>n>>a>>b>>k;
        n++;
        ch=getchar();
        if (n<k) k=n;
        for (i=1;i<=k;i++)
        {
                ch=getchar();
                if (ch=='+') c[i]=1; else c[i]=q-1;
        }
        ans=0;
        d[1]=ksm(a,n-1);
        t=b*ksm(a,q-2)%q;
        for (i=2;i<=k;i++)
        {
                d[i]=d[i-1]*t%q;
        }
        s=0;
        for (i=1;i<=k;i++)
        {
                d[i]=d[i]*c[i]%q;
                while (d[i]<0) d[i]+=q;
                s=(s+d[i])%q;
        }
        t=ksm(t,k);
        v=n/k;
        ans=s*(ksm(t,v)-1)%q;
        ans=ans*ksm(t-1,q-2)%q;
        while (ans<0) ans+=q;
        cout<<ans<<endl;
}


#include<bits/stdc++.h>
using namespace std;
long long n,a,b,k,i,j,s,t,ans,q,v;
long long c[100010],d[100010];
char ch;
long long ksm(long long x,long long y)
{
        long long temp=1;
        x=x%q;
        while (y>0)
        {
                if (y%2==1) temp=temp*x%q;
                x=x*x%q;
                y=y/2;
        }
        return temp;
}
int main()
{
        q=1000000009;
        scanf("%I64d%I64d%I64d%I64d",&n,&a,&b,&k);
        n++;
        for (i=1;i<=k;i++)
        {
                ch=getchar();
                while (ch!='+'&&ch!='-') ch=getchar();
                if (ch=='+') c[i]=1; else c[i]=q-1;
        }
        ans=0;
        d[1]=ksm(a,n-1);
        t=b*ksm(a,q-2)%q;
        for (i=2;i<=k;i++)
        {
                d[i]=d[i-1]*t%q;
        }
        s=0;
        for (i=1;i<=k;i++)
        {
                d[i]=d[i]*c[i]%q;
                s=(s+d[i])%q;
        }
        t=ksm(t,k);
        v=n/k;
        if (t!=1)
        {
                ans=s*(ksm(t,v)-1)%q;
                ans=ans*ksm(t-1,q-2)%q;
        }
        else ans=s*v%q;
        while (ans<0) ans+=q;
        cout<<ans<<endl;
}


#include<bits/stdc++.h>
using namespace std;
long long n,a,b,k,i,j,s,t,ans,q,v;
long long c[100010],d[100010];
char ch;
long long ksm(long long x,long long y)
{
        long long temp=1;
        while (y>0)
        {
                if (y%2==1) temp=temp*x%q;
                x=x*x%q;
                y=y/2;
        }
        return temp;
}
int main()
{
        q=1e9+9;
        cin>>n>>a>>b>>k;
        n++;
        ch=getchar();
        if (n<k) k=n;
        for (i=1;i<=k;i++)
        {
                ch=getchar();
                if (ch=='+') c[i]=1; else c[i]=-1;
        }
        ans=0;
        d[1]=ksm(a,n-1);
        t=b*ksm(a,q-2)%q;
        for (i=2;i<=k;i++)
        {
                d[i]=d[i-1]*t%q;
        }
        s=0;
        for (i=1;i<=k;i++)
        {
                d[i]=d[i]*c[i]%q;
                s=(s+d[i])%q;
        }
        t=ksm(t,k);
        v=n/k;
        ans=s*(ksm(t,v)-1)%q;
        ans=ans*ksm(t-1,q-2)%q;
        v=n%k;
        for (i=1;i<=v;i++)
        {
                d[i]=c[i]*d[i]*ksm(t,v)%q;
                ans=(ans+d[i])%q;
        }
        while (ans<0) ans+=q;
        cout<<ans<<endl;
}


#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <string>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <vector>
#include <functional>
#include <ctime>
#include <cstdlib>
#include <sstream>
#include <set>
#include <deque>
#define MOD 1000000009
using namespace std;
char s[1000005];
long long n,k;
long long tot,a,b,x,y,t;
long long work(long long a,int x)
{
	long long sum=1;
	while (x)
	{
		if (x%2) sum=(sum*a)%MOD;
		a=(a*a)%MOD;
		x/=2;
	}
	return sum;
}
void exgcd(long long a,long long b)
{
	if (b==0)
	{
		x=tot;
		y=0;
		return;
	}
	else
	exgcd(b,a%b);
	t=x;
	x=y;
	y=t-(a/b)*y;
}
int main()
{
	//freopen("a.in","r",stdin);
	scanf("%lld%lld%lld%lld",&n,&a,&b,&k);
	scanf("%s",s);
	tot=0;
	for (int i=0;i<k;i++)
	{
		long long ss=1;
		long long t=(work(a,n-i)%MOD*work(b,i)%MOD)%MOD;
		if (s[i]=='-') ss=-1;
		tot=(tot+ss*t)%MOD;
		while (tot<0) tot+=MOD;
	}
	long long m=(n+1)/k;
	long long tott=(tot*work(work(a,m-1)%MOD,MOD-2)%MOD)*work(b,m-1)%MOD;

	if (a==b) tot=(tot*m)%MOD,x=1;
	else
	{
		tot=(tott*b-tot*a)/(b-a);
		while (tot<0) tot+=MOD;
	exgcd(tot,MOD);
	while (x<0) x+=MOD;
}
	printf("%lld",(tot*x)%MOD);
}


#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <string>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <vector>
#include <functional>
#include <ctime>
#include <cstdlib>
#include <sstream>
#include <set>
#include <deque>
#define MOD 1000000009
using namespace std;
char s[1000005];
long long n,k;
long long tot,a,b,x,y,t;
long long work(long long a,long long x)
{
	long long sum=1;
	while (x)
	{
		if (x%2) sum=(sum*a)%MOD;
		a=(a*a)%MOD;
		x/=2;
	}
	return sum;
}
int main()
{
	//freopen("a.in","r",stdin);
	scanf("%lld%lld%lld%lld",&n,&a,&b,&k);
	scanf("%s",s);
	tot=0;
	for (int i=0;i<k;i++)
	{
		long long ss=1;
		long long t=(work(a,n-i)*work(b,i))%MOD;
		if (s[i]=='-') ss=-1;
		tot=(tot+ss*t)%MOD;while (tot<0) tot+=MOD;

	}
	long long m=(n+1)/k;

	if (a==b) tot=(tot*m)%MOD;
	else
	{
tot=tot*a%MOD;
		tot=(tot*work(b,m)%MOD-tot*work(a,m)%MOD);tot=tot*work(b-a,MOD-2)%MOD*work(work(a,m),MOD-2)%MOD;
		while (tot<0) tot+=MOD;
}
	printf("%lld",(tot)%MOD);
}


#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <string>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <vector>
#include <functional>
#include <ctime>
#include <cstdlib>
#include <sstream>
#include <set>
#include <deque>
#define MOD 1000000009
using namespace std;
char s[1000005];
long long n,k;
long long tot,a,b,x,y,t;
long long work(long long a,long long x)
{
	long long sum=1;
	while (x)
	{
		if (x%2) sum=(sum*a)%MOD;
		a=(a*a)%MOD;
		x/=2;
	}
	return sum;
}
void exgcd(long long a,long long b)
{
	if (b==0)
	{
		x=tot;
		y=0;
		return;
	}
	else
	exgcd(b,a%b);
	t=x%MOD;
	x=y%MOD;
	y=(t-(a/b)*y)%MOD;
}
int main()
{
	//freopen("a.in","r",stdin);
	scanf("%lld%lld%lld%lld",&n,&a,&b,&k);
	scanf("%s",s);
	tot=0;
	for (int i=0;i<k;i++)
	{
		long long ss=1;
		long long t=(work(a,n-i)*work(b,i))%MOD;
		if (s[i]=='-') ss=-1;
		tot=(tot+ss*t)%MOD;

	}
	long long m=(n+1)/k;
	long long tott=(tot*work(work(a,m),MOD-2))*work(b,m)%MOD;

	if (a==b) tot=(tot*m)%MOD;
	else
	{
		tot=(tott*a-tot*a)%MOD*work(b-a,MOD-2);
		while (tot<0) tot+=MOD;
}
	printf("%lld",(tot)%MOD);
}


#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <string>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <vector>
#include <functional>
#include <ctime>
#include <cstdlib>
#include <sstream>
#include <set>
#include <deque>
#define MOD 1000000009
using namespace std;
char s[1000005];
long long n,k;
long long tot,a,b,x,y,t;
long long work(long long a,long long x)
{
	long long sum=1;
	while (x)
	{
		if (x%2) sum=(sum*a)%MOD;
		a=(a*a)%MOD;
		x/=2;
	}
	return sum;
}
void exgcd(long long a,long long b)
{
	if (b==0)
	{
		x=tot;
		y=0;
		return;
	}
	else
	exgcd(b,a%b);
	t=x%MOD;
	x=y%MOD;
	y=(t-(a/b)*y)%MOD;
}
int main()
{
	//freopen("a.in","r",stdin);
	scanf("%lld%lld%lld%lld",&n,&a,&b,&k);
	scanf("%s",s);
	tot=0;
	for (int i=0;i<k;i++)
	{
		long long ss=1;
		long long t=(work(a,n-i)*work(b,i))%MOD;
		if (s[i]=='-') ss=-1;
		tot=(tot+ss*t)%MOD;

	}
	long long m=(n+1)/k;
	long long tott=(tot*work(work(a,m)%MOD,MOD-2))*work(b,m)%MOD;

	if (a==b) tot=(tot*m)%MOD;
	else
	{
		tot=(tott*a-tot*a)%MOD*work(b-a,MOD-2);
		while (tot<0) tot+=MOD;
}
	printf("%lld",(tot)%MOD);
}


#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <string>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <vector>
#include <functional>
#include <ctime>
#include <cstdlib>
#include <sstream>
#include <set>
#include <deque>
#define MOD 1000000009
using namespace std;
char s[1000005];
long long n,k;
long long tot,a,b,x,y,t;
long long work(long long a,long long x)
{
	long long sum=1;
	while (x)
	{
		if (x%2) sum=(sum*a)%MOD;
		a=(a*a)%MOD;
		x/=2;
	}
	return sum;
}
int main()
{
	//freopen("a.in","r",stdin);
	scanf("%lld%lld%lld%lld",&n,&a,&b,&k);
	scanf("%s",s);
	tot=0;
	for (int i=0;i<k;i++)
	{
		long long ss=1;
		long long t=(work(a,n-i)*work(b,i))%MOD;
		if (s[i]=='-') ss=-1;
		tot=(tot+ss*t)%MOD;

	}
	long long m=(n+1)/k;

	if (a==b) tot=(tot*m)%MOD;
	else
	{
		tot=(tot*work(b,m)%MOD-tot*work(a,m)%MOD)*work(b-a,MOD-2)%MOD*work(a,MOD-2)%MOD;
		while (tot<0) tot+=MOD;
}
	printf("%lld",(tot)%MOD);
}


#include<bits/stdc++.h>
#include<math.h>
#define ll long long
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
int main(){
	ll i, k, b, c, n=0, a;
	cin>>b>>k;
	c=k-1;
	for(i=0;i<k;i++){
		cin>>a;
		n=n+a*pow(b, c);
		c--;
	}
	if(n%2==0){
		cout<<"even";
	}
	else if(n%2==1){
		cout<<"odd";
	}
	return 0;
}


#include<bits/stdc++.h>
#include<math.h>
#define ll long long
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
int main(){
	long long i, k, b, c, n=0, a[10000];
	cin>>b>>k;
	c=k-1;
	for(i=0;i<k;i++){
		cin>>a[i];
		n=n+a[i]*pow(b, c);
		c--;
	}
	if(n%2==0){
		cout<<"even";
	}
	else if(n%2==1){
		cout<<"odd";
	}
	return 0;
}


#include<bits/stdc++.h>
#include<math.h>
#define ll long long
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#define all(a) (a).begin(), (a).end()
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define sz size
#define fr first
#define sc second
#define pb push_back
#define er erase
#define in insert
#define mp make_pair
#define pi pair
#define rc(s) return cout<<s,0
#define int long long
using namespace std;
int main(){
	long long i, k, b, c, n=0, a[10000];
	cin>>b>>k;
	c=k-1;
	for(i=0;i<k;i++){
		cin>>a[i];
		n=n+a[i]*pow(b, c);
		c--;
	}
	if(n%2==0){
		cout<<"even";
	}
	else if(n%2==1){
		cout<<"odd";
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
	long long int i, k, b, c, n=0, a[100000];
	cin>>b>>k;
	cin>>a[0];
	for(i=0;i<k-1;i++){
		cin>>a[i];
		n=n+a[i]*b;
	}
	cin>>a[k];
	n=n+a[k];
	if(n%2==0){
		cout<<"even";
	}
	else{
		cout<<"odd";
	}
	return 0;
}


#include<bits/stdc++.h> //bruh
using namespace std;
int main(){
	long long int i, k, b, c, n=0, a[100000];
	cin>>b>>k;
	cin>>a[0];
	for(i=0;i<k-1;i++){
		cin>>a[i];
		n=n+a[i]*b;
	}
	cin>>a[k-1];
	n=n+a[k-1];
	if(n%2==0){
		cout<<"even";
	}
	else{
		cout<<"odd";
	}
	return 0;
}


#include <stdio.h>
#include <math.h>

int main()
{
	int b, k;

	scanf("%d %d", &b, &k);
	long long answer = 0;
	for (int i = 1; i <= k; i++)
	{
		int tmp;
		scanf("%d", &tmp);
		answer =  ( answer + (long long)( tmp * pow(b, k - i)) % 10 ) % 10;
	}

	if (answer % 2 == 0)
		printf("even\n");
	else
		printf("odd\n");

	return 0;
}


#include <stdio.h>
#include <math.h>

int main()
{
	int b, k;

	scanf("%d %d", &b, &k);
	long long answer = 0;
	for (int i = 1; i <= k; i++)
	{
		int tmp;
		scanf("%d", &tmp);
		answer = (answer + (long long)(tmp * pow(b, k - i))) % 10;
	}

	if (answer % 2 == 0)
		printf("even\n");
	else
		printf("odd\n");

	return 0;
}


#include <stdio.h>
#include <math.h>

int main()
{
	int b, k;

	scanf("%d %d", &b, &k);
	long long answer = 0;
	for (int i = 1; i <= k; i++)
	{
		int tmp;
		scanf("%d", &tmp);

		answer = tmp * pow(b, k - i);

	}

	if (answer % 2 == 0)
		printf("even\n");
	else
		printf("odd\n");

	return 0;
}


#include <stdio.h>
#include <math.h>

int main()
{
	int b, k;

	scanf("%d %d", &b, &k);
	long long answer = 0;
	for (int i = 1; i <= k; i++)
	{
		int tmp;
		scanf("%d", &tmp);
		answer = (answer +(tmp * ((long long)pow(b, k - i) % 10))) % 10;
	}

	if (answer % 2 == 0)
		printf("even\n");
	else
		printf("odd\n");

	return 0;
}


#include <stdio.h>
#include <math.h>

int main()
{
	int b, k;

	scanf("%d %d", &b, &k);
	long long answer = 0;
	for (int i = 1; i <= k; i++)
	{
		int tmp;
		scanf("%d", &tmp);

		answer += tmp * pow(b, k - i);
	}

	if (answer % 2 == 0)
		printf("even\n");
	else
		printf("odd\n");

	return 0;
}


#include <stdio.h>
#include <math.h>

int main()
{
	int b, k;

	scanf("%d %d", &b, &k);
	long long answer = 0;
	for (int i = 1; i <= k; i++)
	{
		int tmp;
		scanf("%d", &tmp);
		answer = (answer + (long long)(tmp * pow(b, k - i)));
	}

	if (answer % 2 == 0)
		printf("even\n");
	else
		printf("odd\n");

	return 0;
}


#include <stdio.h>
#include <math.h>

int main()
{
	int b, k;

	scanf("%d %d", &b, &k);
	long long answer = 0;
	for (int i = 1; i <= k; i++)
	{
		long long tmp;
		scanf("%lld", &tmp);
		answer = (answer + ((long long)(tmp * pow(b, k - i))) % 10) % 10;
	}

	if (answer % 2 == 0)
		printf("even\n");
	else
		printf("odd\n");

	return 0;
}


#include <stdio.h>
#include <math.h>

int main()
{
	int b, k;

	scanf("%d %d", &b, &k);
	int answer = 0;
	b = b % 2;
	for (int i = 1; i <= k; i++)
	{
		int tmp;
		scanf("%d", &tmp);
		answer += b * tmp;
	}

	if (answer % 2 == 0)
		printf("even\n");
	else
		printf("odd\n");

	return 0;
}


#include <stdio.h>
#include <math.h>

int main()
{
	int b, k;

	scanf("%d %d", &b, &k);
	int answer = 0;
	for (int i = 1; i <= k; i++)
	{
		int tmp;
		scanf("%d", &tmp);
		answer =  ( answer + (long long)( tmp * pow(b, k - i)) % 10 ) % 10;
	}

	if (answer % 2 == 0)
		printf("even\n");
	else
		printf("odd\n");

	return 0;
}


#include <stdio.h>
#include <math.h>

int main()
{
	int b, k;

	scanf("%d %d", &b, &k);
	long long answer = 0;
	for (int i = 1; i <= k; i++)
	{
		long long tmp;
		scanf("%lld", &tmp);
		answer = (long long)(answer + (tmp * pow(b, k - i))) % 10;
	}

	if (answer % 2 == 0)
		printf("even\n");
	else
		printf("odd\n");

	return 0;
}


#pragma warning (disable : 4996)

#include <stdio.h>
#include <math.h>

int main()
{
	int b, k;

	scanf("%d %d", &b, &k);
	int answer = 0;
	b = b % 2;
	for (int i = 1; i < k; i++)
	{
		int tmp;
		scanf("%d", &tmp);
		answer += b * tmp;
	}
	int tmp;
	scanf("%d", &tmp);
	answer += tmp;

	if (answer % 2 == 0)
		printf("even\n");
	else
		printf("odd\n");

	return 0;
}


#include<iostream>
#include<vector>
#include<cmath>
using namespace std;
int main()
{
    int n,k,ind=0,x;
    cin>>n>>k;
    for(int i=0;i<n-2;i++){cin>>x;if(x%10!=0)if(x%2==1)ind=abs(ind-1);}
    cin>>x; if(x!=0)if(x*n%2==1)ind=abs(ind-1);
    cin>>x; if(x!=0)if(x%2==1)ind=abs(ind-1);
    if(ind==0)cout<<"even"; else cout<<"odd";

}


#include<iostream>
#include<vector>
#include<cmath>
using namespace std;
int main()
{
    int n,k,x;
    long long ind=0;
    cin>>n>>k;
    for(int i=0;i<n-1;i++){cin>>x;ind+=x*n;ind%=2;}
    cin>>x;ind+=x;
    if(ind%2==0)cout<<"even"; else cout<<"odd";

}


#include<iostream>
#include<vector>
#include<cmath>
using namespace std;
int main()
{
    int n,k,x;
    long long ind=0;
    cin>>n>>k;
    for(int i=0;i<k-1;i++){cin>>x;ind+=x*n;ind%=2;}
    cin>>x;ind+=x;
    if(ind%2==0)cout<<"even"; else cout<<"odd";

}


#include<iostream>
#include<vector>
#include<cmath>
using namespace std;
int main()
{
    int n,k,ind=0,x;
    cin>>n>>k;
    for(int i=0;i<n-1;i++){cin>>x;if(x*n%2==1)ind=abs(ind-1);}
    cin>>x; if(x%2==1)ind=abs(ind-1);
    if(ind==0)cout<<"even"; else cout<<"odd";

}


#include<iostream>
#include<vector>
#include<cmath>
using namespace std;
int main()
{
    int n,k,ind=0,x;
    cin>>n>>k;
    for(int i=0;i<k-2;i++){cin>>x;if(x%10!=0)if(x%2==1)ind=abs(ind-1);}
    cin>>x; if(x!=0)if(x*n%2==1)ind=abs(ind-1);
    cin>>x; if(x!=0)if(x%2==1)ind=abs(ind-1);
    if(ind==0)cout<<"even"; else cout<<"odd";

}


#include<iostream>
#include<vector>
#include<cmath>
using namespace std;
int main()
{
    int n,k,x;
    long long ind=0;
    cin>>n>>k;
    for(int i=0;i<n-1;i++){cin>>x;ind+=x*n;}
    cin>>x;ind+=x;
    if(ind%2==0)cout<<"even"; else cout<<"odd";

}


/**********************************************
#code by --> @ { shadat </> sk40 [ o_o  ^_^ ] } }
**********************************************/
#include<bits/stdc++.h>
#include<algorithm>
#include<queue>
#include<list>
#include<map>
#include <vector>
#include <math.h>
#include<numeric>
using namespace std;
#define tezz ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long int
#define ull unsigned long long int
#define doub long double
#define ff first
#define ss second
#define pb push_back
#define pii pair<int , int>
#define pdd pair<double , double>
#define pll pair<long long int,long long int>
#define vpl vector<pll >
#define vll vector<ll >
#define mod 1000000007
#define stp setprecision(20)
const int maxi=1e5;
#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define mp make_pair
#define pb push_back
#define X first
#define Y second
#define FOR(i, N) for (int i = 0; i < (int)N; i++)
#define FORIN(i, a, b) for (int i = a; i < (int)b; i++)
#define ALL(x) (x).begin(), (x).end()
#define DEBUG(...) debug(__LINE__, ":" __VA_ARGS__)
#define trace1(x)                    cout <<#x<<": "<<x<< endl;
#define trace2(x, y)                 cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<< endl;
#define trace3(x, y, z)              cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl;
#define trace4(a, b, c, d)           cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
unsigned long long int c=1e11;
int main(){
	long long int b,k;
	cin>>b>>k;
	long long int a[k];
	for(ll i=0;i<k;i++) cin>>a[i];
	ll j=0;
	c=0;
	for(ll i=k-1;i>=0;i--){
		if(i>0)
		c+=((a[j])*(pow(b,i)));
		else
			c+=a[j];
		j++;
	}
	if(c%2==0) cout<<"even";
	else cout<<"odd";

	return 0;
}


/**********************************************
#code by --> @ { shadat </> sk40 [ o_o  ^_^ ] } }
**********************************************/
#include<bits/stdc++.h>
#include<algorithm>
#include<queue>
#include<list>
#include<map>
#include <vector>
#include <math.h>
#include<numeric>
using namespace std;
#define tezz ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long int
#define ull unsigned long long int
#define doub long double
#define ff first
#define ss second
#define pb push_back
#define pii pair<int , int>
#define pdd pair<double , double>
#define pll pair<long long int,long long int>
#define vpl vector<pll >
#define vll vector<ll >
#define mod 1000000007
#define stp setprecision(20)
const int maxi=1e5;
#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define mp make_pair
#define pb push_back
#define X first
#define Y second
#define FOR(i, N) for (int i = 0; i < (int)N; i++)
#define FORIN(i, a, b) for (int i = a; i < (int)b; i++)
#define ALL(x) (x).begin(), (x).end()
#define DEBUG(...) debug(__LINE__, ":" __VA_ARGS__)
#define trace1(x)                    cout <<#x<<": "<<x<< endl;
#define trace2(x, y)                 cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<< endl;
#define trace3(x, y, z)              cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl;
#define trace4(a, b, c, d)           cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
unsigned long long int c=1e11;
int main(){
	int b,k;
	cin>>b>>k;
	vector<int> a(k);
	for(int i=0;i<k;i++) cin>>a[i];
	int p=1,s=0;
	for(int i=k-1;i>=0;i--){
		s=(s+p*a[i])%2;
		p=p*b%2;
	}
	cout<<( !s ? "even" : "odd")<<endl;
	return 0;
}


/**********************************************
#code by --> @ { shadat </> sk40 [ o_o  ^_^ ] } }
**********************************************/
#include<bits/stdc++.h>
#include<algorithm>
#include<queue>
#include<list>
#include<map>
#include <vector>
#include <math.h>
#include<numeric>
using namespace std;
#define tezz ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long int
#define ull unsigned long long int
#define doub long double
#define ff first
#define ss second
#define pb push_back
#define pii pair<int , int>
#define pdd pair<double , double>
#define pll pair<long long int,long long int>
#define vpl vector<pll >
#define vll vector<ll >
#define mod 1000000007
#define stp setprecision(20)
const int maxi=1e5;
#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define mp make_pair
#define pb push_back
#define X first
#define Y second
#define FOR(i, N) for (int i = 0; i < (int)N; i++)
#define FORIN(i, a, b) for (int i = a; i < (int)b; i++)
#define ALL(x) (x).begin(), (x).end()
#define DEBUG(...) debug(__LINE__, ":" __VA_ARGS__)
#define trace1(x)                    cout <<#x<<": "<<x<< endl;
#define trace2(x, y)                 cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<< endl;
#define trace3(x, y, z)              cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl;
#define trace4(a, b, c, d)           cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
unsigned long long int c=1e11;
int main(){
	long long int b,k;
	cin>>b>>k;
	long long int a[k];
	for(ll i=0;i<k;i++) cin>>a[i];
	long long int p=1,s=0;
	for(long long int i=0;i<k;i++){
		s=(s+p*a[i])%2;
		p=p*b%2;
	}
	cout<<(!s?"even":"odd")<<endl;
	return 0;
}


/**********************************************
#code by --> @ { shadat </> sk40 [ o_o  ^_^ ] } }
**********************************************/
#include<bits/stdc++.h>
#include<algorithm>
#include<queue>
#include<list>
#include<map>
#include <vector>
#include <math.h>
#include<numeric>
using namespace std;
#define tezz ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long int
#define ull unsigned long long int
#define doub long double
#define ff first
#define ss second
#define pb push_back
#define pii pair<int , int>
#define pdd pair<double , double>
#define pll pair<long long int,long long int>
#define vpl vector<pll >
#define vll vector<ll >
#define mod 1000000007
#define stp setprecision(20)
const int maxi=1e5;
#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define mp make_pair
#define pb push_back
#define X first
#define Y second
#define MOD 1000000007
#define FOR(i, N) for (int i = 0; i < (int)N; i++)
#define FORIN(i, a, b) for (int i = a; i < (int)b; i++)
#define ALL(x) (x).begin(), (x).end()
#define MOD 1000000007
#define DEBUG(...) debug(__LINE__, ":" __VA_ARGS__)
#define trace1(x)                    cout <<#x<<": "<<x<< endl;
#define trace2(x, y)                 cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<< endl;
#define trace3(x, y, z)              cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl;
#define trace4(a, b, c, d)           cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
int main(){
	long long int b,k;
	cin>>b>>k;
	int a[k];
	for(ll i=0;i<k;i++) cin>>a[i];
	ll c=0;
	ll j=0;
	for(ll i=k-1;i>=0;i--){
		c+=(a[j]*(pow(b,i)));
		j++;
	}
	if(c%2==0) cout<<"even";
	else cout<<"odd";

	return 0;
}


/**********************************************
#code by --> @ { shadat </> sk40 [ o_o  ^_^ ] } }
**********************************************/
#include<bits/stdc++.h>
#include<algorithm>
#include<queue>
#include<list>
#include<map>
#include <vector>
#include <math.h>
#include<numeric>
using namespace std;
#define tezz ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long int
#define ull unsigned long long int
#define doub long double
#define ff first
#define ss second
#define pb push_back
#define pii pair<int , int>
#define pdd pair<double , double>
#define pll pair<long long int,long long int>
#define vpl vector<pll >
#define vll vector<ll >
#define mod 1000000007
#define stp setprecision(20)
const int maxi=1e5;
#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define mp make_pair
#define pb push_back
#define X first
#define Y second
#define MOD 1000000007
#define FOR(i, N) for (int i = 0; i < (int)N; i++)
#define FORIN(i, a, b) for (int i = a; i < (int)b; i++)
#define ALL(x) (x).begin(), (x).end()
#define MOD 1000000007
#define DEBUG(...) debug(__LINE__, ":" __VA_ARGS__)
#define trace1(x)                    cout <<#x<<": "<<x<< endl;
#define trace2(x, y)                 cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<< endl;
#define trace3(x, y, z)              cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl;
#define trace4(a, b, c, d)           cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
int main(){
	int b,k;
	cin>>b>>k;
	int a[k];
	for(int i=0;i<k;i++) cin>>a[i];
	int c=0;
	int j=0;
	for(int i=k-1;i>=0;i--){
		c+=(a[j]*(pow(b,i)));
		j++;
	}
	if(c%2==0) cout<<"even";
	else cout<<"odd";

	return 0;
}


/**********************************************
#code by --> @ { shadat </> sk40 [ o_o  ^_^ ] } }
**********************************************/
#include<bits/stdc++.h>
#include<algorithm>
#include<queue>
#include<list>
#include<map>
#include <vector>
#include <math.h>
#include<numeric>
using namespace std;
#define tezz ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long int
#define ull unsigned long long int
#define doub long double
#define ff first
#define ss second
#define pb push_back
#define pii pair<int , int>
#define pdd pair<double , double>
#define pll pair<long long int,long long int>
#define vpl vector<pll >
#define vll vector<ll >
#define mod 1000000007
#define stp setprecision(20)
const int maxi=1e5;
#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define mp make_pair
#define pb push_back
#define X first
#define Y second
#define MOD 1000000007
#define FOR(i, N) for (int i = 0; i < (int)N; i++)
#define FORIN(i, a, b) for (int i = a; i < (int)b; i++)
#define ALL(x) (x).begin(), (x).end()
#define MOD 1000000007
#define DEBUG(...) debug(__LINE__, ":" __VA_ARGS__)
#define trace1(x)                    cout <<#x<<": "<<x<< endl;
#define trace2(x, y)                 cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<< endl;
#define trace3(x, y, z)              cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl;
#define trace4(a, b, c, d)           cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
int main(){
	long long int b,k;
	cin>>b>>k;
	int a[k];
	for(ll i=0;i<k;i++) cin>>a[i];
	ll c=0;
	ll j=0;
	for(ll i=k-1;i>=0,j<=k;i--){
		if(i!=0)
		c+=((a[j])*(pow(b,i)));
		else
			c+=a[j];
		j++;
	}
	if(c%2==0) cout<<"even";
	else cout<<"odd";

	return 0;
}


/**********************************************
#code by --> @ { shadat </> sk40 [ o_o  ^_^ ] } }
**********************************************/
#include<bits/stdc++.h>
#include<algorithm>
#include<queue>
#include<list>
#include<map>
#include <vector>
#include <math.h>
#include<numeric>
using namespace std;
#define tezz ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long int
#define ull unsigned long long int
#define doub long double
#define ff first
#define ss second
#define pb push_back
#define pii pair<int , int>
#define pdd pair<double , double>
#define pll pair<long long int,long long int>
#define vpl vector<pll >
#define vll vector<ll >
#define mod 1000000007
#define stp setprecision(20)
const int maxi=1e5;
#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define mp make_pair
#define pb push_back
#define X first
#define Y second
#define FOR(i, N) for (int i = 0; i < (int)N; i++)
#define FORIN(i, a, b) for (int i = a; i < (int)b; i++)
#define ALL(x) (x).begin(), (x).end()
#define DEBUG(...) debug(__LINE__, ":" __VA_ARGS__)
#define trace1(x)                    cout <<#x<<": "<<x<< endl;
#define trace2(x, y)                 cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<< endl;
#define trace3(x, y, z)              cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl;
#define trace4(a, b, c, d)           cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
long long int c;
int main(){
	long long int b,k;
	cin>>b>>k;
	long long int a[k];
	for(ll i=0;i<k;i++) cin>>a[i];
	ll j=0;
	for(ll i=k-1;i>=0;i--){
		if(i>0)
		c+=((a[j])*(pow(b,i)));
		else
			c+=a[j];
		j++;
	}
	if(c%2==0) cout<<"even";
	else cout<<"odd";

	return 0;
}


/**********************************************
#code by --> @ { shadat </> sk40 [ o_o  ^_^ ] } }
**********************************************/
#include<bits/stdc++.h>
#include<algorithm>
#include<queue>
#include<list>
#include<map>
#include <vector>
#include <math.h>
#include<numeric>
using namespace std;
#define tezz ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long int
#define ull unsigned long long int
#define doub long double
#define ff first
#define ss second
#define pb push_back
#define pii pair<int , int>
#define pdd pair<double , double>
#define pll pair<long long int,long long int>
#define vpl vector<pll >
#define vll vector<ll >
#define mod 1000000007
#define stp setprecision(20)
const int maxi=1e5;
#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define mp make_pair
#define pb push_back
#define X first
#define Y second
#define FOR(i, N) for (int i = 0; i < (int)N; i++)
#define FORIN(i, a, b) for (int i = a; i < (int)b; i++)
#define ALL(x) (x).begin(), (x).end()
#define DEBUG(...) debug(__LINE__, ":" __VA_ARGS__)
#define trace1(x)                    cout <<#x<<": "<<x<< endl;
#define trace2(x, y)                 cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<< endl;
#define trace3(x, y, z)              cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl;
#define trace4(a, b, c, d)           cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
int main(){
	long long int b,k;
	cin>>b>>k;
	int a[k];
	for(ll i=0;i<k;i++) cin>>a[i];
	ll c=0;
	ll j=0;
	for(ll i=k-1;i>=0;i--){
		if(i>0)
		c+=((a[j])*(pow(b,i)));
		else
			c+=a[j];
		j++;
	}
	if(c%2==0) cout<<"even";
	else cout<<"odd";

	return 0;
}


/**********************************************
#code by --> @ { shadat </> sk40 [ o_o  ^_^ ] } }
**********************************************/
#include<bits/stdc++.h>
#include<algorithm>
#include<queue>
#include<list>
#include<map>
#include <vector>
#include <math.h>
#include<numeric>
using namespace std;
#define tezz ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long int
#define ull unsigned long long int
#define doub long double
#define ff first
#define ss second
#define pb push_back
#define pii pair<int , int>
#define pdd pair<double , double>
#define pll pair<long long int,long long int>
#define vpl vector<pll >
#define vll vector<ll >
#define mod 1000000007
#define stp setprecision(20)
const int maxi=1e5;
#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define mp make_pair
#define pb push_back
#define X first
#define Y second
#define FOR(i, N) for (int i = 0; i < (int)N; i++)
#define FORIN(i, a, b) for (int i = a; i < (int)b; i++)
#define ALL(x) (x).begin(), (x).end()
#define DEBUG(...) debug(__LINE__, ":" __VA_ARGS__)
#define trace1(x)                    cout <<#x<<": "<<x<< endl;
#define trace2(x, y)                 cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<< endl;
#define trace3(x, y, z)              cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl;
#define trace4(a, b, c, d)           cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
long long int c;
int main(){
	long long int b,k;
	cin>>b>>k;
	int a[k];
	for(ll i=0;i<k;i++) cin>>a[i];
	ll j=0;
	for(ll i=k-1;i>=0;i--){
		if(i>0)
		c+=((a[j])*(pow(b,i)));
		else
			c+=a[j];
		j++;
	}
	if(c%2==0) cout<<"even";
	else cout<<"odd";

	return 0;
}


/**********************************************
#code by --> @ { shadat </> sk40 [ o_o  ^_^ ] } }
**********************************************/
#include<bits/stdc++.h>
#include<algorithm>
#include<queue>
#include<list>
#include<map>
#include <vector>
#include <math.h>
#include<numeric>
using namespace std;
#define tezz ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long int
#define ull unsigned long long int
#define doub long double
#define ff first
#define ss second
#define pb push_back
#define pii pair<int , int>
#define pdd pair<double , double>
#define pll pair<long long int,long long int>
#define vpl vector<pll >
#define vll vector<ll >
#define mod 1000000007
#define stp setprecision(20)
const int maxi=1e5;
#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define mp make_pair
#define pb push_back
#define X first
#define Y second
#define MOD 1000000007
#define FOR(i, N) for (int i = 0; i < (int)N; i++)
#define FORIN(i, a, b) for (int i = a; i < (int)b; i++)
#define ALL(x) (x).begin(), (x).end()
#define MOD 1000000007
#define DEBUG(...) debug(__LINE__, ":" __VA_ARGS__)
#define trace1(x)                    cout <<#x<<": "<<x<< endl;
#define trace2(x, y)                 cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<< endl;
#define trace3(x, y, z)              cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl;
#define trace4(a, b, c, d)           cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
int main(){
	long long int b,k;
	cin>>b>>k;
	int a[k];
	for(ll i=0;i<k;i++) cin>>a[i];
	ll c=0;
	ll j=0;
	for(ll i=k-1;i>=0;i--){
		if(i!=0)
		c+=((a[j])*(pow(b,i)));
		else
			c+=a[j];
		j++;
	}
	if(c%2==0) cout<<"even";
	else cout<<"odd";

	return 0;
}


#include<bits/stdc++.h>
#define r_0 return 0
#define pb push_back
#define ll long long
#define fr first
#define se second
using namespace std;
const ll N = 1e6;
ll m, cnt, mx, n , x , h, sum , y,t, ans,z,res, mnn = 1e10, q, l, o, n1, g,mn = 1e10,c, i,mxx;
pair<int, int>p[N];
string s,s1,s2, s3,s4;
vector<int>v,v1,v2;
set<int>st;
set<char> it;
deque<char>d,d1,d2;
char a, b;
map<string, int>mp;
int used[N];

int main()
{
      ios_base::sync_with_stdio(0);
      cin.tie(0);
      cout.tie(0);

           //freopen( "input.txt", "r", stdin );
            //freopen( "output.txt", "w", stdout );

       cin >> n >> m;

       for ( ll i = 0; i < m; i ++ )
        cin >> l, v.pb ( l );
        x = m - 1;
        for ( int i = 0; i < v.size(); i ++ )
        {
               y = x , cnt = 1 ;
               while( y )
               {
                   cnt *= n;
                   y --;
               }
               cnt *= v[i];
               sum += cnt;
               x --;

        }
        if ( sum % 2 == 0 )
            cout << "YES";
        else
            cout << "NO";

}


#include<bits/stdc++.h>
#define r_0 return 0
#define pb push_back
#define ll long long
#define fr first
#define se second

using namespace std;

const int N = 1e3;
map<char ,int >mp,m1;
int used[N][N];
int use[100000];
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
      cout.tie(0);

          /// freopen( "input.txt", "r", stdin );
            /// freopen( "output.txt", "w", stdout );

     ll n;
     ll m,x,cnt = 0,y;
    cin >> n >> m;
    for( int i = 1; i <= m; i ++ )
    {
        cin >> x;
        cnt += x % 2;
    }
    if ( n % 2 == 0 and x % 2 == 0 )
        cout << "even\n";
    else if( cnt % 2 == 0 and n % 2 != 0 )
        cout << "even\n";
    else
        cout << "odd\n";

}


#include<bits/stdc++.h>
#define r_0 return 0
#define pb push_back
#define ll long long
#define ld long double
#define fr first
#define se second
#define Time ios_base::sync_with_stdio(0);
#define sz size
using namespace std;
ll n, m,x,y,t,ans,res, sum,mn = 1e9,cnt,mx,k,z,mnn = 1e9,mxx,b = 1, i, r;
string s1,s3,s2,s;
set<int>st;
pair <int , int>p[1000001];
vector<int>v,v1,v3,v4,v2;
map<char, ll>mp , mpp;
char  c,d,a;
bool tr = false, fl = false;
int used[10001];
 main()
{
    Time
    cin.tie(0);
    cout.tie(0);

       cin >> n >> m;
       ll a[m];

       for ( ll i = 0; i < m; i ++ )
        cin >> a[i];
        r = a[n-1];
        x = m - 1;
        for ( ll i = 0; i < m; i ++ )
        {
            y = x; cnt = 1;
            while( y )
            {
                cnt *= n;
                y --;
            }
            cnt *= a[i];
            sum += cnt;
            x --;
        }
        if ( sum % 2 == 0 ) cout << "even";
        else cout << "odd";

        /*
       cin >> n >> k >> s;
   for ( int i = 0; i < n; i ++ )
   {
       if ( s[i] == 'G' )
        m = i + 1;
       else if ( s[i] == 'T' )
            x = i + 1;
   }
   cnt = abs (m - x);
   z = 1;
   if ( cnt % k == 0 )
   {
       mn = min ( m , x );
       for ( int i = 0; i < n; i ++ )
       {
           if ( s[mn - 1 + ( z * k )] == '#' )
           {
               cout << "NO"; r_0;
           }
            z ++;
       }
       cout << "YES";
   }
   else cout << "NO";
 */

          /*

          cin >> n;
          for ( int i = 0; i < n; i ++ )
          {
              cin >> x >> s;
              cnt = 0;
              for ( int i = 0; i < s.size(); i ++ )
              {
                  if ( s[i] == '<' and s[i+1] == '>' )
                   cnt ++, s[i] = ' ', s[i+1] = ' ';
              }
               v.pb ( cnt );
          }
          for ( int i = 0; i < v.size(); i ++ )
            cout << v[i] << endl;

           */

     /*
     cin >> n >> m;
     for( int i = 0; i < n; i ++ )
     {
         for ( int j = 0; j < n; j ++ )
         {
               if ( i == j )
                cout << m << " ";

               else cout << 0 << " ";
         }
         cout << endl;
     }
     */

}


#include<bits/stdc++.h>
#define r_0 return 0
#define pb push_back
#define ll long long
#define ld long double
#define fr first
#define se second
#define Time ios_base::sync_with_stdio(0);
#define sz size
using namespace std;
ll n, m,x,y,t,ans,res, sum,mn = 1e9,cnt,mx,k,z,mnn = 1e9,mxx,b = 1, i, r;
string s1,s3,s2,s;
set<int>st;
pair <int , int>p[1000001];
vector<int>v,v1,v3,v4,v2;
map<char, ll>mp , mpp;
char  c,d,a;
bool tr = false, fl = false;
int used[10001];
 main()
{
    Time
    cin.tie(0);
    cout.tie(0);

       cin >> n >> m;
       ll a[m];
       cnt = 1;
       for ( ll i = 0; i < m; i ++ )
        cin >> a[i];
        r = a[n-1];
        x = m - 1;
        for ( ll i = 0; i < m; i ++ )
        {
            y = x; cnt = 1;
            while( y )
            {
                cnt *= n;
                y --;
            }
            cnt *= a[i];
            sum += cnt;
            x --;
        }
        if ( sum % 2 == 0 ) cout << "even";
        else cout << "odd";

        /*
       cin >> n >> k >> s;
   for ( int i = 0; i < n; i ++ )
   {
       if ( s[i] == 'G' )
        m = i + 1;
       else if ( s[i] == 'T' )
            x = i + 1;
   }
   cnt = abs (m - x);
   z = 1;
   if ( cnt % k == 0 )
   {
       mn = min ( m , x );
       for ( int i = 0; i < n; i ++ )
       {
           if ( s[mn - 1 + ( z * k )] == '#' )
           {
               cout << "NO"; r_0;
           }
            z ++;
       }
       cout << "YES";
   }
   else cout << "NO";
 */

          /*

          cin >> n;
          for ( int i = 0; i < n; i ++ )
          {
              cin >> x >> s;
              cnt = 0;
              for ( int i = 0; i < s.size(); i ++ )
              {
                  if ( s[i] == '<' and s[i+1] == '>' )
                   cnt ++, s[i] = ' ', s[i+1] = ' ';
              }
               v.pb ( cnt );
          }
          for ( int i = 0; i < v.size(); i ++ )
            cout << v[i] << endl;

           */

     /*
     cin >> n >> m;
     for( int i = 0; i < n; i ++ )
     {
         for ( int j = 0; j < n; j ++ )
         {
               if ( i == j )
                cout << m << " ";

               else cout << 0 << " ";
         }
         cout << endl;
     }
     */

}


#include<bits/stdc++.h>
#define r_0 return 0
#define pb push_back
#define ll long long
#define ld long double
#define fr first
#define se second
#define Time ios_base::sync_with_stdio(0);
#define sz size
using namespace std;
ll n, m,x,y,t,ans,res, sum,mn = 1e9,cnt,mx,k,z,mnn = 1e9,mxx,b = 1, i, r;
string s1,s3,s2,s;
set<int>st;
pair <int , int>p[1000001];
vector<int>v,v1,v3,v4,v2;
map<char, ll>mp , mpp;
char  c,d,a;
bool tr = false, fl = false;
int used[10001];
 main()
{
    Time
    cin.tie(0);
    cout.tie(0);

       cin >> n >> m;
       ll a[m];

       for ( ll i = 0; i < m; i ++ )
        cin >> a[i];
        x = m - 1;
        for ( ll i = 0; i < m; i ++ )
        {
            y = x; cnt = 1;
            while( y )
            {
                cnt *= n;
                y --;
            }
            cnt *= a[i];
            sum += cnt;
            x --;
        }
        if ( sum % 2 == 0 ) cout << "even";
        else cout << "odd";

        /*
       cin >> n >> k >> s;
   for ( int i = 0; i < n; i ++ )
   {
       if ( s[i] == 'G' )
        m = i + 1;
       else if ( s[i] == 'T' )
            x = i + 1;
   }
   cnt = abs (m - x);
   z = 1;
   if ( cnt % k == 0 )
   {
       mn = min ( m , x );
       for ( int i = 0; i < n; i ++ )
       {
           if ( s[mn - 1 + ( z * k )] == '#' )
           {
               cout << "NO"; r_0;
           }
            z ++;
       }
       cout << "YES";
   }
   else cout << "NO";
 */

          /*

          cin >> n;
          for ( int i = 0; i < n; i ++ )
          {
              cin >> x >> s;
              cnt = 0;
              for ( int i = 0; i < s.size(); i ++ )
              {
                  if ( s[i] == '<' and s[i+1] == '>' )
                   cnt ++, s[i] = ' ', s[i+1] = ' ';
              }
               v.pb ( cnt );
          }
          for ( int i = 0; i < v.size(); i ++ )
            cout << v[i] << endl;

           */

     /*
     cin >> n >> m;
     for( int i = 0; i < n; i ++ )
     {
         for ( int j = 0; j < n; j ++ )
         {
               if ( i == j )
                cout << m << " ";

               else cout << 0 << " ";
         }
         cout << endl;
     }
     */

}


#include<bits/stdc++.h>
#define r_0 return 0
#define pb push_back
#define ll long long
#define fr first
#define se second

using namespace std;

const int N = 1e3;
map<char ,int >mp,m1;
int used[N][N];
int use[100000];
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
      cout.tie(0);

          /// freopen( "input.txt", "r", stdin );
            /// freopen( "output.txt", "w", stdout );

     long double n;
     ll m,x,cnt = 0;

    cin >> n >> m;
        long double z = m -1;
    for( int i = 0; i < m; i ++ )
    {
        cin >> x;
        cnt += ( x * ( pow(n,z) ) );
        z --;
    }
    if( cnt % 2 == 0 )
        cout << "even\n";
    else
        cout << "odd\n";

}


#include<bits/stdc++.h>
#define r_0 return 0
#define pb push_back
#define ll long long
#define fr first
#define se second

using namespace std;

const int N = 1e3;
map<char ,int >mp,m1;
int used[N][N];
int use[100000];
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
      cout.tie(0);

          /// freopen( "input.txt", "r", stdin );
            /// freopen( "output.txt", "w", stdout );

     ll n;
     ll m,x,cnt = 0,y;
    cin >> n >> m;
    for( int i = 1; i <= m; i ++ )
    {
        cin >> x;
         y = ( x * (( m % 10 ) * m -i - 1) );
         cnt += ( y%10 );
    }
    if( cnt % 2 == 0 )
        cout << "even\n";
    else
        cout << "odd\n";

}


#include<bits/stdc++.h>
#define r_0 return 0
#define pb push_back
#define ll long long
#define fr first
#define se second
using namespace std;
const ll N = 1e6;
ll m, cnt, mx, n , x , h, sum , y,t, ans,z,res, mnn = 1e10, q, l, o, n1, g,mn = 1e10,c, i,mxx;
pair<int, int>p[N];
string s,s1,s2, s3,s4;
vector<int>v,v1,v2;
set<int>st;
set<char> it;
deque<char>d,d1,d2;
char a, b;
map<string, int>mp;
int used[N];

int main()
{
      ios_base::sync_with_stdio(0);
      cin.tie(0);
      cout.tie(0);

           //freopen( "input.txt", "r", stdin );
            //freopen( "output.txt", "w", stdout );

       cin >> n >> m;

       for ( ll i = 0; i < m; i ++ )
        cin >> l, v.pb ( l );
        x = m - 1;
        for ( int i = 0; i < v.size(); i ++ )
        {
               y = x , cnt = 1 ;
               while( y )
               {
                   cnt *= n;
                   y --;
               }
               cnt *= v[i];
               sum += cnt;
               x --;

        }
        if ( sum % 2 == 0 )
            cout << "even";
        else
            cout << "odd";

}


#include<bits/stdc++.h>
#define r_0 return 0
#define pb push_back
#define ll long long
#define fr first
#define se second

using namespace std;

const int N = 1e3;
map<char ,int >mp,m1;
int used[N][N];
int use[100000];
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
      cout.tie(0);

          /// freopen( "input.txt", "r", stdin );
            /// freopen( "output.txt", "w", stdout );

     long double n;
     ll m,x,cnt = 0,y;

    cin >> n >> m;
        long double z = m -1;
    for( int i = 0; i < m; i ++ )
    {
        cin >> x;
         y =  (x * ( pow(n,z) ));
         cnt += ( y%10 );
        z --;
    }
    if( cnt % 2 == 0 )
        cout << "even\n";
    else
        cout << "odd\n";

}