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

#SP0000038. Phân tích mã bí mật (Code Refactoring)

HỌC THEO LỘ TRÌNH

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

1 lộ trình

Phân tích mã bí mật (Code Refactoring)

Code Refactoring

Source: UVa

Version: Phuoc Hung OJ Extended

Problem Statement

Alicia and Bobby use a positive integer KK as a secret encryption code. Yvette can break it by expressing the same KK as a product of two integers greater than 11 in two different ways.

Find four pairwise distinct integers A,B,C,DA,B,C,D, all greater than 11, such that K=A⋅B=C⋅DK=A\cdot B=C\cdot D. A solution is guaranteed to exist. Any valid answer is accepted.

Input

One line containing KK; at least two factor pairs satisfying the requirements are guaranteed to exist.

Output

Print exactly one line in the form Case #1: K = A * B = C * D, where A,B,C,D>1A,B,C,D>1 are pairwise distinct. Use the literal * and = symbols.

Subtasks

  • Subtask 1 (20 points): 12≤K≤10412\le K\le 10^4; bảo đảm tồn tại A,B,C,D>1A,B,C,D>1 đôi một khác nhau với K=AB=CDK=AB=CD.
  • Subtask 2 (30 points): 12≤K≤10612\le K\le 10^6; bảo đảm tồn tại A,B,C,D>1A,B,C,D>1 đôi một khác nhau với K=AB=CDK=AB=CD.
  • Subtask 3 (50 points): 12≤K≤10712\le K\le 10^7; bảo đảm tồn tại A,B,C,D>1A,B,C,D>1 đôi một khác nhau với K=AB=CDK=AB=CD.

Examples

Input

120

Output

Case #1: 120 = 2 * 60 = 3 * 40

Explanation

The two products 2⋅602\cdot60 and 3⋅403\cdot40 both equal 120120. The factors 2,60,3,402,60,3,40 are all greater than 11 and pairwise distinct.

Input

210

Output

Case #1: 210 = 2 * 105 = 3 * 70

Explanation

Both 2⋅105=2102\cdot105=210 and 3⋅70=2103\cdot70=210, and the four integers are pairwise distinct, so this output is valid.