abstract class Base
{
 int b1,b2;
 Base(int a,int c)
 {
  b1=a;
  b2=c;
 }
 abstract void displayBase();
}
 class Derived1 extends Base
{
 int d1,d2;
 Derived1(int p,int q,int r,int s)
 {
  super(p,q);
  d1=r; 
  d2=s;
 }
void display1()
{
 System.out.println("the value is:" +d1);
 System.out.println("the value is:" +d2);
}
void displayBase()
{
 System.out.println("the value is:" +b1);
 System.out.println("the value is:" +b2);
}
}

class Derived2 extends Derived1
{
 int d3,d4;
 Derived2(int p,int q,int r,int s,int t,int u)
 {
  super(p,q,r,s);
  d3=t; 
  d4=u;
 }
void display2()
{
  System.out.println("the value is:" +d3);
  System.out.println("the value is:" +d4);
}
}
class Test
{
 public static void main(String arg[])
 {
   Derived1 d1=new Derived1(1,2,3,4);
   Derived2 d2=new Derived2(5,6,7,8,9,4);
   d1.displayBase();
  d1.display1();
  d2.display2();
  d2.display1();
 }
}

/*  OUTPUT*/

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Lenovo>cd\

C:\>set path="C:\Program Files\Java\jdk1.6.0_24\bin";

C:\>cd vishu

C:\vishu>javac Test.java

C:\vishu>java Test
the value is:1
the value is:2
the value is:3
the value is:4
the value is:9
the value is:4
the value is:7
the value is:8