Implement abstract class Shape.
Implement classes Rectangle, Triangle that extend Shape.
Implement class Square that extends Rectangle.
Each line contains one of three types of figures in the next format:
Square a
Rectangle a b
Triangle a b c
For each figure print in a separate line its perimeter and area.