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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.q: B = None
        self.t: D = None
        self.o: F = None
        self.txt = txt

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

c = A("c")
f = B("f")
i = C("i")
a = D("a")
n = E("n")
m = F("m")
k = A("k")

c.z = m
c.x = m
c.o = n
f.t = m
f.r = i
i.r = a
a.z = i
n.v = m
n.o = m
n.q = f
n.t = a
m.z = a
m.t = k
m.o = k
k.z = m
k.x = m
k.o = n
assert c.o.t.z.r.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: F = None
        self.o: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.q: B = None
        self.t: D = None
        self.o: F = None
        self.txt = txt

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

c = A("c")
f = B("f")
i = C("i")
a = D("a")
n = E("n")
m = F("m")
k = A("k")

c.z = m
c.x = m
c.o = n
f.t = m
f.r = i
i.r = a
a.z = i
n.v = m
n.o = m
n.q = f
n.t = a
m.z = a
m.t = k
m.o = k
k.z = m
k.x = m
k.o = n
assert c.o.t.z.r.txt == "a"