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

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

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

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

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

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

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

m.o = n
m.x = n
m.s = n
m.t = b
m.r = j
m.z = f
j.t = m
j.y = m
j.o = f
j.v = f
j.x = n
f.w = m
e.z = j
e.u = f
e.w = f
e.y = f
e.t = b
e.q = d
b.y = j
b.w = n
b.r = m
n.y = j
n.w = j
n.o = m
n.z = e
n.r = f
d.z = j
d.u = f
d.w = f
d.y = f
d.t = b
d.q = e
assert n.z.z.o.w.z.w.txt == "
class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: E = None
        self.x: F = None
        self.r: B = None
        self.z: C = None
        self.s: F = None
        self.txt = txt

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

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

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

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

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

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

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