class Main {
    public static void main(String[] args) {
        Thread t1 = new Thread(new DeadlockRunnable());
        t1.start();
    }
} 

class DeadlockRunnable implements Runnable {
    static  Object onlyData = new Object();

    public void run() {
        synchronized(onlyData) {
            synchronized(onlyData) {
                System.out.println("*** Successfully acquired both the locks");
            }
        }
    }
}