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

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

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

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

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

h = A("h")
i = B("i")
c = C("c")
m = D("m")
a = E("a")
g = A("g")

h.z = a
h.w = a
h.q = a
h.o = g
h.y = m
i.q = g
i.p = c
i.u = c
i.x = a
c.u = m
c.w = a
c.p = a
c.y = a
c.v = i
m.x = i
m.z = a
a.p = c
a.x = i
a.o = i
g.z = a
g.w = a
g.q = a
g.o = h
g.y = m
assert h.o.o.o.y.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: E = None
        self.o: A = None
        self.q: E = None
        self.y: D = None
        self.txt = txt

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

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

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

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

h = A("h")
i = B("i")
c = C("c")
m = D("m")
a = E("a")
g = A("g")

h.z = a
h.w = a
h.q = a
h.o = g
h.y = m
i.q = g
i.p = c
i.u = c
i.x = a
c.u = m
c.w = a
c.p = a
c.y = a
c.v = i
m.x = i
m.z = a
a.p = c
a.x = i
a.o = i
g.z = a
g.w = a
g.q = a
g.o = h
g.y = m
assert h.o.o.o.y.z.txt == "a"