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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: D = None
        self.z: D = None
        self.x: C = None
        self.r: D = None
        self.s: A = None
        self.txt = txt

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

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

m.v = d
m.p = d
m.t = i
m.u = i
m.y = c
d.z = i
d.s = c
c.s = i
i.y = f
f.w = c
f.x = c
f.y = i
f.z = i
f.r = i
f.s = m
l.y = i
l.u = f
assert f.s.v.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: B = None
        self.t: D = None
        self.y: C = None
        self.u: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: D = None
        self.z: D = None
        self.x: C = None
        self.r: D = None
        self.s: A = None
        self.txt = txt

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

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

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