#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
using namespace std;

int main() {
	string test = "   first     \"  in \\\"quotes \"  last ";
	istringstream strm(test);

	while (strm >> ws) {
	    string token;
    	auto startpos = strm.tellg();
	    if (!(strm >> quoted(token))) break;
    	auto endpos = strm.tellg();
	    if (endpos == -1) endpos = test.length();

	    cout << token << ": " << startpos << " " << endpos << endl;
	}

	return 0;
}