import java.util.*;
import java.util.regex.*;
import java.lang.*;
import java.io.*;

class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		String line = "A,,B";
		ArrayList<String> tokens = new ArrayList<String>();
		String regex = "\"([^\"]*)\"|[^,]+|(?<=,)(?=,)";
		Matcher m = Pattern.compile(regex).matcher(line);
		while (m.find()) {
		    if (m.group(1) != null) {
		        tokens.add(m.group(1));
		    } 
		    else {
		        tokens.add(m.group(0));
		    }
		}
		System.out.println(tokens);
	}
}
