nums = []
for i in range(int(input())):
temp = int(input())
temp = 10 if temp>= 10 else temp
nums.append(temp)
control = input()
if control == "1":
print(*[i**2 for i in nums])
elif control == "2":
print(sum(nums)/len(nums))
elif control == "3":
print(sorted(nums,reverse = True))
else:
print(len([i for i in nums if i%2==0]))