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

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

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

n = A("n")
b = B("b")
i = C("i")
f = C("f")
e = B("e")
k = C("k")
g = A("g")
l = C("l")

n.y = e
n.u = b
b.p = i
i.w = k
i.t = e
f.w = l
f.t = e
e.p = k
k.w = f
k.t = e
g.y = b
g.u = b
l.w = f
l.t = e
assert b.p.t.p.t.p.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: B = None
        self.txt = txt

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

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

n = A("n")
b = B("b")
i = C("i")
f = C("f")
e = B("e")
k = C("k")
g = A("g")
l = C("l")

n.y = e
n.u = b
b.p = i
i.w = k
i.t = e
f.w = l
f.t = e
e.p = k
k.w = f
k.t = e
g.y = b
g.u = b
l.w = f
l.t = e
assert b.p.t.p.t.p.txt == "k"