Yo`nalishlar
Hozirda online

Statistika

Masalalar soni: 909

Foydalanuvchilar soni: 8819

Jo'natishlar soni: 714352

Muhokama yozuvlari: 4541

Yangiliklar soni: 97

Yangiliklar izohlari: 1174


So'ngi izohlar

778. Task
Vaqt limiti: 1 sekund
Xotira limiti: 64 MB

Your task in this problem is to find the sum of integer numbers from 1 to N witch are divisible by A or B, and print the sum modulo 1000000007(109+7).

Input

On first line given numbers N, A, B(1≤N,A,B≤1018).

Output

Print required sum modulo 1000000007.

Samples

Input

Output

1

7 2 3

15

Note

Numbers, divisible by 2: 2, 4, 6. Numbers, divisible by 3: 3, 6.

Sum of these numbers: 2 + 3 + 4 + 6 = 15

 

Tayyorladi: Azat Yusupov
Mening urinishlarim(0) Muhokama (0) Jo'natish Eng yaxshi yechimlar Barcha muvaffaqiyatli urinishlar(44) Barcha urinishlar(331)