class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: D = None
        self.x: F = None
        self.o: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: B = None
        self.r: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

k = A("k")
e = B("e")
j = C("j")
n = D("n")
f = E("f")
d = F("d")
l = F("l")
h = C("h")
b = E("b")

k.w = l
k.p = n
k.x = d
k.o = f
e.w = k
e.u = d
e.p = b
j.t = b
j.q = e
j.r = h
n.s = b
f.w = n
f.z = d
d.u = f
d.w = n
d.z = j
d.v = b
l.u = f
l.v = f
l.w = n
l.z = j
h.t = f
h.q = e
h.r = j
b.w = n
b.z = l
assert n.s.w.s.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: D = None
        self.x: F = None
        self.o: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: B = None
        self.r: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

k = A("k")
e = B("e")
j = C("j")
n = D("n")
f = E("f")
d = F("d")
l = F("l")
h = C("h")
b = E("b")

k.w = l
k.p = n
k.x = d
k.o = f
e.w = k
e.u = d
e.p = b
j.t = b
j.q = e
j.r = h
n.s = b
f.w = n
f.z = d
d.u = f
d.w = n
d.z = j
d.v = b
l.u = f
l.v = f
l.w = n
l.z = j
h.t = f
h.q = e
h.r = j
b.w = n
b.z = l
assert n.s.w.s.z.z.txt == "j"