#CCBCHBA0000097. Growing Sequences

Growing Sequences

Growing Sequences

Source: beecrowd

Version: Phuoc Hung OJ Extended

Problem Statement

Read successive integers nn. For every positive nn, print one line containing integers 1 through nn in ascending order, separated by single spaces. Stop immediately at the first zero and produce no output line for that sentinel. Preserve the order of positive inputs.

Input

Several lines, each containing integer nn. At least one positive value appears before the terminating zero.

Output

For each positive value before zero, print its sequence on one line. Print nothing for the sentinel.

Subtasks

  • Subtask 1 (20%): All positive values obey 1≤n≤31\le n\le 3; at most 3 values precede the terminating zero.

  • Subtask 2 (30%): All positive values obey 1≤n≤121\le n\le 12; at most 8 values precede the terminating zero.

  • Subtask 3 (50%): All positive values obey 1≤n≤10001\le n\le 1000; at most 25 values precede the terminating zero.

Examples

Example 1

Input:

3
1
4
0

Output:

1 2 3
1
1 2 3 4

Explanation:

Each positive input produces a line 1 through n. Zero ends the input and produces no line. For this sample, the input is 3, 1, 4, 0; the displayed rows follow these rules exactly.

Example 2

Input:

2
0

Output:

1 2

Explanation:

Each positive input produces a line 1 through n. Zero ends the input and produces no line. For this sample, the input is 2, 0; the displayed rows follow these rules exactly.