#include <bits/stdc++.h>

using ll = long long;
const int N(1010);
ll n, f[N];
int pos, fl[N];
std::vector<int> ans;

int main()
{
	std::scanf("%lld", &n), f[1] = 1;
	for (int i = 2; i <= 90; i++) f[i] = f[i - 1] + f[i - 2];
	for (int i = 90; i; i--)
		if (n >= f[i]) n -= f[i], fl[i] = 1, pos = std::max(pos, i);
	for (int i = pos, j = 1; i; i--, j++)
	{
		if (fl[i])
		{
			if (i & 1) ans.push_back(1);
			else ans.push_back(2);
		}
		if (j & 1) ans.push_back(4);
		else ans.push_back(3);
	}
	printf("%lu\n", ans.size());
	for (auto i : ans) printf("%d\n", i);
	return 0;
}

#include "bits/stdc++.h"
using namespace std;
#define REP(i, n) for(ll i = 0;i < n;i++)
//#define ll long long
#define ll int
//#define MOD 1000000007LL
//#define MOD 998244353LL
#define doublecout(a) cout<<setprecision(16)<<a<<endl;
using vi = vector<ll>; // intの1次元の型に vi という別名をつける
using vvi = vector<vi>; // intの2次元の型に vvi という別名をつける
using vvvi = vector<vvi>; // intの2次元の型に vvi という別名をつける
//const ll llMAX=9223372036854775807LL; 
//const ll llMIN=-9223372036854775808LL;

void myprint1D(vi &data)
{
  REP(i,data.size())
    cout<<data[i]<<" ";
  cout<<endl;
}

//配列を[y][x]で表示
void myprint2D_T(vvi &data)
{
  REP(i,data.size())
    myprint1D(data[i]);
}

//配列を[x][y]で表示
void myprint2D(vvi &data)
{
  ll l1=data.size();
  ll l2=data[0].size();
  REP(j,l2){
    REP(i,l1)
      cout<<data[i][j]<<" ";
    cout<<endl;
  }
}

//print(a,b...)って使い方
void print1(ll a){cout<<a<<endl;}
void print2(ll a,ll b){cout<<a<<" "<<b<<endl;}
void print3(ll a,ll b,ll c){cout<<a<<" "<<b<<" "<<c<<endl;}
void print4(ll a,ll b,ll c,ll d){cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl;}
void print5(ll a,ll b,ll c,ll d,ll e){cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;}


ll h,w,a,b;

int main(){
  ll ans=0;
  cin >> h>>w>>a>>b;
  ll n=h*w,nn=1;
  for(ll i=0;i<n;i++) nn*=3;

  vi data(h*w,-1);// N * M の2次元配列
  for(ll i=0;i<nn;i++){
    ll iii=i;
    ll c1=0,c2=0;
    for(ll j=0;j<n;j++){
      ll t=iii%3;
      iii/=3;
      if (t==0)c1++;
    }
    if (c1!=b) continue;
    
    
    iii=i;
    for(ll j=0;j<n;j++){
      ll t=iii%3;
      iii/=3;
      data[j]=t;
    }

    c1=0;

    ll flag=0;
    for(ll j=0;j<h;j++){
      for(ll k=0;k<w;k++){
        ll d=data[j*w+k];
        if (d==0){
            c1++;
            if (c1>b){flag=1;break;}
            continue;
        }
        if (d==1){
          if (k+1==w){flag=1;break;}
          c2++;
          data[j*w+k+1]=3;
          continue;
        }
        
        if (d==2){
          if (j+1==h){flag=1;break;}
          c2++;
          data[j*w+k+w]=3;
          continue;
        }
      }
      if (flag==1)break;
    }

    if ((c1!=b)|(c2!=a))flag=1;
    if (flag==0)ans++;
  }


  for(ll i=0;i<a;i++){
    ans/=2;
  }

  cout<<ans<<endl;
  return 0;
}