Help me in solving PSPP77 problem

My issue

explain this

My code

# Solution as follows

for _ in range(3):
    A, B = map(int, input().split())
    C = A**2 + B**3 + (A**2 + B**3)**2 + (A**2 + B**3)**3
    print(C)

Learning course: Learn Python
Problem Link: CodeChef: Practical coding for everyone

@vinayaluguru
The for loop will run 3 times and each time it will take two inputs A and B and with them we calculate C and then print C.