class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: D = None
        self.y: B = None
        self.w: C = None
        self.txt = txt

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

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

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

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

g = A("g")
e = B("e")
a = C("a")
i = D("i")
b = E("b")
d = A("d")
m = B("m")
l = C("l")

g.z = b
g.v = i
g.y = m
g.w = a
e.z = a
e.v = b
e.x = i
e.p = d
a.u = i
a.v = l
a.z = l
a.p = g
i.s = a
b.t = a
d.z = b
d.v = i
d.y = e
d.w = l
m.z = l
m.v = b
m.x = i
m.p = g
l.u = i
l.v = a
l.z = a
l.p = g
assert a.p.y.z.u.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: D = None
        self.y: B = None
        self.w: C = None
        self.txt = txt

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

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

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

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

g = A("g")
e = B("e")
a = C("a")
i = D("i")
b = E("b")
d = A("d")
m = B("m")
l = C("l")

g.z = b
g.v = i
g.y = m
g.w = a
e.z = a
e.v = b
e.x = i
e.p = d
a.u = i
a.v = l
a.z = l
a.p = g
i.s = a
b.t = a
d.z = b
d.v = i
d.y = e
d.w = l
m.z = l
m.v = b
m.x = i
m.p = g
l.u = i
l.v = a
l.z = a
l.p = g
assert a.p.y.z.u.txt == "i"