class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: D = None
        self.x: D = None
        self.w: F = None
        self.o: B = None
        self.y: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

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

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

m = A("m")
f = B("f")
e = C("e")
a = D("a")
n = E("n")
d = F("d")
c = E("c")

m.s = d
m.w = d
m.t = a
m.x = a
m.y = a
m.o = f
f.p = m
e.o = d
a.u = m
a.y = e
a.o = d
n.u = a
n.p = a
d.z = e
d.p = a
c.u = a
c.p = a
assert e.o.z.o.txt == "
class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: D = None
        self.x: D = None
        self.w: F = None
        self.o: B = None
        self.y: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

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

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

m = A("m")
f = B("f")
e = C("e")
a = D("a")
n = E("n")
d = F("d")
c = E("c")

m.s = d
m.w = d
m.t = a
m.x = a
m.y = a
m.o = f
f.p = m
e.o = d
a.u = m
a.y = e
a.o = d
n.u = a
n.p = a
d.z = e
d.p = a
c.u = a
c.p = a
assert e.o.z.o.txt == "d"