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

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

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

c = A("c")
f = B("f")
i = C("i")
e = B("e")
l = C("l")
j = C("j")

c.w = j
c.o = f
c.t = f
f.x = c
f.r = j
f.y = j
i.x = c
e.x = c
e.r = l
e.y = l
l.x = c
j.x = c
assert c.w.x.w.x.t.r.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: B = None
        self.t: B = None
        self.txt = txt

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

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

c = A("c")
f = B("f")
i = C("i")
e = B("e")
l = C("l")
j = C("j")

c.w = j
c.o = f
c.t = f
f.x = c
f.r = j
f.y = j
i.x = c
e.x = c
e.r = l
e.y = l
l.x = c
j.x = c
assert c.w.x.w.x.t.r.txt == "j"