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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: C = None
        self.x: C = None
        self.o: E = None
        self.txt = txt

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

e.z = d
j.y = m
j.t = m
j.u = n
a.t = e
a.r = e
a.w = n
d.u = e
d.x = e
d.o = m
d.t = m
d.v = m
d.r = m
n.o = m
m.v = d
m.s = a
m.x = a
m.o = n
assert n.o.x.w.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: C = None
        self.x: C = None
        self.o: E = None
        self.txt = txt

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

e.z = d
j.y = m
j.t = m
j.u = n
a.t = e
a.r = e
a.w = n
d.u = e
d.x = e
d.o = m
d.t = m
d.v = m
d.r = m
n.o = m
m.v = d
m.s = a
m.x = a
m.o = n
assert n.o.x.w.txt == "n"