import java.util.*;
import java.lang.*;
import java.io.*;

class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		try(Resource resource = new Resource()){
			System.out.println("Trying");
			throw new RuntimeException("Trying failed");
		}
	}
}

class Resource implements Closeable {
	public void close(){
		System.out.println("Closing");
		throw new RuntimeException("Closing failed");
	}
}