#sdpsgssolutions #Missing Mango #AIO 2017 (Intermediate) # Open the input and output files. inputFile = open("manin.txt", "r") outputFile = open("manout.txt", "w") # Read how many numbers there will be myInput = inputFile.readline().split() Ix = int(myInput[0]) Cx = int(myInput[1]) Id = int(myInput[2]) Cd = int(myInput[3]) # Possible Positions around Ishraq position1 = Ix + Id position2 = Ix - Id # Possible Positions around Clement position3 = Cx + Cd position4 = Cx - Cd # Finalise Positions if position1 == position3: position = position1 elif position1 == position4: position = position1 elif position2 == position3: position = position2 else: position = position2 outputFile.write(str(position)) # Finally, close the input/output files. inputFile.close() outputFile.close()