<｜begin▁of▁sentence｜>### Instruction:
As an archaeologist, while analyzing the layout of an ancient settlement, you come across a rectangular structure with an initial position at coordinates (10, 20) and dimensions of 50 units in width and 40 units in height. In order to understand how the space within the structure was utilized, you want to create a smaller rectangle inside it through the use of a contraction method. This smaller rectangle will be formed by reducing the dimensions of the original rectangle by 5 units from both the left and right sides, and 2 units from both the top and bottom sides. This will aid in determining the potential functional areas within the settlement.
### Response:
from Rectangle import Rectangle

# Create a Rectangle object
rect = Rectangle(10, 20, 50, 40)

# Define the margins to contract
left_margin = 5
right_margin = 5
top_margin = 2
bottom_margin = 2

# Contract the rectangle
contracted_rect = rect.contract(left_margin, top_margin, right_margin, bottom_margin)

# Print the dimensions of the contracted rectangle
print(contracted_rect)
<|EOT|>
