Playground

Playground

Input Preview:

Output: