class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: E = None
        self.y: E = None
        self.p: E = None
        self.t: C = None
        self.txt = txt

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

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

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

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

h = A("h")
k = B("k")
b = C("b")
n = D("n")
c = E("c")
a = C("a")
d = B("d")

h.z = c
h.w = c
h.y = c
h.p = c
h.t = b
k.r = n
k.o = h
k.w = c
k.y = c
k.u = d
b.p = c
b.z = a
n.w = c
c.r = h
c.u = h
c.p = k
c.t = n
a.p = c
a.z = b
d.r = n
d.o = h
d.w = c
d.y = c
d.u = k
assert b.z.p.r.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: E = None
        self.y: E = None
        self.p: E = None
        self.t: C = None
        self.txt = txt

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

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

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

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

h = A("h")
k = B("k")
b = C("b")
n = D("n")
c = E("c")
a = C("a")
d = B("d")

h.z = c
h.w = c
h.y = c
h.p = c
h.t = b
k.r = n
k.o = h
k.w = c
k.y = c
k.u = d
b.p = c
b.z = a
n.w = c
c.r = h
c.u = h
c.p = k
c.t = n
a.p = c
a.z = b
d.r = n
d.o = h
d.w = c
d.y = c
d.u = k
assert b.z.p.r.z.txt == "c"