/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
String sentenca
= "Jais Pereira Guedes Godofredo"; int index= sentenca.lastIndexOf(" ");
String restoSentenca
= (sentenca.
substring(0, index
)); String ultimaPalavra
= (sentenca.
substring(index
+1)); String novaSentenca
= ultimaPalavra
+ ", " + restoSentenca
; System.
out.
println(novaSentenca
); }
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCVN0cmluZyBzZW50ZW5jYSA9ICJKYWlzIFBlcmVpcmEgR3VlZGVzIEdvZG9mcmVkbyI7CiAgICAgICAgaW50IGluZGV4PSBzZW50ZW5jYS5sYXN0SW5kZXhPZigiICIpOwogICAgICAgIFN0cmluZyByZXN0b1NlbnRlbmNhID0gKHNlbnRlbmNhLnN1YnN0cmluZygwLCBpbmRleCkpOwogICAgICAgIFN0cmluZyB1bHRpbWFQYWxhdnJhID0gKHNlbnRlbmNhLnN1YnN0cmluZyhpbmRleCsxKSk7CiAgICAgICAgU3RyaW5nIG5vdmFTZW50ZW5jYSA9IHVsdGltYVBhbGF2cmEgKyAiLCAiICsgcmVzdG9TZW50ZW5jYTsKICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4obm92YVNlbnRlbmNhKTsKCX0KfQ==