// General imports

import java.util.Scanner;

public class MaximumAura {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    // Write code here

    int a = sc.nextInt();
    int[]input = new int[a];
    int[] left = new int[a];
    int[] right = new int[a];
    left[0] = 1;
    right[a-1] =1;
    for (int i = 0; i < a; i++) {
      input[i] =sc.nextInt();

    }

    for (int i = 1; i < input.length; i++) {
      int max = 0;
      for (int j =0; j < i; j++) {
        if (input[j]< input[i]) {
          max = Math.max(max, left[j]);
        }
      }
      left[i] = max +1;
    }

    for (int i = a-2; i >= 0; i--) {
      right[i] = 1;
      int max = 0;
      for (int j = a-1; j > i; j--) {
        if (input[j]< input[i]) {
          max = Math.max(max, right[j]);
        }
      }
      right[i] += max;
    }


    for (int i = 0; i < input.length; i++) {
      System.out.print((left[i]+right[i]-1)+" ");
    }

    sc.close();
  }
}
