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

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

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

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

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

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

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

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

b.t = j
b.u = j
j.w = e
j.v = l
e.y = k
k.y = e
g.t = j
g.u = j
l.t = j
l.u = j
assert b.u.w.y.y.y.txt == "k"