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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.y: E = None
        self.t: D = None
        self.txt = txt

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

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

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

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

k.q = c
k.x = e
e.v = a
e.y = m
e.z = k
e.o = k
e.w = k
e.q = k
m.p = n
m.t = n
m.y = b
n.o = a
b.u = n
c.x = m
c.o = k
c.v = n
c.q = n
c.p = b
c.u = e
a.u = n
assert n.o.u.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.y: E = None
        self.t: D = None
        self.txt = txt

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

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

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

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

k.q = c
k.x = e
e.v = a
e.y = m
e.z = k
e.o = k
e.w = k
e.q = k
m.p = n
m.t = n
m.y = b
n.o = a
b.u = n
c.x = m
c.o = k
c.v = n
c.q = n
c.p = b
c.u = e
a.u = n
assert n.o.u.o.u.txt == "n"