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

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.z: C = None
        self.p: E = None
        self.w: A = None
        self.txt = txt

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

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

j = A("j")
i = B("i")
l = C("l")
m = D("m")
n = E("n")
f = F("f")
e = A("e")

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.z: C = None
        self.p: E = None
        self.w: A = None
        self.txt = txt

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

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

j = A("j")
i = B("i")
l = C("l")
m = D("m")
n = E("n")
f = F("f")
e = A("e")

j.z = e
j.x = n
j.o = i
i.y = n
i.z = n
i.w = f
i.t = j
i.r = m
l.v = j
l.u = m
m.o = n
m.p = n
m.z = l
m.w = e
n.s = m
n.o = m
f.v = n
f.z = e
f.u = l
e.z = j
e.x = n
e.o = i
assert m.z.v.z.x.o.o.o.txt == "m"