
#include "string"
#include "iostream"
#include "vector"
#include "sstream"

using namespace std;

inline bool rl(istream &is, istringstream &str)
        {
        string buffer;
        if(getline(is, buffer).eof()) return false;
	if(buffer=="")return rl(is, str);
        if(buffer[0]=='#') return rl(is, str);
        str.str(buffer);
//        str.seekg(0, ios::beg);
 //       str.clear();
        return true;
        }


inline bool readline(istream &is, vector<string> & items)
	{
	istringstream str;
	if(!rl(is, str)) return false;
	items.clear();
	string item;
	while(!str.eof())
		{
		str>>item;
		items.push_back(item);
		}
	if(items.size()==0) return readline(is, items);
	if(items[0]=="") return readline(is, items);
	if(items[0][0]=='#') return readline(is, items);
	return true;
	}
