// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.util.StringTokenizer;

public class EmptyToken {
    public static void main(String[] args) {
        StringTokenizer st = new StringTokenizer("1\t2\t\t4","\t",true);
        boolean lastsep = true;
        while(st.hasMoreTokens()) {
            String t = st.nextToken();
            if(t.equals("\t")) {
                if(lastsep) {
                    System.out.println("");
                }
                lastsep = true;
            } else {
                System.out.println(t);
                lastsep = false;
            }
        }
    }
}
