class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: B = None
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

l = A("l")
e = B("e")
m = C("m")
j = A("j")
f = C("f")
d = B("d")

l.w = m
l.v = d
l.o = e
e.t = d
m.x = e
j.w = f
j.v = e
j.o = e
f.x = d
d.t = e
assert f.x.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: B = None
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

l = A("l")
e = B("e")
m = C("m")
j = A("j")
f = C("f")
d = B("d")

l.w = m
l.v = d
l.o = e
e.t = d
m.x = e
j.w = f
j.v = e
j.o = e
f.x = d
d.t = e
assert f.x.t.t.txt == "d"