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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: A = None
        self.w: D = None
        self.q: D = None
        self.p: D = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: B = None
        self.w: B = None
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: A = None
        self.o: B = None
        self.q: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: D = None
        self.q: C = None
        self.txt = txt

j = A("j")
d = B("d")
b = C("b")
n = D("n")
m = E("m")
a = F("a")

j.w = a
j.s = n
j.t = d
d.z = n
d.w = n
d.q = n
d.p = n
d.v = n
d.u = j
b.p = m
b.q = d
b.w = d
b.y = j
n.p = a
n.q = a
n.s = j
n.o = d
m.w = n
m.p = n
m.u = n
m.z = b
a.x = b
a.q = b
a.w = n
assert n.q.w.o.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: D = None
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: A = None
        self.w: D = None
        self.q: D = None
        self.p: D = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: B = None
        self.w: B = None
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: A = None
        self.o: B = None
        self.q: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: D = None
        self.q: C = None
        self.txt = txt

j = A("j")
d = B("d")
b = C("b")
n = D("n")
m = E("m")
a = F("a")

j.w = a
j.s = n
j.t = d
d.z = n
d.w = n
d.q = n
d.p = n
d.v = n
d.u = j
b.p = m
b.q = d
b.w = d
b.y = j
n.p = a
n.q = a
n.s = j
n.o = d
m.w = n
m.p = n
m.u = n
m.z = b
a.x = b
a.q = b
a.w = n
assert n.q.w.o.w.txt == "n"