#include <algorithm>
#include <iomanip>
#include <iostream>
#include <map>
#include <unordered_map>
#include <vector>

using namespace std;

#define MP make_pair
#define PB push_back
#define REP(i, L, R) for (int i = L; i < (R); ++i)
#define SZ(x) (int)x.size()

using ll = long long;
using ld = long double;
using pi = pair<int, int>;
using pl = pair<ll, ll>;

template <typename T>
bool ckmin(T& a, const T& b) {
  return b < a ? a = b, 1 : 0;
}
template <typename T>
bool ckmax(T& a, const T& b) {
  return a < b ? a = b, 1 : 0;
}

ll p[6] = {1, 10, 100, 1000, 10000, 100000};

ll score(const string& s, int d) {
  int f[10];
  fill(f, f + 10, 0);
  ++f[d];
  for (int i = 0; i < s.length() - 1; ++i) {
    f[s[i] - '0']++;
  }
  ll sum = 0;
  for (int i = 1; i <= 9; ++i) {
    sum += (ll)i * p[f[i]];
  }

  return sum;
}

void solve() {
  int k;
  string s, t;
  cin >> k;
  cin >> s;
  cin >> t;

  int f[10];
  fill(f, f + 10, 0);
  for (int i = 0; i < s.length() - 1; ++i) {
    f[s[i] - '0']++;
  }
  for (int i = 0; i < t.length() - 1; ++i) {
    f[t[i] - '0']++;
  }

  // map<pi, bool> w;
  unordered_map<int, bool> w;
  for (int i = 1; i <= 9; ++i) {
    for (int j = 1; j <= 9; ++j) {
      // (i,j) -> i*10+j
      w[i * 10 + j] = (score(s, i) > score(t, j));
    }
  }

  ll cnt = 0;
  for (int i = 1; i <= 9; ++i) {
    ll remi = k - f[i];
    if (remi <= 0) {
      continue;
    }
    for (int j = 1; j <= 9; ++j) {
      ll remj = k - f[j] - (i == j);
      if (remj <= 0) {
        continue;
      }
      if (w[i * 10 + j]) {
        cnt += remi * remj;
      }
    }
  }

  ld total = ((ld)9 * k - 8) * ((ld)9 * k - 9);
  cout << fixed << setprecision(14) << (ld)cnt / total << endl;
}

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int T = 1;
  while (T--) {
    solve();
  }
  return 0;
}

#include<bits/stdc++.h>
using namespace std;
using ll = int64_t;
#define rep(i,n) for(int i=0; i<(n); i++)
#define ALL(n) n.begin(), n.end()

int main(){
    ll a, b, k;
    cin >> a >> b >> k;

    // パスカルの三角形
    vector<vector<ll>> p(60, vector<ll>(60));
    p[0][0] = 1;

    for(int i=1; i<60; i++)for(int j=0; j<60; j++){
        if(j == 0) p[i][j] = p[i-1][j];
        else p[i][j] = p[i-1][j-1] + p[i-1][j];
    }

    /**
        rep(i,10){
            rep(j,10){
                if(p[i][j] == 0) break;
                else cout << p[i][j] << " ";
            }
            cout << endl;
        }
    **/

    string ans = "";

    // 先頭がaの時、何通りあるか
    for(int i=a+b; 0<a+b; i--){

        ll num = p[a+b-1][b];

        //cout << num << endl;
        
        // 次の文字がbのとき
        if(k > num){ // 次の文字がbのとき
            ans += 'b';
            k -= num;
            b--;
        }else{ // 次の文字がaのとき
            ans += 'a';
            a--;
        }

        if(a == 0){
            rep(j,b) ans += 'b';
            break;
        }else if(b == 0){
            rep(j,a) ans += 'a';
            break;
        }
    }

    cout << ans << endl;
}