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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: E = None
        self.y: E = None
        self.o: F = None
        self.s: F = None
        self.u: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: B = None
        self.y: A = None
        self.w: B = None
        self.r: A = None
        self.o: E = None
        self.txt = txt

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

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

k = A("k")
f = B("f")
l = C("l")
d = D("d")
n = E("n")
g = F("g")

k.z = f
f.w = n
f.t = n
f.y = n
f.o = g
f.s = g
f.u = g
l.o = g
d.v = f
d.u = f
d.w = f
d.y = k
d.r = k
d.o = n
n.p = d
n.u = g
g.r = f
g.s = k
assert l.o.s.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: E = None
        self.y: E = None
        self.o: F = None
        self.s: F = None
        self.u: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: B = None
        self.y: A = None
        self.w: B = None
        self.r: A = None
        self.o: E = None
        self.txt = txt

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

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

k = A("k")
f = B("f")
l = C("l")
d = D("d")
n = E("n")
g = F("g")

k.z = f
f.w = n
f.t = n
f.y = n
f.o = g
f.s = g
f.u = g
l.o = g
d.v = f
d.u = f
d.w = f
d.y = k
d.r = k
d.o = n
n.p = d
n.u = g
g.r = f
g.s = k
assert l.o.s.z.txt == "f"