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

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: D = None
        self.s: F = 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.s: A = None
        self.v: C = None
        self.q: C = None
        self.t: D = None
        self.p: F = None
        self.y: B = None
        self.txt = txt

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

n = A("n")
h = B("h")
m = C("m")
a = D("a")
k = E("k")
g = F("g")

n.w = a
h.w = g
h.u = g
h.y = m
h.v = m
h.q = a
h.t = k
m.o = k
m.t = a
m.s = g
a.z = m
k.s = n
k.v = m
k.q = m
k.t = a
k.p = g
k.y = h
g.o = h
g.r = n
g.q = m
assert m.t.z.o.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: D = None
        self.s: F = 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.s: A = None
        self.v: C = None
        self.q: C = None
        self.t: D = None
        self.p: F = None
        self.y: B = None
        self.txt = txt

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

n = A("n")
h = B("h")
m = C("m")
a = D("a")
k = E("k")
g = F("g")

n.w = a
h.w = g
h.u = g
h.y = m
h.v = m
h.q = a
h.t = k
m.o = k
m.t = a
m.s = g
a.z = m
k.s = n
k.v = m
k.q = m
k.t = a
k.p = g
k.y = h
g.o = h
g.r = n
g.q = m
assert m.t.z.o.txt == "k"