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

#GL0000048. Kiểm tra tình yêu bằng UCLN số nhị phân (All You Need Is Love)

HỌC THEO LỘ TRÌNH

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

1 lộ trình

Kiểm tra tình yêu bằng UCLN số nhị phân (All You Need Is Love)

All You Need Is Love

Source: UVa

Version: Phuoc Hung OJ Extended

Problem Statement

Given two binary strings representing positive integers S1,S2S_1,S_2, test whether the two numbers have a common divisor greater than 11. Print the exact required phrase, using pair number 11.

Input

The first line contains S1S_1; the second line contains S2S_2.

Output

Print Pair #1: All you need is love! if the GCD is greater than 11; otherwise Pair #1: Love is not all you need!.

Subtasks

  • Subtask 1 (20 points): 1≤∣S1∣,∣S2∣≤101 \le \lvert S_1\rvert,\lvert S_2\rvert \le 10; Both strings represent positive binary integers.
  • Subtask 2 (30 points): 1≤∣S1∣,∣S2∣≤301 \le \lvert S_1\rvert,\lvert S_2\rvert \le 30; Both strings represent positive binary integers.
  • Subtask 3 (50 points): 1≤∣S1∣,∣S2∣≤311 \le \lvert S_1\rvert,\lvert S_2\rvert \le 31; Both strings represent positive binary integers.

Examples

Input

1100
1000

Output

Pair #1: All you need is love!

Explanation

The binary values are 1212 and 88 with GCD 4>14>1, so the first message applies.