class Rectangle:
    def __init__(self, width, height):
        self.width = width
        self.height = height
    def set_width(self, new_width):
        self.width = new_width
    def set_height(self, new_height):
        self.height = new_height
    def get_area(self):
        area = self.width * self.height
        return area
    def get_perimeter(self):
        perimeter = 2 * self.width + 2 * self.height
        return perimeter
    def get_diagonal(self):
        diagonal = (self.width ** 2 + self.height ** 2) ** .5
        return diagonal
    def get_picture(self):
        if self.width > 50 or self.height > 50:
            return "Too big for picture."
        line = "*" * self.width
        picture = (line + "\n") * self.height
        return picture
    def get_amount_inside(self, other_shape):
        w_num = int(self.width / other_shape.width)
        h_num = int(self.height / other_shape.height)
        amount = w_num * h_num
        return amount
    def __str__(self):
        about = "Rectangle(width="+str(self.width)+", height="+str(self.height)+")"
        return about

class Square(Rectangle):
    def __init__(self, length):
        self.width = length
        self.height = length
        self.side = length
    def set_side(self, new_length):
        self.width = new_length
        self.height = new_length
        self.side = new_length
    def __str__(self):
        about = "Square(side="+str(self.side)+")"
        return about
    def set_width(self, new_width):
        self.width = new_width
        self.height = new_width
        self.side = new_width
    def set_height(self, new_height):
        self.width = new_height
        self.height = new_height
        self.side = new_height
