Pattern

Input


Sample code


Ref: W3school