The preferred way to generate user login in Polygon is to concatenate a prefix of the user's first name and a prefix of their last name, in that order. Each prefix must be non-empty, and any of the prefixes can be the full name. Typically there are multiple possible logins for each person.

You are given the first and the last name of a user. Return the alphabetically earliest login they can get (regardless of other potential Polygon users).

As a reminder, a prefix of a string s is its substring which occurs at the beginning of s: "a", "ab", "abc" etc. are prefixes of string "{abcdef}" but "b" and 'bc" are not. A string a is alphabetically earlier than a string b, if a is a prefix of b, or a and b coincide up to some position, and then a has a letter that is alphabetically earlier than the corresponding letter in b: "a" and "ab" are alphabetically earlier than "ac" but "b" and "ba" are alphabetically later than "ac".

Input

The input consists of a single line containing two space-separated strings: the first and the last names. Each character of each string is a lowercase English letter. The length of each string is between 1 and 10, inclusive. 

Output

Output a single string — alphabetically earliest possible login formed from these names. The output should be given in lowercase as well.

Examples

Input

harry potter


Output

hap


Input

tom riddle


Output

tomr
//package hiougyf;
import java.io.*;
import java.util.*;
import java.util.Map.Entry;

public class Solution {	
	public static void main(String[] args){  
		Scanner sc =new Scanner(System.in);
		
		String a=sc.next();
		String b=sc.next();
		int n=a.length();
		int m=b.length();
		char t=b.charAt(0);
		String ans="";
		ans+=a.charAt(0);
		for(int i=1;i<n;i++) {
			if(a.charAt(i)<t) {
				ans+=a.charAt(i);
			}
			else break;
		}
		ans+=t;
		System.out.println(ans);
		}
	  public static int floorSqrt(int x) 
	    { 
	        // Base Cases 
	        if (x == 0 || x == 1) 
	            return x; 
	  
	        // Do Binary Search for floor(sqrt(x)) 
	        int start = 1, end = x, ans=0; 
	        while (start <= end) 
	        { 
	            int mid = (start + end) / 2; 
	  
	            // If x is a perfect square 
	            if (mid*mid == x) 
	                return mid; 
	  
	            // Since we need floor, we update answer when mid*mid is 
	            // smaller than x, and move closer to sqrt(x) 
	            if (mid*mid < x) 
	            { 
	                start = mid + 1; 
	                ans = mid; 
	            } 
	            else   // If mid*mid is greater than x 
	                end = mid-1; 
	        } 
	        return ans; 
	    } 
		static int div(int n,int b) {
			int g=-1;
			for(int i=2;i<=Math.sqrt(n);i++) {
				if(n%i==0&&i!=b) {
					g=i;
					break;
				}
			}
			return g;
		}
	 
	  
	  public static int gcd(int a, int b) 
	    { 
	        if (a == 0) 
	            return b; 
	          
	        return gcd(b%a, a); 
	    } 
	   public static int lcm(int a, int b)  
	  {  
	     return (a*b)/gcd(a, b);  
	  }  
	   public static boolean isPrime1(int n) {
           if (n <= 1) {
               return false;
           }
           if (n == 2) {
               return true;
           }
           for (int i = 2; i <= Math.sqrt(n) + 1; i++) {
               if (n % i == 0) {
                   return false;
               }
           }
           return true;
       }
       public static boolean isPrime(int n) {
           if (n <= 1) {
               return false;
           }
           if (n == 2) {
               return true;
           }
           if (n % 2 == 0) {
               return false;
           }
           for (int i = 3; i <= Math.sqrt(n) + 1; i = i + 2) {
               if (n % i == 0) {
                   return false;
               }
           }
           return true;
       }
	      
	
}