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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.p: C = None
        self.w: C = None
        self.txt = txt

i = A("i")
d = B("d")
c = C("c")
g = D("g")
a = E("a")
b = C("b")
n = C("n")
m = E("m")

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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.p: C = None
        self.w: C = None
        self.txt = txt

i = A("i")
d = B("d")
c = C("c")
g = D("g")
a = E("a")
b = C("b")
n = C("n")
m = E("m")

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