#Tyler Woodhull
#TestMovie.py
#7/16/13

from Movie import Movie

file = open("movie.in")

firstLine = file.readline().split()

movie1 = Movie(firstLine[0], float(firstLine[1]))
movie2 = movie1.makeSequel()

args = int(file.readline())

for i in range(args):
    line = file.readline().split()
    
    if line[0] == "1":
        movie1.sellTickets(int(line[1]))
        print(movie1.title+" sold "+line[1]+" tickets and has currently made",movie1.grossRevenue,"dollars.")
    if line[0] == "2":
        movie2.sellTickets(int(line[1]))
        print(movie2.title+" sold "+line[1]+" tickets and has currently made",movie2.grossRevenue,"dollars.")
    if line[0] == "3":
        movie1.giveFreeTickets(int(line[1]))
        print(movie1.title+" gave away "+line[1]+" tickets and has had",movie1.numViewers,"number of viewers.")
    if line[0] == "4":
        movie2.giveFreeTickets(int(line[1]))
        print(movie2.title+" gave away "+line[1]+" tickets and has had",movie2.numViewers,"number of viewers.")
    if line[0] == "5":
        movie1.upTicketPrice(float(line[1]))
        print("The ticket price for "+movie1.title+" has risen to",movie1.ticketPrice," dollars.")
    if line[0] == "6":
        movie2.upTicketPrice(float(line[1]))
        print("The ticket price for "+movie2.title+" has risen to",movie2.ticketPrice," dollars.")
    if line[0] == "7":
        movie1.moveToDollarTheater()
        print(movie1.title+" has gone to the dollar theater!")
    if line[0] == "8":
        movie2.moveToDollarTheater()
        print(movie2.title+" has gone to the dollar theater!")
        
print()
print(movie1)
print(movie2)

if movie1.bigHit():
    print(movie1.title+" was a big hit!")
else:
    print(movie1.title+" was not a big hit.")
    
if movie2.bigHit():
    print(movie2.title+" was a big hit!")
else:
    print(movie2.title+" was not a big hit.")
    
compare = movie1.compareTo(movie2)

if(compare == 1):
    print(movie1.title+" beats "+movie2.title)
elif(compare == -1):
    print(movie2.title+" beats "+movie1.title)
else:
    print(movie1.title+" tied with "+movie2.title)