package main import."os"func main(){b:=new([7]byte);for Stdin.Read(b){Stdout.Write(b[b[1]/=b[2]?:4])}}