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

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

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

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

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

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

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

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

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

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

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

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

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

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

e.x = m
e.y = f
f.z = m
f.w = k
f.x = j
k.w = f
b.x = n
b.u = n
b.o = m
b.z = c
b.w = k
m.s = j
m.v = f
j.u = e
j.z = e
n.x = b
n.u = b
n.o = m
n.z = f
n.w = k
c.z = m
c.w = k
c.x = j
assert n.w.w.z.txt == "m"