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

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

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

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

f.q = k
f.w = l
f.t = b
d.s = e
d.t = l
l.y = k
c.s = e
c.t = k
e.y = k
k.y = l
i.q = l
i.w = l
i.t = d
h.q = k
h.w = l
h.t = d
b.s = e
b.t = e
assert c.s.y.y.y.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: C = None
        self.t: B = None
        self.txt = txt

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

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

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

f.q = k
f.w = l
f.t = b
d.s = e
d.t = l
l.y = k
c.s = e
c.t = k
e.y = k
k.y = l
i.q = l
i.w = l
i.t = d
h.q = k
h.w = l
h.t = d
b.s = e
b.t = e
assert c.s.y.y.y.y.y.txt == "k"