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

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

class C:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: C = None
        self.t: D = None
        self.x: D = None
        self.y: D = None
        self.o: E = None
        self.txt = txt

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

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

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

k = A("k")
h = B("h")
a = C("a")
d = D("d")
m = E("m")
c = F("c")
f = C("f")

k.s = h
h.v = k
h.z = k
h.t = a
h.o = c
a.u = f
a.q = f
a.t = d
a.x = d
a.y = d
a.o = m
d.r = c
d.z = k
m.u = k
m.q = f
m.z = f
m.v = h
m.t = c
c.o = k
f.u = a
f.q = a
f.t = d
f.x = d
f.y = d
f.o = m
assert k.s.z.s.v.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: C = None
        self.t: D = None
        self.x: D = None
        self.y: D = None
        self.o: E = None
        self.txt = txt

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

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

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

k = A("k")
h = B("h")
a = C("a")
d = D("d")
m = E("m")
c = F("c")
f = C("f")

k.s = h
h.v = k
h.z = k
h.t = a
h.o = c
a.u = f
a.q = f
a.t = d
a.x = d
a.y = d
a.o = m
d.r = c
d.z = k
m.u = k
m.q = f
m.z = f
m.v = h
m.t = c
c.o = k
f.u = a
f.q = a
f.t = d
f.x = d
f.y = d
f.o = m
assert k.s.z.s.v.txt == "k"