records = []

while True:
    print("\n===== Movie Ticket Booking System =====")
    print("1. Add Record")
    print("2. View All Records")
    print("3. Search Record")
    print("4. Update Record")
    print("5. Delete Record")
    print("6. Exit")

    choice = input("Please choose an option: ")

    if choice == "1":
        if len(records) >= 100:
            print("Cannot add more items. Storage is full.")
            continue
        record = {}
        record["movie"] = input("Enter Movie Name: ")
        record["customer"] = input("Enter Customer Name: ")
        record["seats"] = int(input("Enter Seats: "))
        records.append(record)
        print("Added successfully!")

    elif choice == "2":
        if len(records) == 0:
            print("No Records Found.")
        else:
            print("\n===== Records (Movie Name | Customer Name | Seats) =====")
            for i, record in enumerate(records):
                print(f"{i + 1}. " + str(record["movie"]) + " | " + str(record["customer"]) + " | " + str(record["seats"]))

    elif choice == "3":
        key = input("Enter Movie Name to Search: ")
        found = False
        for record in records:
            if record["movie"] == key:
                print("Found: " + str(record["movie"]) + " | " + str(record["customer"]) + " | " + str(record["seats"]))
                found = True
        if not found:
            print("No matching record was found.")

    elif choice == "4":
        key = input("Enter Movie Name to Update: ")
        found = False
        for i in range(len(records)):
            if records[i]["movie"] == key:
                records[i]["movie"] = input("Enter New Movie Name: ")
                records[i]["customer"] = input("Enter New Customer Name: ")
                records[i]["seats"] = int(input("Enter New Seats: "))
                print("Updated successfully!")
                found = True
                break
        if not found:
            print("No matching record was found.")

    elif choice == "5":
        key = input("Enter Movie Name to Delete: ")
        found = False
        for i in range(len(records)):
            if records[i]["movie"] == key:
                records.pop(i)
                print("Deleted successfully!")
                found = True
                break
        if not found:
            print("No matching record was found.")

    elif choice == "6":
        print("Thank You for Using Movie Ticket Booking System.")
        break

    else:
        print("Invalid Choice.")