class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: C = None
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: C = None
        self.q: A = None
        self.v: B = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: C = None
        self.q: A = None
        self.v: B = None
        self.o: D = None
        self.txt = txt

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

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

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

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

k.q = h
k.r = c
k.y = d
d.s = j
d.v = j
d.r = h
d.q = k
d.o = e
h.z = k
e.t = i
l.y = a
l.p = k
l.o = h
l.w = c
a.y = l
a.p = k
a.o = c
a.w = h
i.t = e
n.z = k
j.s = d
j.v = d
j.r = h
j.q = k
j.o = e
c.z = k
assert j.r.z.r.txt == "c"