using System.Collections.Generic;
private string firstname;
public Human(string firstname,string lastname, int yearsold)
this.firstname=firstname;
get{return this.firstname;}
set{this.firstname=value;}
get{return this.lastname;}
set{this.lastname=value;}
get{return this.yearsold;}
set{this.yearsold=value;}
Console.WriteLine("Hello, {0} {1}.\nYou are {2} years old.\n", this.firstname, this.lastname, this.yearsold);
public static void Main()
Console.WriteLine("How many people would you like to add?");
int c = int.Parse(Console.ReadLine());
List<Human>people=new List<Human>();
Console.WriteLine("Write name and years.");
for (int i = 0; i < c; i++)
var info = Console.ReadLine()
var person = new Human(info[0], info[1], int.Parse(info[2]));
people.OrderBy(a => a.Yearsold)
.ForEach(a => a.PrintInfo());