class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: D = None
        self.txt = txt

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

k.v = l
l.z = k
l.o = c
l.t = m
m.t = l
m.s = c
m.z = a
m.o = k
d.o = e
d.p = l
d.t = k
d.z = b
c.s = l
c.z = k
c.v = g
c.y = b
b.y = a
b.s = a
n.o = k
n.p = l
n.t = e
n.z = b
g.t = l
g.s = c
g.z = n
g.o = k
a.o = e
a.p = l
a.t = k
a.z = b
e.v = l
assert k.v.o.v.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: D = None
        self.txt = txt

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

k.v = l
l.z = k
l.o = c
l.t = m
m.t = l
m.s = c
m.z = a
m.o = k
d.o = e
d.p = l
d.t = k
d.z = b
c.s = l
c.z = k
c.v = g
c.y = b
b.y = a
b.s = a
n.o = k
n.p = l
n.t = e
n.z = b
g.t = l
g.s = c
g.z = n
g.o = k
a.o = e
a.p = l
a.t = k
a.z = b
e.v = l
assert k.v.o.v.z.txt == "n"