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

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

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

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

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

b = A("b")
k = B("k")
m = C("m")
h = D("h")
e = E("e")
a = C("a")
c = B("c")
n = E("n")

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

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

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

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

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

b = A("b")
k = B("k")
m = C("m")
h = D("h")
e = E("e")
a = C("a")
c = B("c")
n = E("n")

b.q = m
b.v = k
k.s = c
m.o = n
h.t = k
e.o = c
e.y = h
e.t = n
e.x = a
a.o = n
c.s = k
n.o = c
n.y = h
n.t = e
n.x = m
assert m.o.t.y.t.s.s.s.s.txt == "k"