#include<bits/stdc++.h>

#pragma GCC optimize("O2")
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")

#define int long long

#define pii pair<int,int>
#define ii int,int
#define fi first
#define se second
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define umap unordered_map
#define BIT(mask, i) ((mask >> i)&1)
#define ALL(c) c.begin(), c.end()

using namespace std;

mt19937 rd(chrono::high_resolution_clock::now().time_since_epoch().count());
int rand(int l, int r){
    return  l + rd()*rd()%(r-l+1);
}

const int N = 1e6+7;
const int M = 1e3+3;
const int MOD = 1e9+7;
const int inf = 3e18;

signed main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    string a, b;
    cin >> a >> b;
    int sz = min(a.size(), b.size());
    int ok = 0; // ok = 1 -> a > b, ok = 2 -> a < b
    for(int i = 0; i < sz; i++){
        if(a[i] > b[i]){
            ok = 1;
            break;
        }
        if(a[i] < b[i]){
            ok = 2;
            break;
        }
    }
    if(ok == 0){
        if(a.size() < b.size()) ok = 2;
        if(a.size() > b.size()) ok = 1;
    }

    if(ok == 0){
        cout << a;
    }
    if(ok == 1){
        cout << a;
    }
    if(ok == 2){
        cout << b;
    }

}

