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

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

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: C = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.s: D = None
        self.p: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: G = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: C = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.s: D = None
        self.p: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: G = None
        self.txt = txt

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

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