package main import ( "fmt" "math" "strings" ) func main() { var n int fmt.Scan(&n) fmt.Println(matchNum(n, "")) } func matchNum(leftMatch int, matchNumMemo string) string { if leftMatch < 2 { return matchNumMemo } if leftMatch == 2 { return strings.Join([]string{matchNumMemo, "1"}, "") } if leftMatch == 3 { return strings.Join([]string{matchNumMemo, "7"}, "") } return matchNum(int(math.Ceil(float64(leftMatch/2))), strings.Join([]string{matchNumMemo, "1"}, "")) }