Code:

CurLine: Sample:

Output: