The input to awk has multiple columns. I would like to print column $x or column $y depending on the value of column $z.
For example: The input is
3 2 1
4 5 6
I want to print first column if the third column is 1 and print second column otherwise.
Output should be
3
5