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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: G = None
        self.s: A = None
        self.q: B = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: G = None
        self.v: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.o: C = None
        self.z: A = None
        self.u: G = None
        self.p: C = None
        self.v: A = None
        self.s: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: E = None
        self.v: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: G = None
        self.s: A = None
        self.q: B = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: G = None
        self.v: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.o: C = None
        self.z: A = None
        self.u: G = None
        self.p: C = None
        self.v: A = None
        self.s: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: E = None
        self.v: E = None
        self.txt = txt

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

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