package main import ( "bufio" "fmt" "math/bits" "os" "strconv" ) func getNextString(scanner *bufio.Scanner) string { if !scanner.Scan() { panic("scan failed") } return scanner.Text() } func atoi(s string) int { x, _ := strconv.Atoi(s); return x } func getNextInt(scanner *bufio.Scanner) int { return atoi(getNextString(scanner)) } func atoi64(s string) int64 { x, _ := strconv.ParseInt(s, 10, 64); return x } func getNextInt64(scanner *bufio.Scanner) int64 { return atoi64(getNextString(scanner)) } func atof64(s string) float64 { x, _ := strconv.ParseFloat(s, 64); return x } func getNextFloat64(scanner *bufio.Scanner) float64 { return atof64(getNextString(scanner)) } func main() { fp := os.Stdin wfp := os.Stdout extra := 0 if os.Getenv("I") == "IronMan" { fp, _ = os.Open(os.Getenv("END_GAME")) extra = 100 } scanner := bufio.NewScanner(fp) scanner.Split(bufio.ScanWords) scanner.Buffer(make([]byte, 1000005), 1000005) writer := bufio.NewWriter(wfp) defer func() { r := recover() if r != nil { fmt.Fprintln(writer, r) } writer.Flush() }() solve(scanner, writer) for i := 0; i < extra; i++ { fmt.Fprintln(writer, "-----------------------------------") solve(scanner, writer) } } func solve(scanner *bufio.Scanner, writer *bufio.Writer) { n := getNextInt(scanner) if bits.OnesCount(uint(n)) < 2 { fmt.Fprintln(writer, "-1 -1 -1") return } var ( a, b, c int ) x := 0 for i := 0; i < 30; i++ { if n>>uint(i)&1 == 0 { continue } if x == 0 { a |= (1 << uint(i)) b |= (1 << uint(i)) } else { b |= (1 << uint(i)) c |= (1 << uint(i)) } x++ } fmt.Fprintln(writer, fmt.Sprintf("%d %d %d", a, b, c)) }