#C13354. Subsequence Digits Generator

    ID: 42883 Type: Default 1000ms 256MiB

Subsequence Digits Generator

Subsequence Digits Generator

Given a positive integer \(n\), your task is to generate all the subsequences of its digits. A subsequence is defined as a sequence that can be derived by deleting zero or more digits from the number without changing the order of the remaining digits. Note that the subsequences are not required to be contiguous.

For example, if \(n = 123\), the subsequences are:

(1,; 2,; 3,; 12,; 13,; 23,; 123)

Your solution should output all unique subsequences (each interpreted as an integer) in ascending order. If a subsequence starts with zero (e.g. coming from \(102\)), it should be interpreted as \(0\) (for a single digit) or, when combined with other digits, the usual numeric value (e.g. \(10, 12, 102\)).

inputFormat

The input consists of a single line containing a positive integer \(n\) provided via the standard input.

outputFormat

Output all unique subsequences (interpreted as integers) in ascending order, separated by a single space, via the standard output.

## sample
1
1