class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: F = None
        self.r: C = None
        self.o: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: B = None
        self.q: B = None
        self.t: E = None
        self.s: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: F = None
        self.x: A = None
        self.p: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: B = None
        self.q: B = None
        self.t: E = None
        self.s: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: F = None
        self.x: A = None
        self.p: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: B = None
        self.txt = txt

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

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