# Arup Guha
# 3/5/2022
# Solution to 2022 UCF HS Problem: A Very Hard Problem

# Get number of cases.
nC = int(input())

# Go through each case.
for loop in range(nC):

    # Get 4 numbers into a list.
    nums = [int(x) for x in input().split()]

    # Calculate both products.
    prod1 = nums[0]*nums[1]
    prod2 = nums[2]*nums[3]

    # Print larger product.
    print(max(prod1, prod2))
