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

    //~~~~~~~~~~~~~~~~~~~~~~~@@@@@@@@@@@@@@@_____________K_____S_____J__________@@@@@@@@@@@@@@@@@@@@@@@@@@@@~~~~~~~~~~~~~~~~~~~~~~~~~~
    //Date:00/00/17
    //-------------


import java.util.*;
import java.io.*;

/*

    [[[[[[[[[[[[[[[      ]]]]]]]]]]]]]]]
    [::::::::::::::      ::::::::::::::]
    [::::::::::::::      ::::::::::::::]
    [::::::[[[[[[[:      :]]]]]]]::::::]
    [:::::[                      ]:::::]
    [:::::[                      ]:::::]
    [:::::[                      ]:::::]
    [:::::[                      ]:::::]
    [:::::[    CODE YOUR LIFE    ]:::::]
    [:::::[   Kripa Shankar jha  ]:::::]
    [:::::[                      ]:::::]
    [:::::[                      ]:::::]
    [:::::[                      ]:::::]
    [:::::[                      ]:::::]
    [::::::[[[[[[[:      :]]]]]]]::::::]
    [::::::::::::::      ::::::::::::::]
    [::::::::::::::      ::::::::::::::]
    [[[[[[[[[[[[[[[      ]]]]]]]]]]]]]]]
*/

public class prob3{
  

    static Parser sc=new Parser(System.in);
    static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
  
  static int p[]=new int[100005];
  public static void main(String[] args) throws IOException {
    // use ((((((( sc ............... for input

    String str=sc.nextLine();
      str+=" ";
    String arr[]=str.split(" ");
    
    String ans=(""+arr[0].charAt(0));

    for(int i=1;i<arr[0].length();i++){

      if(arr[0].charAt(i)<arr[1].charAt(0)){
        ans+=arr[0].charAt(i);
      }
      else{
        break;
      }
    }

    ans+=arr[1].charAt(0);
    

    System.out.println(""+ans);    
        
  }

   

public static void union(int a,int b){
        int i=find(a);
        int j=find(b);

        if(p[i]!=j){
          p[i]=j;
        }
      }


      public static int find(int a){

        while(p[a]!=a){
          a=p[a];
        }

        return a;
      }






  //___________________________Fast-Input_Output-------------------******************* 
  

  static class Parser {
        final private int BUFFER_SIZE = 1 << 20;  // 2^16, a good compromise for some problems
        private InputStream din;    // Underlying input stream
        private byte[] buffer;      // Self-maintained buffer
        private int bufferPointer;  // Current read position in the buffer
        private int bytesRead;      // Effective bytes in the buffer read from the input stream
        private SpaceCharFilter filter;
        public Parser(InputStream in) {
            din = in;
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;

        }

        /**
         * Read the next integer from the input stream.
         * @return The next integer.
         * @throws IOException
         */
        public int nextInt() throws IOException {
            int result = 0;
            byte c = read();
            while (c <= ' ') c = read();
            boolean neg = (c == '-');
            if (neg) c = read();
        while (c >= '0' && c <= '9') {
                result = result * 10 + c - '0';
                c = read();
            }
      if (neg) return -result;
              return result;
        }

        public int nextLong() throws IOException {
            int result = 0;
            byte c = read();
            while (c <= ' ') c = read();
            boolean neg = (c == '-');
            if (neg) c = read();
        while (c >= '0' && c <= '9') {
                result = result * 10 + c - '0';
                c = read();
            }
      if (neg) return -result;
              return result;
        }

        public String nextLine()throws IOException {
        int c = read();
        while (isSpaceChar(c))
          c = read();
        StringBuilder res = new StringBuilder();
        do {
          res.appendCodePoint(c);
          c = read();
        } while (!isEndOfLine(c)==true);
        return res.toString();
      }

      public boolean isSpaceChar(int c) {
        if (filter != null)
          return filter.isSpaceChar(c);
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
      }
   
      private boolean isEndOfLine(int c) {
        return c == '\n' || c == '\r' || c == -1;
      }
      public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
      }


        /**
         * Read the next byte of data from the input stream.
         * @return the next byte of data, or -1 if the end of the stream is reached.
         * @throws IOException if an I/O error occurs.
         */
        public byte read() throws IOException {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        /**
         * Read data from the input stream into the buffer
         * @throws IOException if an I/O error occurs.
         */
        private void fillBuffer() throws IOException {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }
    }
}