#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double dbl;
#define REP(i,n) for(ll i=0;i<ll(n);++i)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=ll(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=ll(b);i--)
#define FORA(i,I) for(const auto& i:I)
#define ALL(x) x.begin(),x.end()
#define SIZE(x) ll(x.size())
const ll INF = 1LL<<60;
const ll MOD = 1'000'000'007LL;
const dbl EPS = 1e-12;
const dbl PI = 3.14159265358979323846;
#define coutALL(x) for(auto i=x.begin();i!=--x.end();++i)cout<<*i<<' ';cout<<*--x.end()<<endl;
ll myceil(ll a,ll b){return (a+(b-1))/b;}
ll myfloor(ll a,ll b){return a/b;}
template <class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;} return 0;}
template <class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;} return 0;}

int N, M;
vector<string> s;
vector<char> CHARS = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', '.'};

void printMat(const vector<string> &mat) {
    for (int i = 0; i < mat.size(); ++i) {
        cout << mat[i] << endl;
    }
}

ll count_blank(const vector<string> &mat) {
    ll cnt = 0;
    REP(i, N) {
        REP(j, N) {
            if (mat[i][j] == '.')
                cnt++;
        }
    }
    return cnt;
}

ll calc_score(const vector<string> &mat) {
    ll score = 0;
    int c = 0;
    REP(k, M) {
        string pat = s[k];
        bool found = false;
        REP(i, N) {
            if (found)
                break;
            REP(j, N) {
                bool horiz = true;
                bool vert = true;
                REP(p, pat.size()) {
                    if (mat[i][(j+p)%N] != pat[p]) {
                        horiz = false;
                        break;
                    }
                }
                if (horiz) {
                    c++;
                    found = true;
                    break;
                }
                REP(p, pat.size()) {
                    if (mat[(i+p)%N][j] != pat[p]) {
                        vert = false;
                        break;
                    }
                }
                if (vert) {
                    c++;
                    found = true;
                    break;
                }
            }
        }
    }
    if (c < M) {
        return int(round(1e8 * c * 1.0 / M));
    } else if (c == M) {
        ll d = count_blank(mat);
        return int(round(1e8 * 2 * N * N * 1.0 / (2 * N * N - d)));
    }
}

vector<string> solve_random() {
    vector<string> ret;
    REP(i, N) {
        string tmp_str = "";
        REP(j, N) {
            tmp_str += CHARS[rand()%9];
        }
        ret.push_back(tmp_str);
    }
    return ret;
}

signed main(){
    cout<<fixed<<setprecision(15);
    srand(time(nullptr));
    cin >> N >> M;
    s.assign(M, "");
    REP(i, M) cin>>s[i];


    vector<string> mat = solve_random();
    printMat(mat);
    // cout << calc_score(mat) << endl;
    return 0;
}
//In the name of Allah :)
#include <bits/stdc++.h>
using namespace std;
string to_string(char c) { return string(1,c); }
string to_string(bool b) { return b ? "true" : "false"; }
string to_string(const char* s) { return (string)s; }
string to_string(string s) { return s; }
template<class A> string to_string(complex<A> c) { 
	stringstream ss; ss << c; return ss.str(); }
string to_string(vector<bool> v) { 
	string res = "{"; for(int i = 0; i < (int)v.size(); i++) res += char('0'+v[i]);
	res += "}"; return res; }
template<size_t SZ> string to_string(bitset<SZ> b) {
	string res = ""; for(size_t i = 0; i < SZ; i++) res += char('0'+b[i]);
	return res; }
template<class A, class B> string to_string(pair<A,B> p);
template<class T> string to_string(T v) { // containers with begin(), end()
	bool fst = 1; string res = "{";
	for (const auto& x: v) {
		if (!fst) res += ", ";
		fst = 0; res += to_string(x);
	}
	res += "}"; return res;
}
template<class A, class B> string to_string(pair<A,B> p) {
	return "("+to_string(p.first)+", "+to_string(p.second)+")"; }
void DBG() { cerr << "]" << endl; }
template<class H, class... T> void DBG(H h, T... t) {
	cerr << to_string(h); if (sizeof...(t)) cerr << ", ";
	DBG(t...); }
#ifdef LOCAL // compile with -DLOCAL
#define wis(...) cerr << "LINE(" << __LINE__ << ") -> [" << #__VA_ARGS__ << "] : [", DBG(__VA_ARGS__)
#else
#define wis(...) 0
#endif
typedef long long ll;
#define all(x) (x).begin(), (x).end()

int main(){
	ios::sync_with_stdio(0);	
	double a, b, c, d;
	cin >> a >> b >> c >> d;
	cout << fixed << setprecision(10) << (b * c + d * a) / (b + d) << '\n';
}
