#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define REP(i,n) for(int i=0,_n=(int)(n);i<_n;++i)
#define ALL(v) (v).begin(),(v).end()
#define CLR(t,v) memset(t,(v),sizeof(t))
template<class T1,class T2>ostream& operator<<(ostream& os,const pair<T1,T2>&a){return os<<"("<<a.first<<","<<a.second<< ")";}
template<class T>void pv(T a,T b){for(T i=a;i!=b;++i)cout<<(*i)<<" ";cout<<endl;}
template<class T>void chmin(T&a,const T&b){if(a>b)a=b;}
template<class T>void chmax(T&a,const T&b){if(a<b)a=b;}

ll nextLong() { ll x; scanf("%lld", &x); return x;}

struct Edge {
  int a, b;
  char dir;
};

vector<Edge> es;
vector<vector<int>> g;
vector<int> c;
vector<int> ei;

void dfs(int v) {
  while (ei[v] < (int)g[v].size()) {
    int i = g[v][ei[v]++];
    if (es[i].dir != '-') continue;

    int u = v ^ es[i].a ^ es[i].b;
    if (u == es[i].b)
      es[i].dir = '>';
    else
      es[i].dir = '<';

    dfs(u);

  }
}

int main2() {
  int N = nextLong();
  int M = nextLong();

  g.clear();
  g = vector<vector<int>>(N);

  REP(i, M) {
    int a = nextLong() - 1;
    int b = nextLong() - 1;
    es.push_back((Edge){a, b, '-'});
    g[a].push_back(i);
    g[b].push_back(i);
  }
  c = vector<int>(N);
  REP(i, N) c[i] = nextLong();


  REP(i, M) {
    int a = es[i].a;
    int b = es[i].b;
    if (c[a] < c[b]) {      es[i].dir = '<';    }
    if (c[a] > c[b]) {      es[i].dir = '>';    }
  }

  ei = vector<int>(N);
  REP(i, N)
    dfs(i);

  REP(i, M) {
    if (es[i].dir == '<') cout << "<-" << endl;
    else if (es[i].dir == '>') cout << "->" << endl;
    else throw 42;
  }
  return 0;
}

int main() {

#ifdef LOCAL
  for (;!cin.eof();cin>>ws)
#endif
    main2();
  return 0;
}
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll,ll>;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
const ll INF = 1LL<<60;
const ll MOD = 1e9+7;


int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    ld sx, sy, gx, gy; cin>>sx>>sy>>gx>>gy;
    cout<<setprecision(12)<<sx+sy/(sy+gy)*(gx-sx)<<endl;

    return 0;
}