Energy relaxation of resonantly excited polaritons in semiconductor microcavities