import java.io.*;
class Test10_7{
public static void main(String args[])
{
	try{
		FileReader fr=new FileReader("1.txt");
		BufferedReader in=new BufferedReader(fr);
		String str,s;
		char[] ch=new char[4];    //Ŵ𰸵ַ
		int k=0;
		while((str=in.readLine())!=null)   //ȡı
		{
			if(str.startsWith("#")){      
				ch[k]=str.charAt(1);    //𰸴ַ
				k++;
				//ѡ
System.out.println(str.subSequence(1,str.length()));  
			}
			else
				System.out.println(str);
		}
		in.close();
		System.out.print("𰸣");
		for(int i=0;i<k;i++)
			System.out.print(ch[i]);     //
	}
	catch(IOException e){
		System.out.println(e);
	}
}
}
