P21434 [HackerEarth] Today, Fredo went for shopping. There are N shops in the market. Each shop has its number. The shop numbers are in random order and two shops can have the same number. He is standing at
普及-
题目描述

Today, Fredo went for shopping. There are N shops in the market. Each shop has its number. The shop numbers are in random order and two shops can have the same number. He is standing at some ith shop.Now, he decides to visit only those shops which are left to the this ith shop and whose shop number is less than the shop number of ith shop(1 ≤ i ≤ N).
Tell him how many shops he can visit if he stands at some ith shop.

Input Format:

First line consists of an integer N denoting the number of shops in the market and next line contains N space separated integers denoting the shop numbers.

Output Format:

Print the answer asked for each i (1 ≤ i ≤ N).Print the values space separated.

Constraints:
1 ≤ N ≤ 1000000
1 ≤ S[i] ≤ 10^9 S[i] is the shop number of ith shop.

SAMPLE INPUT
5
5 1 2 2 14

SAMPLE OUTPUT
0 0 1 1 4

输入格式

见题面

输出格式

见题面

样例输入
22 893 748 901 261 997 526 636 504 707 721 454 924 105 135 679 20 547 150 265 616 36 179
样例输出
0 0 2 2 3 2 2 7 5 4 0 9 3 6 6 10 8 16 0 14 16 7 5 13 21 11 23 6 26 1 15 2 14 9 0 19 33 29 30 25 23 37 29 34 26 17 29 14 15 40 18 20 0 52 4 7 19 0 34 13 7 11 53 56 38 56 15 55 63 24 53 29 11 36 40 4 62 3 44 43 6 6 69 13 4 84 67 47 88 55 65 9 75 54 42 62 69 0 47 93 38 6 29 95 89 79 2 68 9 93 2 28 112 19 96 60 13 70 102 10 7 73 80 108 54 52 71 66 55 29 55 100 43 0 88 80 8 0 14 30 32 85 81 89 103 98 144 26 23 23 105 99 116 45 132 82 156 45 37 67 140 104 84 97 108 7 4 119 81 97 38 165 68 3 150 82 122 147 112 23 171 45 145 0 163 112 153 161 31 1 117 5 181 193 175 178 89 182 120 28 158 23 20 24 29 193 116 166 17 107 195 98 6 7 166 54 132 128 104 167 200 217 19 186 74 221 171 166 61 153 55 3 27 81 126 65 156 90 105 18 33 168 129 40 175 152 188 68 131 33 91 100 131 205 153 204 26 173 219 190 172 12 196 207 199 152 101 93 243 212 121 11 221 65 154 142 228 73 20 75 215 221 276 55 254 253 269 282 152 32 195 149 159 220 173 67 187 274 169 260 3 91 76 246 268 237 78 201 113 205 79 24 131 183 85 86 145 186 197 85 219 201 23 57 226 213 252 100 182 98 42 306 310 128 233 272 169 94 271 288 317 128 312 230 318 182 324 112 20 306 329 26 169 352 218 43 223 125 283 189 352 330 157 85 227 169 3 29 265 45 96 365 189 55 243 157 251 345 24 23 299 379 53 224 132 33 275 370 176 324 324 300 287 90 390 271 6 397 49 290 47 157 273 385 214 272 144 218 242 179 385 292 321 32 113 39 75 132 179 399 56 95 303 88 346 20 379 353 172 9 376 375 174 393 361 118 256 77 67 229 410 37 96 312 235 372 68 22 71 253 2 287 56 28 380 417 49 35 31 234 41 430 172 386 390 247 220 367 321 281 144 298 20 404 320 271 322 397 290 399 188 468 229 242 189 313 375 409 355 407 328 400 55 191 488 153 451 219 37 295 189 180 291 217 281 131 163 122 42 475 223 418 131 452 335 508 267 407 427 304 313 257 390 36 124 385 197 79 268 243 48 126 91 351 344 387 154 522 508 388 137 196 477 469 317 289 459 252 167 4 22 148 481 438 184 51 484 399 131 204 285 374 532 366 192 332 417 556 518 375 383 288 219 316 210 177 260 115 454 61 327 100 218 254 550 31 302 93 72 61 518 370 470 485 379 286 454 222 273 391 244 81 112 80 26 547 278 298 285 352 581 16 458 189 278 20 460 599 120 534 265 257 522 125 135 522 414 613 348 76 625 599 381 326 278 2 270 564 542 562 517 510 156 349 307 441 602 130 1 76 267 277 574 384 634 55 282 412 271 647 70 260 185 41 174 37 48 449 199 616 604 72 484 104 3 130 135 632 502 369 37 98 658 632 55 629 255 346 622 98 569 250 367 330 311 108 366 601 129 128 95 51 198 592 405 206 267 79 164 338 461 446 427 437 653 22 634 456 631 114 557 44 371 467 382 222 576 297 131 707 417 216 284 153 360 227 603 160 322 28 489 52 17 456 25 222 477 210 690 392 322 523 443 219 258 358 444 374 163 68 349 100 565 634 242 167