Implement a class Rectangle.
Implement a class Square that extends Rectangle.
Each line contains one of two figures in the next format:
Rectangle a b
Square a
Here a and b are sides of rectangle. In the case of a square a is its side.
For each figure print in one line its area and perimeter.