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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: F = None
        self.x: F = None
        self.v: G = None
        self.u: D = None
        self.q: G = None
        self.s: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: D = None
        self.y: C = None
        self.u: H = None
        self.o: H = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: F = None
        self.x: F = None
        self.v: G = None
        self.u: D = None
        self.q: G = None
        self.s: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: D = None
        self.y: C = None
        self.u: H = None
        self.o: H = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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