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

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

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

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

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

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

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

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

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

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

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

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

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