
#include <fstream>

using namespace std;

int main(int argc, char** argv)
{
	ifstream ifstr(argv[1]);
	ofstream ofstr(argv[2]);
	char line[1000];
	
	while(!ifstr.eof())
	{
		ifstr.getline(line, 999);

		if     (!strcmp(line, "\\begin{Schunk}"))	ofstr << "\\begin{verbatim}" << endl;
		else if(!strcmp(line, "\\begin{Sinput}"));
		else if(!strcmp(line, "\\end{Sinput}"))      ofstr << endl;
		else if(!strcmp(line, "\\begin{Soutput}"));
		else if(!strcmp(line, "\\end{Soutput}"));
		else if(!strcmp(line, "\\end{Schunk}"))      ofstr << "\\end{verbatim}" << endl;
		else ofstr << line << endl;
	}
	return 0;
}
