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

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

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

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

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

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

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

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

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

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

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

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

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