#include<bits/stdc++.h>
using namespace std;
int a,b,c,d;
double dp[20][20][20][20][5][5];
double ans;
double dfs(int ax,int bx,int cx,int dx,int joker1,int joker2) {
if(dp[ax][bx][cx][dx][joker1][joker2]>=1e-8) return dp[ax][bx][cx][dx][joker1][joker2];
int tot=ax+bx+cx+dx+(joker1!=0)+(joker2!=0);
if(ax+(joker1==1)+(joker2==1)>=a&&
bx+(joker1==2)+(joker2==2)>=b&&
cx+(joker1==3)+(joker2==3)>=c&&
dx+(joker1==4)+(joker2==4)>=d) {
return 0;
}
dp[ax][bx][cx][dx][joker1][joker2]=1.0;
if(ax<13)
dp[ax][bx][cx][dx][joker1][joker2]+=dfs(ax+1,bx,cx,dx,joker1,joker2)*(13-ax)/(54-tot);
if(bx<13)
dp[ax][bx][cx][dx][joker1][joker2]+=dfs(ax,bx+1,cx,dx,joker1,joker2)*(13-bx)/(54-tot);
if(cx<13)
dp[ax][bx][cx][dx][joker1][joker2]+=dfs(ax,bx,cx+1,dx,joker1,joker2)*(13-cx)/(54-tot);
if(dx<13)
dp[ax][bx][cx][dx][joker1][joker2]+=dfs(ax,bx,cx,dx+1,joker1,joker2)*(13-dx)/(54-tot);
if(!joker1) {
double minn=999999999;
minn=min(minn,dfs(ax,bx,cx,dx,4,joker2)/(54-tot));
minn=min(minn,dfs(ax,bx,cx,dx,3,joker2)/(54-tot));
minn=min(minn,dfs(ax,bx,cx,dx,2,joker2)/(54-tot));
minn=min(minn,dfs(ax,bx,cx,dx,1,joker2)/(54-tot));
dp[ax][bx][cx][dx][joker1][joker2]+=minn;
}
if(!joker2) {
double minn=999999999;
minn=min(minn,dfs(ax,bx,cx,dx,joker1,4)/(54-tot));
minn=min(minn,dfs(ax,bx,cx,dx,joker1,3)/(54-tot));
minn=min(minn,dfs(ax,bx,cx,dx,joker1,2)/(54-tot));
minn=min(minn,dfs(ax,bx,cx,dx,joker1,1)/(54-tot));
dp[ax][bx][cx][dx][joker1][joker2]+=minn;
}
return dp[ax][bx][cx][dx][joker1][joker2];
}
int main() {
cin>>a>>b>>c>>d;
int joker=2;
if(a>13) {
joker-=a-13;
}
if(b>13) {
joker-=b-13;
}
if(c>13) {
joker-=c-13;
}
if(d>13) {
joker-=d-13;
}
if(joker<0) {
printf("-1.000");
return 0;
}
ans=dfs(0,0,0,0,0,0);
printf("%.3lf",ans);
return 0;
}