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

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

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

b = A("b")
d = B("d")
l = C("l")
h = B("h")
f = B("f")
j = C("j")
c = C("c")

b.x = c
b.s = h
b.t = l
d.o = c
d.u = h
d.v = j
l.v = c
h.o = c
h.v = c
h.u = f
f.o = l
f.u = h
f.v = j
j.v = c
c.v = l
assert l.v.v.v.v.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: B = None
        self.t: C = None
        self.txt = txt

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

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

b = A("b")
d = B("d")
l = C("l")
h = B("h")
f = B("f")
j = C("j")
c = C("c")

b.x = c
b.s = h
b.t = l
d.o = c
d.u = h
d.v = j
l.v = c
h.o = c
h.v = c
h.u = f
f.o = l
f.u = h
f.v = j
j.v = c
c.v = l
assert l.v.v.v.v.v.v.txt == "l"