Little Petya very much likes arrays consisting of *n* integers, where each of them is in the range from 1 to 10<sup class="upper-index">9</sup>, inclusive. Recently he has received one such array as a gift from his mother. Petya didn't like it at once. He decided to choose exactly one element from the array and replace it with another integer that also lies in the range from 1 to 10<sup class="upper-index">9</sup>, inclusive. It is not allowed to replace a number with itself or to change no number at all. 

After the replacement Petya sorted the array by the numbers' non-decreasing. Now he wants to know for each position: what minimum number could occupy it after the replacement and the sorting.
The first line contains a single integer *n* (1 ≤ *n* ≤ 10<sup class="upper-index">5</sup>), which represents how many numbers the array has. The next line contains *n* space-separated integers — the array's description. All elements of the array lie in the range from 1 to 10<sup class="upper-index">9</sup>, inclusive.
5
1 2 3 4 5
1 1 2 3 4
5
2 3 4 5 6
1 2 3 4 5
3
2 2 2
1 2 2
4
1 1 2 3
1 1 1 2
3
1 1 1
1 1 2
10
5 6 1 2 3 1 3 45 7 1000000000
1 1 1 2 3 3 5 6 7 45
4
1000000000 234765 3485636 385634876
1 234765 3485636 385634876
1
1
2
25
1 1 1 2 2 2 1 2 1 2 2 2 2 2 1 2 2 2 1 2 2 2 2 1 2
1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
2
2 1
1 1
3
1 2 1
1 1 1
1
2
1
1
4
1
3
1 1 2
1 1 1
2
1 2
1 1
2
1 3
1 1
2
1 1
1 2
2
5 5
1 5
1
5
1
//satyaki3794
#include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <algorithm>
#include <climits>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <cctype>
#include <cassert>
#include <bitset>
#define gc getchar_unlocked
#define pc putchar_unlocked
#define PI (3.14159265)
#define ff first
#define ss second
#define pb push_back
#define MOD (1000000007LL)
#define INF (100000005)
#define SIZE (2)
#define TREESIZE (302144)
#define LEFT(n) (2*n)
#define RIGHT(n) (2*n+1)
#define epsilon 1e8 //add to double before casting to integer
 
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> ii;
typedef pair<ii, int> iii;


// #define matrix vector< vector<ll> >

// matrix mul(matrix &a, matrix &b){
//     int i, j, k, n = a.size();
//     matrix ans (n, vector<ll>(n));
//     for(i=0;i<n;i++)
//         for(j=0;j<n;j++){
//             ll temp = 0;
//             for(k=0;k<n;k++)    temp = (temp + a[i][k] * b[k][j]) % MOD;
//             ans[i][j] = temp;
//         }

//     return ans;
// }

// matrix pwr(matrix &a, ll p){
//     int n = a.size();
//     matrix ans(n, vector<ll> (n));
//     for(int i=0;i<n;i++)    ans[i][i] = 1;

//     while(p){
//         if(p&1) ans = mul(ans, a);

//         a = mul(a, a);
//         p >>= 1;
//     }
//     return ans;
// }


ll pwr(ll base, ll p, ll mod = MOD){
    ll ans = 1;
    while(p){
        if(p & 1)   ans = (ans * base) % mod;
        base = (base * base) % mod;
        p /= 2;
    }
    return ans;
}

ll gcd(ll a, ll b){
    if(b == 0)  return a;
    return gcd(b, a%b);
}


ll lcm(ll a, ll b){
    return (a*b) / gcd(a, b);
}


ll arr[100005];


int main()
{
    ios_base::sync_with_stdio(0);
    // freopen("input.txt", "r", stdin);

    int n;
    cin>>n;

    for(int i=1;i<=n;i++)   cin>>arr[i];
    sort(arr+1, arr+n+1);

    arr[0] = 1;
    for(int i=1;i<=n;i++)
        cout<<arr[i-1]<<" ";

    return 0;
}










