atcoder#NIKKEI2019QUALA. Subscribers

Subscribers

Score : 100100 points

Problem Statement

We conducted a survey on newspaper subscriptions. More specifically, we asked each of the NN respondents the following two questions:

  • Question 11: Are you subscribing to Newspaper X?
  • Question 22: Are you subscribing to Newspaper Y?

As the result, AA respondents answered "yes" to Question 11, and BB respondents answered "yes" to Question 22.

What are the maximum possible number and the minimum possible number of respondents subscribing to both newspapers X and Y?

Write a program to answer this question.

Constraints

  • 1N1001 \leq N \leq 100
  • 0AN0 \leq A \leq N
  • 0BN0 \leq B \leq N
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

NN AA BB

Output

Print the maximum possible number and the minimum possible number of respondents subscribing to both newspapers, in this order, with a space in between.

10 3 5
3 0

In this sample, out of the 1010 respondents, 33 answered they are subscribing to Newspaper X, and 55 answered they are subscribing to Newspaper Y.

Here, the number of respondents subscribing to both newspapers is at most 33 and at least 00.

10 7 5
5 2

In this sample, out of the 1010 respondents, 77 answered they are subscribing to Newspaper X, and 55 answered they are subscribing to Newspaper Y.

Here, the number of respondents subscribing to both newspapers is at most 55 and at least 22.

100 100 100
100 100