Added solution for Console IO