Problem: Phoenix is trying to take a photo of his n friends with labels 1, 2, ..., n who are lined up in a row in a special order. But before he can take the photo, his friends get distracted by a duck and mess up their order.

Now, Phoenix must restore the order but he doesn't remember completely! He only remembers that the i-th friend from the left had a label between a_i and b_i inclusive. Does there exist a unique way to order his friends based of his memory? 

Input

The first line contains one integer n (1 ≤ n ≤ 2⋅10^5) — the number of friends.

The i-th of the next n lines contain two integers a_i and b_i (1 ≤ a_i ≤ b_i ≤ n) — Phoenix's memory of the i-th position from the left.

It is guaranteed that Phoenix's memory is valid so there is at least one valid ordering.

Output

If Phoenix can reorder his friends in a unique order, print YES followed by n integers — the i-th integer should be the label of the i-th friend from the left.

Otherwise, print NO. Then, print any two distinct valid orderings on the following two lines. If are multiple solutions, print any.

Examples

Input


4
4 4
1 3
2 4
3 4


Output


YES
4 1 2 3 


Input


4
1 3
2 4
3 4
2 3


Output


NO
1 3 4 2 
1 2 4 3 

Solution (in JAVA):

Solution:

import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.*;

public class Solution {
    int n;
    PriorityQueue<Integer[]> pq;
    List<Integer[]> rs;
    int[][] rs0;

    void solve() throws Exception {
        int ri = 0;
        int[] res = new int[n+1];
        int[] peoplePos = new int[n+1];
        int[] res1 = new int[n+1];
        boolean f = true;
        int idx = -1;
        for(int i=1; i<=n; i++){
            while(ri < n && rs.get(ri)[0] <= i){
                pq.add(rs.get(ri));
                ri++;
            }

            Integer[] r = pq.poll();
            res[r[2]] = i;
        }

        StringBuilder sb = new StringBuilder();
        for(int i=1; i<=n; i++){
            res1[i] = res[i];
            peoplePos[res[i]] = i;
            sb.append(res[i]); sb.append(" ");
        }
        sb.append("\n");

        Collections.sort(rs, new Comparator<Integer[]>() {
            @Override
            public int compare(Integer[] o1, Integer[] o2) {
                return o1[1] - o2[1];
            }
        });

        for(int i=1; i<n; i++){
            int p0 = rs.get(i-1)[2], p1 = rs.get(i)[2];
            int people0 = res[p0], people1 = res[p1];
            int b0 = rs0[p0-1][0], e0 = rs0[p0-1][1];
            int b1 = rs0[p1-1][0], e1 = rs0[p1-1][1];
            if(people0 >= b1 && people0 <= e1 && people1 >= b0 && people1 <= e0){
                f = false;
                int t = res1[p0]; res1[p0] = res1[p1]; res1[p1] = t;
                for(int j=1; j<=n; j++){
                    sb.append(res1[j]); sb.append(" ");
                }
                break;
            }
        }

        if(f) {
            for (int p = 2; p <= n; p++) {
                int p0 = p - 1;
                int pos = peoplePos[p], pos0 = peoplePos[p0];
                int b = rs0[pos - 1][0], e = rs0[pos - 1][1];
                int b0 = rs0[pos0 - 1][0], e0 = rs0[pos0 - 1][1];

                if (p >= b0 && p <= e0 && p0 >= b && p0 <= e) {
                    f = false;
                    int t = res1[pos];
                    res1[pos] = res1[pos0];
                    res1[pos0] = t;
                    sb.append("\n");
                    for (int i = 1; i <= n; i++) {
                        sb.append(res1[i]);
                        sb.append(" ");
                    }
                    break;
                }
            }
        }

        System.out.println(f?"YES":"NO");
        System.out.println(sb.toString());
    }

    public Solution() throws Exception {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer sk = new StringTokenizer(reader.readLine());
        n = Integer.parseInt(sk.nextToken());
        pq = new PriorityQueue<>(new Comparator<Integer[]>() {
            @Override
            public int compare(Integer[] o1, Integer[] o2) {
                return o1[1] - o2[1];
            }
        });
        rs = new ArrayList<>();
        rs0 = new int[n][2];
        for(int i=0; i<n; i++){
            sk = new StringTokenizer(reader.readLine());
            int b = Integer.parseInt(sk.nextToken());
            int e = Integer.parseInt(sk.nextToken());
            rs0[i][0] = b; rs0[i][1] = e;
            rs.add(new Integer[]{b ,e, i+1});
        }

        Collections.sort(rs, new Comparator<Integer[]>() {
            @Override
            public int compare(Integer[] o1, Integer[] o2) {
                return o1[0] - o2[0];
            }
        });



        solve();
    }

    public static void main(String[] args) throws Exception {
        Solution s = new Solution();
    }
}