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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: E = None
        self.q: F = None
        self.u: D = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: E = None
        self.q: F = None
        self.u: D = None
        self.txt = txt

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

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

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

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

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

i.p = a
i.y = f
i.z = e
i.v = d
i.s = d
m.o = i
m.z = b
m.q = a
m.u = f
d.s = m
d.q = m
d.v = e
d.p = i
f.w = d
f.p = d
f.o = d
f.y = d
f.u = a
e.s = f
e.t = i
e.z = i
e.y = a
a.w = e
b.s = f
b.t = i
b.z = i
b.y = a
assert m.o.z.s.u.txt == "a"