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

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

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: D = None
        self.txt = txt

k = A("k")
a = B("a")
d = C("d")
f = D("f")
i = E("i")
m = F("m")

k.o = d
k.p = a
k.v = i
k.w = i
a.w = f
d.t = f
f.z = a
i.z = a
i.y = a
i.s = f
m.x = i
m.z = f
assert i.s.z.w.z.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: B = None
        self.v: E = None
        self.w: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: D = None
        self.txt = txt

k = A("k")
a = B("a")
d = C("d")
f = D("f")
i = E("i")
m = F("m")

k.o = d
k.p = a
k.v = i
k.w = i
a.w = f
d.t = f
f.z = a
i.z = a
i.y = a
i.s = f
m.x = i
m.z = f
assert i.s.z.w.z.txt == "a"