class Lista_arq{
 private Arquivo arq;
 private Lista_arq proximo;

 public void inserir(Arquivo arq){
   if (this.arq == null) {
	this.arq = arq;
	proximo = new Lista_arq();
   } else proximo.inserir(arq);
 }

 public void excluir(Arquivo arq){
   if (this.arq == null) System.out.println("Arquivo inexistente\n");
   else {
	if (this.arq == arq) {
		this.arq = proximo.arq;
		this.proximo = proximo.proximo;
	} else proximo.excluir(arq);
   }
 }

 public void listar(){
   if (this.arq == null) return;
   else {
	System.out.println(arq.nome());
	proximo.listar();
   }
 }

 public boolean existe(Arquivo arq){
  if (this.arq == null) return false;
  else if (this.arq == arq) return true;
       else return proximo.existe(arq);
 }
 
}
