One day Vasya the Hipster decided to count how many socks he had. It turned out that he had a red socks and b blue socks.

According to the latest fashion, hipsters should wear the socks of different colors: a red one on the left foot, a blue one on the right foot.

Every day Vasya puts on new socks in the morning and throws them away before going to bed as he doesn't want to wash them.

Vasya wonders, what is the maximum number of days when he can dress fashionable and wear different socks, and after that, for how many days he can then wear the same socks until he either runs out of socks or cannot make a single pair from the socks he's got.

Can you help him?

Input

The single line of the input contains two positive integers a and b (1 ≤ a, b ≤ 100) — the number of red and blue socks that Vasya's got.

Output

Print two space-separated integers — the maximum number of days when Vasya can wear different socks and the number of days when he can wear the same socks until he either runs out of socks or cannot make a single pair from the socks he's got.

Keep in mind that at the end of the day Vasya throws away the socks that he's been wearing on that day.

Examples

Input

3 1


Output

1 1


Input

2 3


Output

2 0


Input

7 3


Output

3 2

Note

In the first sample Vasya can first put on one pair of different socks, after that he has two red socks left to wear on the second day.
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.math.BigInteger;
import java.util.StringTokenizer;

public class Main {
	static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
	static BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
	final static int MOD = 1000000007;
	static double start;

	public static void main(String[] args) throws Exception {

		start = System.currentTimeMillis();
		 long test = 1;
//		long test = strToLong(in.readLine().trim()); // if number of
		// test cases
		for (int i = 0; i < test; i++) {
			req();

		}

		out.flush();
		// System.out.println(System.currentTimeMillis() - start + " **");

		out.close();

	}

	

	public static void req() throws Exception {
		
		StringTokenizer st  = new StringTokenizer(in.readLine());
		int a = strToInt(st.nextToken());
		int b = strToInt(st.nextToken());
		
		if(a>b)
		{
			out.write(b +" " + (a-b)/2);
		}
		else
		{
			out.write(a +" " + (b-a)/2);
		}

	}

	// takes a string with spaces as input and produces an array of long of
	// length n
	// input should be valid
	// should know length of array beforehand
	static long[] splits(String s, int n) {

		long[] out = new long[n];
		int idx = 0;

		StringTokenizer ss = new StringTokenizer(s);
		while (ss.hasMoreTokens()) {

			out[idx] = strToLong(ss.nextToken());

			idx++;
		}

		return out;

	}

	// like split but first integer in input is nuumber of integer that
	// follows
	static long[] splits2(String s) {

		long[] out;
		int idx = 0;

		StringTokenizer ss = new StringTokenizer(s);
		int n = strToInt(ss.nextToken());
		out = new long[n];
		while (ss.hasMoreTokens()) {
			out[idx] = strToLong(ss.nextToken());

			idx++;
		}

		return out;

	}

	// returns gcd of two long parameters
	// i think its algo by euclid
	static long gcd(long a, long b) {

		return b == 0 ? a : gcd(b, a % b);
	}

	// returns maximum among two long
	public static long max(long a, long b) {
		return a > b ? a : b;
	}

	// modulus of product of two long parameter
	public static long modPro(long a, long b) {
		// check value of MOD , may vary for different questions
		// or change the function to take mod as an input parameter
		// tongue emoticon
		return ((a % MOD) * (b % MOD)) % MOD;
	}

	public static long modInv(long a) {
		return new BigInteger(a + "").modPow(new BigInteger((MOD - 2) + ""), new BigInteger(MOD + "")).longValue();
	}

	// returns minimum among two long
	public static long min(long a, long b) {
		return a < b ? a : b;
	}

	// take a string as input and convert it to an integer
	// takes care of negatives
	// no commas or space expected in string
	// copied from codechef
	public static int strToInt(String str) {
		int i = 0;
		int num = 0;
		boolean isNeg = false;
		// Check for negative sign; if it's there, set the isNeg flag
		if (str.charAt(0) == '-') {
			isNeg = true;
			i = 1;
		}
		// Process each character of the string;
		while (i < str.length()) {
			num *= 10;
			num += str.charAt(i++) - '0'; // Minus the ASCII code of
											// '0' to get
			// the value of the charAt(i++).
		}
		if (isNeg)
			num = -num;
		return num;
	}

	// take a string as input and convert it to a long
	// takes care of negatives
	// no commas or space expected in string
	// copied from codechef
	public static long strToLong(String str) {
		int i = 0;
		long num = 0;
		boolean isNeg = false;
		// Check for negative sign; if it's there, set the isNeg flag
		if (str.charAt(0) == '-') {
			isNeg = true;
			i = 1;
		}
		// Process each character of the string;
		while (i < str.length()) {
			num *= 10;
			num += str.charAt(i++) - '0'; // Minus the ASCII code of
											// '0' to get
			// the value of the charAt(i++).
		}
		if (isNeg)
			num = -num;
		return num;
	}

}
