I can see people commenting several solutions. All good
But,
Why not use a simple reverse program , just within a
try{
//code
}catch{
//code to handle exception
}
block
Hope it helps ( Java mostly , little do i know about other languages).
The Simplest Solution (rather Hint)
s-c-u-b-e
#1