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

#SP0000116. Biểu diễn bằng nhiều số nguyên tố nhất (Bachgold Problem)

HỌC THEO LỘ TRÌNH

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

1 lộ trình

Biểu diễn bằng nhiều số nguyên tố nhất (Bachgold Problem)

Bachgold Problem

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

Given an integer n>1n>1, represent it as a sum of prime numbers. Repeated prime numbers are allowed. Among all such representations, maximize the number of summands.

A prime is an integer greater than 11 with exactly two positive divisors. The summands may appear in any order.

Input

One line containing integer nn.

Output

Print the maximum number of summands kk on the first line. On the second line print exactly kk primes whose sum is nn.

Subtasks

  • Subtask 1 (20 points): 2≤n≤302\le n\le30.
  • Subtask 2 (30 points): 2≤n≤20002\le n\le2000.
  • Subtask 3 (50 points): 2≤n≤1052\le n\le10^5.

Examples

Input

5

Output

2
2 3

Explanation

For n=5n=5, we have 5=2+35=2+3, which uses two primes. Three primes would sum to at least 2+2+2=6>52+2+2=6>5. Hence the maximum number of summands is k=2k=2, followed by 2 3.