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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: D = None
        self.z: D = None
        self.txt = txt

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

l = A("l")
i = B("i")
c = C("c")
d = D("d")
e = E("e")
f = F("f")

l.o = f
l.u = f
i.w = c
c.y = i
c.p = i
c.t = i
c.v = f
d.r = c
d.v = c
e.s = c
e.p = d
e.z = d
f.s = i
assert f.s.w.v.s.txt == "
class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.u: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: D = None
        self.z: D = None
        self.txt = txt

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

l = A("l")
i = B("i")
c = C("c")
d = D("d")
e = E("e")
f = F("f")

l.o = f
l.u = f
i.w = c
c.y = i
c.p = i
c.t = i
c.v = f
d.r = c
d.v = c
e.s = c
e.p = d
e.z = d
f.s = i
assert f.s.w.v.s.txt == "i"