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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: F = None
        self.o: G = None
        self.u: F = None
        self.w: F = None
        self.y: D = None
        self.q: F = None
        self.p: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: E = None
        self.p: F = None
        self.y: F = None
        self.x: F = None
        self.r: F = None
        self.w: B = None
        self.u: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: E = None
        self.q: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: G = None
        self.txt = txt

n = A("n")
k = B("k")
i = C("i")
f = D("f")
d = E("d")
e = F("e")
j = G("j")
b = H("b")
a = E("a")

n.r = k
n.s = k
n.u = k
k.z = a
k.r = e
k.u = e
k.w = e
k.q = e
k.o = j
k.y = f
k.p = b
i.u = e
i.z = f
f.t = n
f.z = d
f.p = e
f.y = e
f.x = e
f.r = e
f.w = k
f.u = b
d.r = f
d.q = i
e.z = b
j.o = a
j.u = a
j.q = e
b.w = e
b.s = j
a.r = f
a.q = i
assert b.s.q.z.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: B = None
        self.u: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: F = None
        self.o: G = None
        self.u: F = None
        self.w: F = None
        self.y: D = None
        self.q: F = None
        self.p: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: E = None
        self.p: F = None
        self.y: F = None
        self.x: F = None
        self.r: F = None
        self.w: B = None
        self.u: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: E = None
        self.q: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: G = None
        self.txt = txt

n = A("n")
k = B("k")
i = C("i")
f = D("f")
d = E("d")
e = F("e")
j = G("j")
b = H("b")
a = E("a")

n.r = k
n.s = k
n.u = k
k.z = a
k.r = e
k.u = e
k.w = e
k.q = e
k.o = j
k.y = f
k.p = b
i.u = e
i.z = f
f.t = n
f.z = d
f.p = e
f.y = e
f.x = e
f.r = e
f.w = k
f.u = b
d.r = f
d.q = i
e.z = b
j.o = a
j.u = a
j.q = e
b.w = e
b.s = j
a.r = f
a.q = i
assert b.s.q.z.txt == "b"