class Grandparent {

    void displayGrandparent() {

        System.out.println("This is the Grandparent class.");

    }

}

class Parent extends Grandparent {

    void displayParent() {

        System.out.println("This is the Parent class.");

    }

}

class Child extends Parent {

    void displayChild() {

        System.out.println("This is the Child class.");

    }

}

public class MultiLevelInheritanceExample {

    public static void main(String[] args) {

        Child child = new Child();

        child.displayGrandparent(); // Accessing method from Grandparent class

        child.displayParent();      // Accessing method from Parent class

        child.displayChild();       // Accessing method from Child class

    }

}