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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: E = None
        self.q: B = None
        self.v: E = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: E = None
        self.q: B = None
        self.v: E = None
        self.y: A = None
        self.txt = txt

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

h.z = c
h.y = i
h.x = d
b.u = i
b.o = i
b.r = i
b.z = d
b.p = h
c.s = d
c.o = i
i.s = d
i.r = d
i.w = d
i.x = b
k.u = d
k.v = d
k.q = b
k.y = h
a.s = k
a.w = k
a.x = b
a.r = d
d.u = k
d.v = k
d.q = b
d.y = h
assert a.r.y.z.s.q.p.txt == "h"