solved in python3
solved in bash, but hackrrank does not support the read -n flag
fixed
solved in c; faster than bash