#-----------------------------------------------------------------------
#                       Inputs
#-----------------------------------------------------------------------

#Primer producto
NombrePrimerProducto = str(input("Nombre del 1er producto: "))
PrecioPrimerProducto = int(input("Precio del 1er prodcuto: "))
CantidadPrimerProducto = int(input("Cantidad a 1er comprar: "))

#Segundo Producto
NombreSegundoProducto = str(input("Nombre del 2do producto: "))
PrecioSegundoProducto = int(input("Precio del 2do producto: "))
CantidadSegundoProducto = int(input("Cantidad a comprar: "))

#Tercer Producto
NombreTercerProducto = str(input("Nombre del 3er producto: "))
PrecioTercerProducto = int(input("Precio del 3er producto: "))
CantidadTercerProducto = int(input("Cantidad a comprar: "))

#Descuento por aplicar
DescuentoAplicable = int(input("Descuento aplicable: %"))

#Impuestos
Impuesto = int(input("Impuestos: % "))

#______________________________________________________________________
#                   Subtotales
#______________________________________________________________________

print("____________________________________________________________________")

#Subtotal del primer producto
Subtotal_PrimerProducto = PrecioPrimerProducto * CantidadPrimerProducto
print("Subtotal primer producto: "+ str(Subtotal_PrimerProducto))

#Subtotal del segundo producto
Subtotal_SegundoProducto = PrecioSegundoProducto * CantidadSegundoProducto
print("Subtotal segundo producto: " + str(Subtotal_SegundoProducto))

#Subtotal del primer producto
Subtotal_TercerProducto = PrecioTercerProducto * CantidadTercerProducto
print("Subtotal tercer producto: "+ str(Subtotal_TercerProducto))

#Subtotal General
Subtotal_General = Subtotal_PrimerProducto + Subtotal_SegundoProducto + Subtotal_TercerProducto
print("______________________________________________________________________")
print("Subtotal: " + str(Subtotal_General))

#___________________________________________________________________________
#                       Descuentos
#____________________________________________________________________________
DescuentoTotal = Subtotal_General * (DescuentoAplicable/100)
SubtotalConDescuento = Subtotal_General - DescuentoTotal

#____________________________________________________________________________
#                       Impuestos
#_____________________________________________________________________________
TotalImpuesto = Subtotal_General * (Impuesto/100)

#____________________________________________________________________________
#                       Total Final
#____________________________________________________________________________
TotalFinal = SubtotalConDescuento + TotalImpuesto

#___________________________________________________________________________
#               Generacion de factura
#___________________________________________________________________________

print("=======================FACTURA===============================")
print("Producto 1: " + str(NombrePrimerProducto))
print("Cantidad: " + str(CantidadPrimerProducto))
print("Cantidad del producto 1: " + str(CantidadPrimerProducto))
print("Subtotal: " + str(Subtotal_PrimerProducto))
print("___________________________________________________________")
print("Producto 2: " + str(NombreSegundoProducto))
print("Cantidad: " + str(CantidadSegundoProducto))
print("Cantidad del producto2: " + str(CantidadSegundoProducto))
print("Subtotal: " + str(Subtotal_SegundoProducto))
print("___________________________________________________________")
print("Producto 3: " + str(NombreTercerProducto))
print("Cantidad: " + str(CantidadTercerProducto))
print("Cantidad del producto 3: " + str(CantidadTercerProducto))
print("Subtotal: " + str(Subtotal_SegundoProducto))
print("___________________________________________________________")
print("Subtotal sin descuento/impuesto: " + str(Subtotal_General))
print("Descuento: " + str(DescuentoTotal))
print("Subtotal con descuento: " + str(SubtotalConDescuento))
print("Impuesto: " + str(TotalImpuesto)) 
print("TOTAL A PAGAR: " + str (TotalFinal))
print("=============================================================")