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

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: A = None
        self.o: C = None
        self.r: C = None
        self.q: A = None
        self.txt = txt

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

e = A("e")
h = B("h")
d = C("d")
a = D("a")
m = E("m")

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: A = None
        self.o: C = None
        self.r: C = None
        self.q: A = None
        self.txt = txt

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

e = A("e")
h = B("h")
d = C("d")
a = D("a")
m = E("m")

e.z = m
e.o = h
e.w = d
e.u = a
e.t = a
h.z = d
d.s = a
d.p = m
a.p = d
a.o = d
a.r = d
a.x = e
a.q = e
m.v = d
m.w = h
m.x = e
assert h.z.p.x.z.x.txt == "e"