def int_to_roman(num: int) -> str:
    if num < 1 or num > 3999:
        return "Please enter an integer between 1 and 3999."
    
    # Map of Roman symbols and their equivalent values
    val = [
        1000, 900, 500, 400,
        100, 90, 50, 40,
        10, 9, 5, 4,
        1
    ]
    syb = [
        "M", "CM", "D", "CD",
        "C", "XC", "L", "XL",
        "X", "IX", "V", "IV",
        "I"
    ]
    roman_num = ''
    i = 0
    while num > 0:
        for _ in range(num // val[i]):
            roman_num += syb[i]
            num -= val[i]
        i += 1
    return roman_num

#Getting input from the user
input_num = int(input("Enter an integer to convert it to a roman number (between 1 and 3999): "))

#Call the function and view the result
output_roman = int_to_roman(input_num)
print(f"The Roman numeral equivalent of the number {input_num} is: {output_roman}")
