defmodule Main do def input, do: IO.read(:line) |> String.trim def ii, do: input() |> String.to_integer def li, do: input() |> String.split |> Enum.map(&String.to_integer/1) def yn(b), do: IO.puts(if b, do: "Yes", else: "No") def main do s = input() for x <- ["1", "4"] do t = String.replace(s, "?", x) [a, b, c] = t |> String.split |> Enum.map(&String.to_integer/1) if is_kadomatu(a, b, c), do: x, else: "" end |> Enum.join |> IO.puts end def is_kadomatu(a, b, c) do cond do a == b or b == c or c == a -> false true -> [_, x, _] = Enum.sort([a, b, c]) b != x end end end