Task 1


Task 2


Task 3

Output: