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

#GL0000107. Cặp số có ƯCLN cho trước (Problem about GCD)

HỌC THEO LỘ TRÌNH

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

1 lộ trình

Cặp số có ƯCLN cho trước (Problem about GCD)

Problem about GCD

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

Given l,r,Gl,r,G, find integers A,BA,B satisfying l≤A≤B≤rl\le A\le B\le r and gcd⁡(A,B)=G\gcd(A,B)=G, maximizing B−AB-A. Break ties by choosing the smallest AA. Print -1 -1 if no such pair exists. The equality A=BA=B is allowed.

Input

One line containing l,r,Gl,r,G.

Output

Print the optimal pair A,BA,B, or -1 -1 if no pair exists.

Subtasks

  • Subtask 1 (20 points): 1≤l≤r≤1041\le l\le r\le10^4, 1≤G≤1041\le G\le10^4.
  • Subtask 2 (30 points): 1≤l≤r≤1091\le l\le r\le10^9, 1≤G≤1091\le G\le10^9.
  • Subtask 3 (50 points): 1≤l≤r≤10181\le l\le r\le10^{18}, 1≤G≤10181\le G\le10^{18}.

Examples

Input

4 8 2

Output

4 6

Explanation

The multiples of 22 in the interval are 4,6,84,6,8. The pair (4,8)(4,8) has GCD 44 and is invalid. The pair (4,6)(4,6) has GCD 22 and the maximum possible distance 22.