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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: H = None
        self.y: D = None
        self.t: F = None
        self.v: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: A = None
        self.o: H = None
        self.p: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: B = None
        self.u: E = None
        self.txt = txt

d = A("d")
i = B("i")
n = C("n")
b = D("b")
h = E("h")
e = F("e")
j = G("j")
g = H("g")
c = A("c")

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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: H = None
        self.y: D = None
        self.t: F = None
        self.v: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: A = None
        self.o: H = None
        self.p: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: B = None
        self.u: E = None
        self.txt = txt

d = A("d")
i = B("i")
n = C("n")
b = D("b")
h = E("h")
e = F("e")
j = G("j")
g = H("g")
c = A("c")

d.p = e
d.t = e
d.s = n
d.v = n
d.o = n
d.r = b
d.z = b
d.q = g
i.z = b
i.y = b
i.x = g
i.t = e
i.v = n
n.w = e
n.q = g
n.x = g
n.u = c
b.r = e
h.r = g
h.x = d
h.t = j
h.w = b
h.q = n
e.o = h
e.p = i
e.u = i
e.q = j
e.w = j
e.x = g
j.x = h
j.z = d
j.o = g
j.p = c
g.v = i
g.s = i
g.u = h
c.p = e
c.t = e
c.s = n
c.v = n
c.o = n
c.r = b
c.z = b
c.q = g
assert n.u.q.u.q.txt == "n"