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

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

class C:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: C = None
        self.v: C = None
        self.txt = txt

e = A("e")
j = B("j")
m = C("m")
b = B("b")
a = C("a")
f = A("f")

e.w = b
e.p = f
e.x = a
j.z = m
m.y = a
m.t = a
m.v = a
b.z = m
a.y = m
a.t = m
a.v = m
f.w = b
f.p = e
f.x = m
assert m.v.v.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: A = None
        self.x: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: C = None
        self.v: C = None
        self.txt = txt

e = A("e")
j = B("j")
m = C("m")
b = B("b")
a = C("a")
f = A("f")

e.w = b
e.p = f
e.x = a
j.z = m
m.y = a
m.t = a
m.v = a
b.z = m
a.y = m
a.t = m
a.v = m
f.w = b
f.p = e
f.x = m
assert m.v.v.y.t.txt == "m"