are you sure that the question is right? I think in sample output the 4th row should be like this: @ 4 @ 4 @