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

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

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

b = A("b")
k = B("k")
h = C("h")
e = A("e")
a = C("a")
g = A("g")
l = C("l")
j = A("j")

b.w = k
b.t = k
b.q = h
k.p = g
h.y = l
e.w = k
e.t = k
e.q = a
a.y = h
g.w = k
g.t = k
g.q = a
l.y = h
j.w = k
j.t = k
j.q = h
assert l.y.y.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: B = None
        self.q: C = None
        self.txt = txt

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

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

b = A("b")
k = B("k")
h = C("h")
e = A("e")
a = C("a")
g = A("g")
l = C("l")
j = A("j")

b.w = k
b.t = k
b.q = h
k.p = g
h.y = l
e.w = k
e.t = k
e.q = a
a.y = h
g.w = k
g.t = k
g.q = a
l.y = h
j.w = k
j.t = k
j.q = h
assert l.y.y.y.y.txt == "l"