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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

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

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

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

n.u = k
n.z = i
n.v = m
n.y = e
c.r = k
c.u = n
e.q = j
j.z = m
m.z = n
m.u = n
m.w = c
m.o = k
m.q = i
k.x = c
k.o = m
k.s = m
k.z = m
k.r = j
k.t = j
i.q = j
assert k.x.u.v.u.u.o.txt == "m"