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

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

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

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

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

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

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

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

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

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

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

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

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

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

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