Template code:
Output: