// No.632 穴埋め門松列 package main import ( "fmt" "strings" ) func main() { var c1, c2, c3 string fmt.Scan(&c1, &c2, &c3) ans := "" s1 := strings.Replace(c1+c2+c3, "?", "1", 1) if (s1[1] < s1[0] && s1[1] < s1[2]) || (s1[1] > s1[0] && s1[1] > s1[2]) { ans = ans + "1" } s4 := strings.Replace(c1+c2+c3, "?", "4", 1) if (s4[1] < s4[0] && s4[1] < s4[2]) || (s4[1] > s4[0] && s4[1] > s4[2]) { ans = ans + "4" } fmt.Println(ans) }