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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: D = None
        self.o: C = None
        self.v: A = None
        self.s: D = None
        self.y: B = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: D = None
        self.o: C = None
        self.v: A = None
        self.s: D = None
        self.y: B = None
        self.txt = txt

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

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