Top-to-Bottom Typing with Right-to-Left Flow