PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#SCKT0000001. Chia hết cho 3 nhưng không chia hết cho 5 (Multiples of 3 but Not 5)

Bài tập này chưa được xếp vào lộ trình.

Chia hết cho 3 nhưng không chia hết cho 5 (Multiples of 3 but Not 5)

Multiples of 3 but Not 5

Version: Phuoc Hung OJ Extended

Problem Statement

You are given a positive integer nn.

Consider every integer xx from 11 to nn. An integer xx is selected if both of the following conditions hold:

  • xx is divisible by 33;
  • xx is not divisible by 55.

Equivalently, find all integers xx satisfying

$$1 \le x \le n,\qquad x \bmod 3 = 0,\qquad x \bmod 5 \ne 0.$$

Print all selected integers in increasing order.

Input

One line containing the integer nn.

Output

Print all integers satisfying the conditions on one line, in increasing order. Consecutive numbers must be separated by exactly one space.

If no integer satisfies the conditions, print an empty line.

Subtasks

  • Subtask 1 (20%): 1≤n≤501 \le n \le 50.
  • Subtask 2 (30%): 1≤n≤10001 \le n \le 1000.
  • Subtask 3 (50%): 1≤n≤100001 \le n \le 10000.

Examples

Input

20

Output

3 6 9 12 18

Explanation

The multiples of 33 in [1,20][1,20] are 3,6,9,12,15,183,6,9,12,15,18. The number 1515 is also divisible by 55, so it is excluded. Therefore the answer is 3,6,9,12,183,6,9,12,18.