package main import ( "bufio" "os" "strconv" "strings" "fmt" ) func main() { before := next() N := nextInt() after := next() b := strings.Contains(before, "o") a := strings.Contains(after, "o") SUCCESS := "SUCCESS" FAILURE := "FAILURE" if b != a { fmt.Println(SUCCESS) return } if N == 0 { if before != after { fmt.Println(SUCCESS) }else { fmt.Println(FAILURE) } }else if N >= 2 { fmt.Println(FAILURE) }else { tmp := string(before[1]) + string(before[0]) + string(before[2]) tmp2 := string(before[0]) + string(before[2]) + string(before[1]) if tmp == after || tmp2 == after { fmt.Println(FAILURE) }else { fmt.Println(SUCCESS) } } } var s = bufio.NewScanner(os.Stdin) func next() string { s.Split(bufio.ScanWords) s.Scan() return s.Text() } func nextLine() string { s.Split(bufio.ScanLines) s.Scan() return s.Text() } func nextInt() int { i, e := strconv.Atoi(next()) if e != nil { panic(e) } return i } func nextLong() int64 { i, e := strconv.ParseInt(next(), 10, 64) if e != nil { panic(e) } return i } func mapToString(arr []int) []string { ret := make([]string, len(arr)) for i := 0; i < len(arr); i++ { ret[i] = strconv.Itoa(arr[i]) } return ret } func PrintI(args ...int) { fmt.Println(strings.Join(mapToString(args), " ")) }