public static void main (String args[]) throws Exception {
		BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));

		while (true) {
			String line = stdin.readLine();
			StringTokenizer st = new StringTokenizer(line);
			String a = st.nextToken();
			String b = st.nextToken();

			int maxPosition = 0;
			for (int i = 1; i < a.length(); i++) {
				if (a.charAt(i) > a.charAt(maxPosition)) {
					maxPosition = i;
				}
			}
			System.out.println(a.substring(0, maxPosition+1) + b + a.substring(maxPosition+1));
		}
	}