class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: C = None
        self.v: A = None
        self.t: C = None
        self.q: G = None
        self.r: C = None
        self.z: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: C = None
        self.v: H = None
        self.z: A = None
        self.t: F = None
        self.x: G = None
        self.y: F = None
        self.p: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.z: A = None
        self.t: E = None
        self.u: B = None
        self.p: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: B = None
        self.q: D = None
        self.s: E = None
        self.x: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: C = None
        self.v: H = None
        self.z: A = None
        self.t: F = None
        self.x: G = None
        self.y: F = None
        self.p: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.z: A = None
        self.t: E = None
        self.u: B = None
        self.p: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: B = None
        self.q: D = None
        self.s: E = None
        self.x: A = None
        self.txt = txt

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

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

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