Microsoft interview question

write a program to print the top view of a binary tree.