f(p){printf("<%s>",strsep(&p," "));p&&f(p+2);printf("");}main(a){for(;gets(&a);puts(""))f();}