1 /*by SilverN*/
2 #include<algorithm>
3 #include<iostream>
4 #include<cstring>
5 #include<cstdio>
6 #include<cmath>
7 #include<vector>
8 using namespace std;
9 const int mxn=30;
10 int read(){
11 int x=0,f=1;char ch=getchar();
12 while(ch<‘0‘ || ch>‘9‘){if(ch==‘-‘)f=-1;ch=getchar();}
13 while(ch>=‘0‘ && ch<=‘9‘){x=x*10+ch-‘0‘;ch=getchar();}
14 return x*f;
15 }
16 struct edge{
17 int v,nxt;
18 }e[200010];
19 int hd[mxn],mct=0;
20 void add_edge(int u,int v){
21 e[++mct].v=v;e[mct].nxt=hd[u];hd[u]=mct;return;
22 }
23 int n,m,ed;
24 struct Mat{
25 double x[401][401];
26 Mat operator + (const Mat b){
27 Mat res;
28 for(int i=1;i<=ed;i++)
29 for(int j=1;j<=ed;j++)
30 res.x[i][j]=x[i][j]+b.x[i][j];
31 return res;
32 }
33 friend Mat operator * (const Mat a,const Mat b){
34 Mat res;
35 for(int i=1;i<=ed;i++)
36 for(int j=1;j<=ed;j++){
37 res.x[i][j]=0;
38 for(int k=1;k<=ed;k++)
39 res.x[i][j]+=a.x[i][k]*b.x[k][j];
40 }
41 return res;
42 }
43 }mt,bas;
44 int out[mxn];
45 double p[mxn],d[mxn][mxn];;
46 int pa,pb;//初始位置
47 int id[mxn][mxn],cnt=0;
48 void Build(){
49 int i,j;
50 for(i=1;i<=n;i++)
51 for(j=1;j<=n;j++)
52 id[i][j]=++cnt;
53 ed=cnt;
54 for(i=1;i<=n;i++)
55 for(j=1;j<=n;j++){
56 if(i==j){
57 mt.x[id[i][j]][id[i][j]]=1;
58 continue;
59 }
60 for(int k=1;k<=n;k++)
61 for(int l=1;l<=n;l++){
62 mt.x[id[i][j]][id[k][l]]+=d[i][k]*d[j][l];
63 // printf("(%d,%d)to(%d,%d):%.3f\n",i,j,k,l,mt.x[id[i][j]][id[k][l]]);
64 }
65 }
66 /* for(i=hd[pa];i;i=e[i].nxt){
67 int v1=e[i].v;
68 bas.x[id[pa][pb]][id[v1][pb]]=d[pa][v1]*d[pb][pb];
69 for(j=hd[pb];j;j=e[j].nxt){
70 int v2=e[j].v;
71 bas.x[id[pa][pb]][id[v1][v2]]=d[pa][v1]*d[pb][v2];//转移
72 }
73 }
74 for(j=hd[pb];j;j=e[j].nxt){
75 int v2=e[j].v;
76 bas.x[id[pa][pb]][id[pa][v2]]=d[pa][pa]*d[pb][v2];
77 }*/
78 return;
79 }
80 int main(){
81 int i,j,u,v;
82 n=read();m=read();pa=read();pb=read();
83 for(i=1;i<=m;i++){
84 u=read();v=read();
85 add_edge(u,v);add_edge(v,u);
86 ++out[u];++out[v];
87 }
88 for(i=1;i<=n;i++)scanf("%lf",&p[i]);
89 for(i=1;i<=n;i++){
90 d[i][i]=p[i];
91 for(j=hd[i];j;j=e[j].nxt){
92 int v=e[j].v;
93 d[i][v]+=(1-p[i])/out[i];
94 }
95 }
96 Build();
97 //
98 for(i=1;i<=5;i++) mt=mt*mt;
99 // bas=bas*mt;
100 /* for(i=1;i<=n;i++)
101 for(j=1;j<=n;j++){
102 for(int k=1;k<=n;k++)
103 for(int l=1;l<=n;l++)
104 printf("(%d,%d)to(%d,%d):%.3f\n",i,j,k,l,mt.x[id[i][j]][id[k][l]]);
105 }*/
106 //
107 for(i=1;i<=n;i++)printf("%.6f ",mt.x[id[pa][pb]][id[i][i]]);
108 return 0;
109 }