# 入力された値を文字列で受け取る input = gets(chomp: true) reverse =[] # 配列の値を反転 reverse = input.reverse i = 0 while reverse[i] == "<" || reverse[i] == ">" do case reverse[i] when "<" then reverse[i] == ">" when "<" then reverse[i] == ">" else end i += 1 end puts reverse