// Convert.cpp : Defines the entry point for the console application.
//
// Designed by Alex E. Pozhtikov, 2011, University of Washington, pozhit@washington.edu

//#include "stdafx.h"
#include <stdio.h>
#include <iostream>
#include <string>

using namespace std;

int main(int argc, char* argv[])
{
	string  str, Sequence;
	Sequence = "";

	while(!(cin.eof()))
	{
		getline(cin, str);
		if(str == "") continue;
		if(str.find('>') != string::npos)
		{
			//this is a header of a new sequence
			cout << Sequence; //report previous sequence
			Sequence = "";
			int pos1;
			pos1 = str.find_first_of(' ');
			cout <<'\n'<< str.substr(1, pos1 - 1)<<'\t'; //report id
		}
		else Sequence += str;

	}
	cout << Sequence; //report last sequence
	return 0;
}

