task4 with median of means of groups