Answer
The output of the program will be:
B's __init__() invoked
B's __new__() invoked
A''s __init__() invoked
A's __new__() invoked
Work Step by Step
Here the __new__ function is invoked first when the class is created but the __init__ is called before printing the value in new so the value of __init__ prints first then after that the print function of new is called.