using System;
public class Program
{
public static void Main()
X x1 = new X();
X x2 = new X();
x1.otherX = x2;
x1.TestOtherX();
Y y1 = new Y();
Y y2 = new Y();
y1.y = y2;
y1.TestOtherY();
}
public class X{
public X otherX;
public void TestOtherX(){otherX.Test();}
protected void Test(){Console.WriteLine("OK!");}
public class Y : X{
public Y y;
public void TestOtherY(){y.Test();}