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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.s: E = None
        self.w: C = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.s: E = None
        self.w: C = None
        self.o: D = None
        self.txt = txt

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

a.o = b
k.s = b
k.z = a
k.w = a
k.q = a
k.v = e
k.y = d
d.t = a
d.o = e
d.v = n
b.p = e
n.v = k
e.y = a
e.s = n
e.w = c
e.o = b
c.t = a
c.o = e
c.v = n
assert e.y.o.p.s.v.txt == "k"