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

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

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

j = A("j")
l = B("l")
i = C("i")
k = C("k")
a = C("a")

j.o = l
l.u = a
l.v = k
i.s = l
k.s = l
a.s = l
assert l.v.s.v.s.u.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

j = A("j")
l = B("l")
i = C("i")
k = C("k")
a = C("a")

j.o = l
l.u = a
l.v = k
i.s = l
k.s = l
a.s = l
assert l.v.s.v.s.u.txt == "a"