/* package whatever; // don't place package name! */

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

abstract class A
{
    public void Testme(A other)
    {
        System.out.println("value from this: " + Value() + " value from other: " + other.Value());
    }
    
    abstract protected String Value();
}
 
class B extends A
{
    protected String Value()
    {
        return "B class";
    }
}
 
class C extends A
{
    protected String Value()
    {
        return "C class";
    }
}

/* Name of the class has to be "Main" only if the class is public. */
class Program
{
	public static void main (String[] args) throws java.lang.Exception
	{
		B b = new B();
		C c = new C();
		b.Testme(c);
	}
}