#!/bin/sh

# read input and filter even (LEFT) or even (RIGHT) line



help()
{
	echo "filter [LEFT,RIGHT]"
	exit 1
}

FLAG=0
filter()
{

while read LINE;
do

	if [ $FLAG == $1 ]
	then
		echo $LINE
	fi
	
	if [ $FLAG == 0 ]
	then
		FLAG=1
	else
		FLAG=0
	fi

done

}

case $1 in
	"LEFT")
	filter 0
	;;
	
	"RIGHT")
	filter 1
	;;
	
	*)
	help
	;;
esac