import java.util.*; public class Main{ static final int MOD = (int)1e9+7; static HashMap memo; public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = Integer.parseInt(sc.next()); int[] a = new int[n]; for(int i=0; i 0 && (b[i]>>32) != (b[i - 1]>>32)){ p++; } ret[(int)(b[i]>>32)] = p; } return ret; } } class BinaryIndexedTree{ int size; long[] tree; public BinaryIndexedTree(int n){ this.size = n; this.tree = new long[n+1]; } public long sum(int i){ long s = 0L; while(0