Added solution for Ex-09 3.1 subtask