<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def distance(r1: 'Region', r2: 'Region'):
 """ Calculate distance between the x and y of the two regions."""

        return math.sqrt((r2.x - r1.x) ** 2 + (r2.y - r1.y) ** 2)