import java.util.ArrayList; import java.util.HashMap; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int N = scan.nextInt(); int list[] = new int[N]; HashMap> pathMap = new HashMap<>(); int max = 0; int min = Integer.MAX_VALUE; for(int i=0; i array = pathMap.get(a); if( array == null) { array = new ArrayList<>(); array.add(i); pathMap.put(a, array); } else { array.add(i); pathMap.put(a, array); } } for(int t=min; t<=max; t++) { ArrayList array = pathMap.get(t); if(array == null) continue; if(array.size() == 1) { int index = array.get(0); list[index] = t; } else if(array.size() == 2) { int from = array.get(0); int to = array.get(1); for(int i=from; i<=to; i++) { list[i] = t; } } } for(int i=0; i