using System;
public class Test
{
public static void Main()
{
string sentence = "write LINQ queries to do the following";
int nLastWord = sentence.LastIndexOf(' ');
string strLastWord = sentence.Substring(nLastWord + 1,
sentence.Length - nLastWord - 1).ToUpper();
Console.WriteLine(strLastWord);
}
}
dXNpbmcgU3lzdGVtOwoKcHVibGljIGNsYXNzIFRlc3QKewoJcHVibGljIHN0YXRpYyB2b2lkIE1haW4oKQoJewoJCSBzdHJpbmcgc2VudGVuY2UgPSAid3JpdGUgTElOUSBxdWVyaWVzIHRvIGRvIHRoZSBmb2xsb3dpbmciOwoJCSBpbnQgbkxhc3RXb3JkID0gc2VudGVuY2UuTGFzdEluZGV4T2YoJyAnKTsKCQkgc3RyaW5nIHN0ckxhc3RXb3JkID0gc2VudGVuY2UuU3Vic3RyaW5nKG5MYXN0V29yZCArIDEsCgkJIAlzZW50ZW5jZS5MZW5ndGggLSBuTGFzdFdvcmQgLSAxKS5Ub1VwcGVyKCk7CgkJIAkKCQkgQ29uc29sZS5Xcml0ZUxpbmUoc3RyTGFzdFdvcmQpOwoJfQp9