class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: D = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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