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

#GL0000054. Chu kỳ trúng thưởng (Jackpot)

HỌC THEO LỘ TRÌNH

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

1 lộ trình

Chu kỳ trúng thưởng (Jackpot)

Jackpot

Source: Kattis

Version: Phuoc Hung OJ Extended

Problem Statement

A slot machine has w wheels. Wheel i shows the jackpot symbol periodically, once every p_i plays, with all wheels initially aligned at play zero. Find the smallest positive number of plays until all wheels show the jackpot symbol simultaneously again. If it exceeds one billion, print the exact phrase More than a billion.

Input

First line: w. Second line: w positive integers p_i.

Output

The positive common period, or the exact string More than a billion. if it exceeds 10^9.

Subtasks

  • Subtask 1 (20 points): 1≤w≤51\le w\le 5, 1≤pi≤201\le p_i\le 20.
  • Subtask 2 (30 points): 1≤w≤51\le w\le 5, 1≤pi≤1001\le p_i\le 100.
  • Subtask 3 (50 points): 1≤w≤51\le w\le 5, 1≤pi≤10001\le p_i\le 1000.

Examples

Input

3
10 6 15

Output

30

Explanation

The smallest positive common multiple of 10, 6, and 15 is 30.