Algorithm class(3rd summer)