class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: B = None
        self.txt = txt

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

e.x = h
h.s = d
h.q = i
i.v = a
i.o = h
a.v = l
a.o = b
d.s = c
d.q = a
l.v = i
l.o = c
b.s = c
b.q = a
c.s = h
c.q = i
k.v = i
k.o = h
n.x = h
assert c.s.q.o.s.s.s.q.o.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: B = None
        self.txt = txt

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

e.x = h
h.s = d
h.q = i
i.v = a
i.o = h
a.v = l
a.o = b
d.s = c
d.q = a
l.v = i
l.o = c
b.s = c
b.q = a
c.s = h
c.q = i
k.v = i
k.o = h
n.x = h
assert c.s.q.o.s.s.s.q.o.txt == "h"