n = gets.to_i
arr, hsh1, hsh2 = Array.new, Hash.new(0), Hash.new(0)
n.times{
    arr << gets.to_f
    hsh1[arr.last] += 1
}
sum = 0
hsh1.to_a.sort_by{|k, v| k}.each{|k, v|
    hsh2[k] += sum * 3 + v - 1
    sum += v
}
arr.each{|x| puts hsh2[x]}
