Problem Description

Read n integers. Compress as pairs value count for consecutive equal values. Output pairs in new lines.

Input Format

First line n. Second line n integers.

Output Format

Lines: value count.

Sample Test Case

Input:
8 1 1 2 2 2 3 3 1
Output:
1 2 2 3 3 2 1 1

Constraints

1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next