Go program for past prefix matching.