import java.io.*;
import java.util.*;
import java.util.regex.*;

public class SJTree {
/** 
  Sejong Treebank cleaning method, 
  originally proposed in Park, J. (2006). 
  Extraction automatique d’une grammaire d’arbres adjoints à partir d’un corpus arboré pour le coréen. 
  Ph.D. Dissertation, Université Paris 7 - Denis Diderot. 
  Retrieved from http://www.sudoc.abes.fr/xslt/DB=2.1//SRCH?IKT=12&TRM=107995174
**/
    public static  String cleaning(String str) {
	str = str.replaceAll("__SBJ", "-SBJ");
	str = str.replaceAll("_SBJ", "-SBJ");
	str = str.replaceAll("_JAT", "-AJT");
	str = str.replaceAll("_MOD", "-MOD");
	str = str.replaceAll("_MOC", "-MOD");
	str = str.replaceAll("_CMOD", "-MOD");
	str = str.replaceAll("_OBJ", "-OBJ");
	str = str.replaceAll("_BOJ", "-OBJ");
	str = str.replaceAll("_AJT", "-AJT");
	str = str.replaceAll("_ATJ", "-AJT");

	str = str.replaceAll("_CNJ", "-CNJ");
	str = str.replaceAll("_CMP", "-CMP");
	str = str.replaceAll("_PRN", "-PRN");
	str = str.replaceAll("_RPN", "-PRN");

	str = str.replaceAll("_CJN", "-CJN");
	str = str.replaceAll("_CNP", "-CNP");
	str = str.replaceAll("_VNP", "-VNP");

	str = str.replaceAll("_INT", "-INT");
	str = str.replaceAll("_SBU", "-SBJ");

	str = str.replaceAll("_IP" , "-IPP");
	str = str.replaceAll("_CP" , "-CPP");

	str = str.replaceAll("_M", "-MOD");
	str = str.replaceAll("_O", "-OBJ");
	str = str.replaceAll("_A", "-AJT");
	str = str.replaceAll("_P", "-PPP");
	str = str.replaceAll("_U1", "");
	str = str.replaceAll("_U2", "");

	str = str.replaceAll(";Q1", "");
	str = str.replaceAll(";Q2", "");
	str = str.replaceAll(";Q3", "");
	str = str.replaceAll(";Q4", "");
	str = str.replaceAll(";Q5", "");
	str = str.replaceAll(";Q6", "");
	str = str.replaceAll(";Q7", "");
	str = str.replaceAll(";Q8", "");
	str = str.replaceAll(";Q9", "");

	str = str.replaceAll("\\+/SW", "*PLUS*/SW");
	str = str.replaceAll("\\//SP", "*SLASH*/SP");
	str = str.replaceAll("\\-/SS", "*MINUS*/SS");
        str = str.replaceAll("\\_/S", "*UNDERBAR*/S");
        str = str.replaceAll("\\_", "*UNDERBAR*");



	str = str.replaceAll("\\(/SS", "*LRB*/SS");
	str = str.replaceAll("\\)/SS", "*RRB*/SS");
	str = str.replaceAll("@", "*AT*");

	str = str.replaceAll("\"/SS", "*DQUOTE*/SS");
	str = str.replaceAll("'/SS", "*SQUOTE*/SS");
	str = str.replaceAll("\"", "*DQUOTE*");
	str = str.replaceAll("&", "*AMP*");
	str = str.replaceAll("</SS", "*LT*/SS");
	str = str.replaceAll(">/SS", "*GT*/SS");

	return str;

    }
    public static void main (String[] args) throws IOException {

	String fileName = args[0];

	BufferedReader d
	    = new BufferedReader(new InputStreamReader(new FileInputStream(new File (fileName) )));
	//File outputFile = new File(fileName + ".pos");
	//OutputStreamWriter out = new OutputStreamWriter(new FileOutputStream(outputFile),"UTF-8");

	String str = new String();

	str = d.readLine();
	while (str != null) {
	    str = str.trim();
		System.out.println(cleaning(str));

	    str = d.readLine();
	}

	d.close(); //out.close();
    }

}
