package main import ( "bufio" "os" "fmt" "unicode/utf8" ) func main(){ b, _, _ := bufio.NewReaderSize(os.Stdin, 4096).ReadLine() for len(b) > 0 { r, size := utf8.DecodeLastRune(b) fmt.Printf("%c", r) b = b[:len(b) - size] } fmt.Println() }