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

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: B = None
        self.r: E = None
        self.p: B = None
        self.q: E = None
        self.w: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: B = None
        self.txt = txt

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

n = A("n")
i = B("i")
d = C("d")
g = D("g")
m = E("m")
b = F("b")

n.w = d
n.u = m
n.r = i
n.z = i
n.o = g
n.y = g
i.z = g
i.r = n
d.o = g
d.u = i
d.p = i
d.w = i
d.r = m
d.q = m
g.z = d
g.v = i
g.t = n
g.w = m
m.w = g
m.q = i
b.o = n
b.y = m
b.s = i
assert b.y.w.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: E = None
        self.r: B = None
        self.z: B = None
        self.o: D = None
        self.y: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: B = None
        self.r: E = None
        self.p: B = None
        self.q: E = None
        self.w: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: B = None
        self.txt = txt

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

n = A("n")
i = B("i")
d = C("d")
g = D("g")
m = E("m")
b = F("b")

n.w = d
n.u = m
n.r = i
n.z = i
n.o = g
n.y = g
i.z = g
i.r = n
d.o = g
d.u = i
d.p = i
d.w = i
d.r = m
d.q = m
g.z = d
g.v = i
g.t = n
g.w = m
m.w = g
m.q = i
b.o = n
b.y = m
b.s = i
assert b.y.w.t.txt == "n"