#include <bits/stdc++.h>
#define f first
#define s second
using namespace std;
const int N=1510,mod=1e9+7; //N should be set to maxN+D
int add(int a,int b){
a+=b;
if(a>=mod)
a-=mod;
return a;
}
vector<int> pwr(1,1),dx={1,-1,0,0},dy={0,0,1,-1};
int dp[2][N][N],d;
int get(int x,int y,int n){
if(x==-1)
x=1;
if(y==-1)
y=1;
if(x<y)
swap(x,y);
if(x+y<=d)
return 0;
if(x+y-n>d)
return pwr[n];
return dp[n&1][x][y];
}
pair<int,int> points[N*N];
int last=0,nxt;
int main()
{
int x,y,n;
scanf("%i %i %i %i",&x,&y,&n,&d);
x=abs(x);
y=abs(y);
if(x<y)
swap(x,y);
for(int i=1;i<N;i++)
pwr.push_back((long long)pwr.back()*4%mod);
for(int x=d+1;x>=0;x--)
for(int y=x;y>=0;y--)
if(x+y==d+1)
points[nxt++]={x,y};
for(int i=1;i<=n;i++){
for(int j=0;j<nxt;j++){
dp[i&1][points[j].f][points[j].s]=0;
int d=abs(x-points[j].f)+abs(y-points[j].s);
if(d>n-i)
continue;
for(int k=0;k<4;k++)
dp[i&1][points[j].f][points[j].s]=add(dp[i&1][points[j].f][points[j].s],get(points[j].f+dx[k],points[j].s+dy[k],i-1));
}
if(i!=n){
int limit=nxt;
for(int j=last;j<limit;j++)
points[nxt++]={points[j].f+1,points[j].s};
if(points[limit-1].f!=points[limit-1].s)
points[nxt++]={points[limit-1].f,points[limit-1].s+1};
last=limit;
}
}
printf("%i\n",get(x,y,n));
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CgojZGVmaW5lIGYgZmlyc3QKI2RlZmluZSBzIHNlY29uZAoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmNvbnN0IGludCBOPTE1MTAsbW9kPTFlOSs3OyAvL04gc2hvdWxkIGJlIHNldCB0byBtYXhOK0QKaW50IGFkZChpbnQgYSxpbnQgYil7CglhKz1iOwoJaWYoYT49bW9kKQoJCWEtPW1vZDsKCXJldHVybiBhOwp9CnZl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ludHNbal0uZl1bcG9pbnRzW2pdLnNdLGdldChwb2ludHNbal0uZitkeFtrXSxwb2ludHNbal0ucytkeVtrXSxpLTEpKTsKCQl9CgkJaWYoaSE9bil7CiAgICAgICAgICAgIGludCBsaW1pdD1ueHQ7CiAgICAgICAgICAgIGZvcihpbnQgaj1sYXN0O2o8bGltaXQ7aisrKQogICAgICAgICAgICAgICAgcG9pbnRzW254dCsrXT17cG9pbnRzW2pdLmYrMSxwb2ludHNbal0uc307CiAgICAgICAgICAgIGlmKHBvaW50c1tsaW1pdC0xXS5mIT1wb2ludHNbbGltaXQtMV0ucykKICAgICAgICAgICAgICAgIHBvaW50c1tueHQrK109e3BvaW50c1tsaW1pdC0xXS5mLHBvaW50c1tsaW1pdC0xXS5zKzF9OwoJCQlsYXN0PWxpbWl0OwoJCX0KCX0KCXByaW50ZigiJWlcbiIsZ2V0KHgseSxuKSk7CglyZXR1cm4gMDsKfQo=