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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: A = None
        self.v: A = None
        self.z: C = None
        self.txt = txt

g = A("g")
d = B("d")
i = C("i")
j = D("j")
f = E("f")
b = C("b")
m = A("m")
a = C("a")

g.z = b
g.w = f
g.x = m
g.q = a
d.p = j
i.z = m
i.y = f
i.r = g
i.u = d
j.s = d
j.o = d
j.v = b
f.s = b
f.z = b
f.p = m
f.v = g
b.z = g
b.r = g
b.y = f
b.u = d
m.z = a
m.q = a
m.w = f
m.x = g
a.z = g
a.r = g
a.y = f
a.u = d
assert m.x.z.r.x.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: E = None
        self.x: A = None
        self.q: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: A = None
        self.v: A = None
        self.z: C = None
        self.txt = txt

g = A("g")
d = B("d")
i = C("i")
j = D("j")
f = E("f")
b = C("b")
m = A("m")
a = C("a")

g.z = b
g.w = f
g.x = m
g.q = a
d.p = j
i.z = m
i.y = f
i.r = g
i.u = d
j.s = d
j.o = d
j.v = b
f.s = b
f.z = b
f.p = m
f.v = g
b.z = g
b.r = g
b.y = f
b.u = d
m.z = a
m.q = a
m.w = f
m.x = g
a.z = g
a.r = g
a.y = f
a.u = d
assert m.x.z.r.x.txt == "m"