It helps to visualize what you're going to do before the incident happens. I do this often, so I come pretty prepared into any scenario that I'm already familiar with.
Here are some openers I have come up with.
"Well, well, well, we meet again "
"Woah, hey there! No see, long time" - for those girls who you hardly talk to or see
"Whew! Looks like your day just got made "
"Do you like waffles?"
The most important thing is having the confidence to pull any of this off. You always have to be on your game and prepared for the unexpected.
"There is no better than adversity. Every defeat, every heartbreak, every loss, contains its own seed, its own lesson on how to improve your performance the next time." - Malcolm X