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

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

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

d = A("d")
e = B("e")
l = C("l")
m = C("m")
a = B("a")
n = C("n")
c = A("c")
k = C("k")
j = C("j")

d.w = a
e.y = a
l.w = m
l.x = e
m.w = n
m.x = e
a.y = e
n.w = j
n.x = e
c.w = a
k.w = m
k.x = e
j.w = l
j.x = a
assert k.x.y.y.y.y.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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

d = A("d")
e = B("e")
l = C("l")
m = C("m")
a = B("a")
n = C("n")
c = A("c")
k = C("k")
j = C("j")

d.w = a
e.y = a
l.w = m
l.x = e
m.w = n
m.x = e
a.y = e
n.w = j
n.x = e
c.w = a
k.w = m
k.x = e
j.w = l
j.x = a
assert k.x.y.y.y.y.y.y.txt == "e"