#include <iostream>
#include <string>
#include <vector>
#include <regex>
using namespace std;

int main() {
	regex rx(R"(&&|\|\||[();])");
	string exp = "a < b | c | d > e >> f && ((g) || h) ; i";
	vector<string> tokens(sregex_token_iterator(exp.begin(), exp.end(), rx, {-1, 0}),
                               sregex_token_iterator());
	
    for( auto & p : tokens ) cout <<"'"<< p <<"'"<< endl;
    return 0;
}