import std.stdio;
class A { this(){} int F(){return 0;} this(bool _){this=_?cast(A)new B:cast(A)new C;} }
class B:A { this(){} int F(){return 1;} }
class C:A { this(){} int F(){return 2;} }
void main()
{
writef("%d\n", (new A(true)).F);
writef("%d\n", (new A(false)).F);
}