int n; cin >> n; for (int t = 1; t <= n; t++) { string s1, s2; cin >> s1 >> s2;
int n1 = 0, n2 = 0; for (int i = 0; i < s1.size(); i++) { n1 = n1 << 1; n1 += s1[i] - '0'; } for (int i = 0; i < s2.size(); i++) { n2 = n2 << 1; n2 += s2[i] - '0'; }
int tmp, a = max(n1, n2), b = min(n1, n2); while (tmp = a % b) { a = b; b = tmp; } if (b > 1) cout << "Pair #" << t << ": All you need is love!\n"; else cout << "Pair #" << t << ": Love is not all you need!\n"; } }