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

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: E = None
        self.y: E = None
        self.w: B = None
        self.txt = txt

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

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

a.z = f
a.p = c
a.u = c
a.t = c
a.r = i
b.r = k
e.t = a
e.y = a
e.o = d
e.p = c
h.t = j
h.q = d
h.y = k
h.w = b
d.r = a
i.t = c
i.p = c
i.o = k
i.y = a
f.r = k
j.t = c
j.o = k
j.p = a
j.y = a
k.r = c
c.z = f
c.p = a
c.u = a
c.t = a
c.r = i
assert f.r.r.z.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: A = None
        self.r: C = None
        self.u: A = None
        self.t: A = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: E = None
        self.y: E = None
        self.w: B = None
        self.txt = txt

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

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

a.z = f
a.p = c
a.u = c
a.t = c
a.r = i
b.r = k
e.t = a
e.y = a
e.o = d
e.p = c
h.t = j
h.q = d
h.y = k
h.w = b
d.r = a
i.t = c
i.p = c
i.o = k
i.y = a
f.r = k
j.t = c
j.o = k
j.p = a
j.y = a
k.r = c
c.z = f
c.p = a
c.u = a
c.t = a
c.r = i
assert f.r.r.z.r.r.txt == "c"