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

typedef long long ll;

typedef pair<int, int> pii;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;

#define mp make_pair
#define fr first
#define sc second

int lg(ll n) {
    assert(n > 0);
    int ans = -1;
    while (n) {
        ans++;
        n >>= 1;
    }
    return ans;
}

int score(string s) {
    vector<int> cnt(10);
    iota(cnt.begin(), cnt.end(), 0);
    for (char ch : s) cnt[ch - '0'] *= 10;
    return accumulate(cnt.begin(), cnt.end(), 0);
}

void solve() {
    int K;
    cin >> K;
    string S, T;
    cin >> S >> T;
    S.pop_back(), T.pop_back();
    vector<int> cnt(10, K);
    for (char ch : S) cnt[ch - '0']--;
    for (char ch : T) cnt[ch - '0']--;
    ll ans = 0;
    for (int i = 1; i < 10; i++) {
        for (int j = 1; j < 10; j++) {
            if (score(S + (char)(i + '0')) > score(T + (char)(j + '0'))) {
                ans += (i == j ? 1LL * cnt[i] * (cnt[i] - 1)
                               : 1LL * cnt[i] * cnt[j]);
            }
        }
    }
    const int remain = 9 * K - 8;
    cout << fixed << setprecision(12) << (double)ans / remain / (remain - 1)
         << '\n';
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

    int t = 1;
    // cin >> t;
    while (t--) solve();

    return 0;
}

#include <bits/stdc++.h>

using namespace std;


long long rnd(long double n)
{
    long double f, c;

    f = n - (long double)floor(n);
    c = (long double)ceil(n) - n;

    if (c < f)
    {
        return ceil(n);
    }
    else
    {
        return floor(n);
    }
    
    
}






int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    long long k, n, m, i, s = 0, d;
    long double r;

    cin >> k >> n >> m;

    r = (long double)m / (long double)n;

    vector<long long> a(k);
    vector<long double> b1(k);
    vector<long long> b2(k);
    vector<long long> c(k);
    vector<pair<long double, long long>> di(k);

    for (i = 0; i < k; i++)
    {
        cin >> a[i];
    }

    for (i = 0; i < k; i++)
    {
        b1[i] = (long double)a[i]*r;
    }

    for (i = 0; i < k; i++)
    {
        b2[i] = rnd(b1[i]);
    }

    for (i = 0; i < k; i++)
    {
        if (b1[i] > (long double)b2[i])
        {
            c[i] = -1;
        }
        else if (b1[i] < (long double)b2[i])
        {
            c[i] = 1;
        }
        else
        {
            c[i] = 0;
        }
        
    }

    for (i = 0; i < k; i++)
    {
        di[i] = make_pair((long double)b2[i] - b1[i], i);
    }

    for (i = 0; i < k; i++)
    {
        s += b2[i];
    }   

    d = m - s;


    std::sort(di.begin(), di.end(), [](const std::pair<float, int>& first, const std::pair<float, int>& second)
{
    return first.first < second.first;
});

    

    if (d > 0)
    {

        for (i = 0; i < d; i++)
        {
            b2[di[i].second]++;
        }
    }
    else if (d < 0)
    {
        

        d = d*(-1);

        for (i = 0; i < d; i++)
        {
            b2[di[k-1-i].second]--;
        }
    }

    for (i = 0; i < k; i++)
    {
        cout << b2[i] << " ";
    }




    


    
}

    