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

#SP0000130. Biểu diễn thành tổng bốn nguyên tố (Summation of Four Primes)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Biểu diễn thành tổng bốn nguyên tố (Summation of Four Primes)

Summation of Four Primes

Source: UVa

Version: Phuoc Hung OJ Extended

Problem Statement

Given a positive integer nn, find four positive primes p1,p2,p3,p4p_1,p_2,p_3,p_4 (repetitions allowed) such that p1+p2+p3+p4=np_1+p_2+p_3+p_4=n. The primes need not be distinct or sorted. If it is impossible, report impossibility.

Input

One line containing the integer nn.

Output

If a representation exists, print four space-separated primes whose sum is nn. Any valid representation is accepted. Otherwise, print exactly Impossible..

Subtasks

  • Subtask 1 (20 points): 1≤n≤1001\le n\le 100.
  • Subtask 2 (30 points): 1≤n≤100001\le n\le 10000.
  • Subtask 3 (50 points): 1≤n≤100000001\le n\le 10000000.

Examples

Input

24

Output

2 2 3 17

Explanation

For n=24n=24, 2+2+3+17=242+2+3+17=24. Each of 22, 33 and 1717 is prime, and 22 may appear twice. Thus 2 2 3 17 is valid, although other representations are also allowed.