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

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

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: E = None
        self.txt = txt

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

m = A("m")
e = B("e")
h = C("h")
l = D("l")
f = E("f")
j = E("j")
c = C("c")
i = C("i")
k = B("k")

m.v = f
m.q = e
m.t = h
m.s = k
e.y = i
e.r = j
h.y = e
l.v = h
l.r = j
f.z = j
j.z = f
c.y = e
i.y = e
k.y = h
k.r = f
assert k.r.z.z.z.z.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.q: B = None
        self.t: C = None
        self.s: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: E = None
        self.txt = txt

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

m = A("m")
e = B("e")
h = C("h")
l = D("l")
f = E("f")
j = E("j")
c = C("c")
i = C("i")
k = B("k")

m.v = f
m.q = e
m.t = h
m.s = k
e.y = i
e.r = j
h.y = e
l.v = h
l.r = j
f.z = j
j.z = f
c.y = e
i.y = e
k.y = h
k.r = f
assert k.r.z.z.z.z.z.z.txt == "f"