Python example import sys for line in sys.stdin.readlines(): for word in line.split(): if word.endswith(&’ing&’): print word