class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.p: B = None
        self.u: B = None
        self.q: G = None
        self.w: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.w: G = None
        self.q: H = None
        self.r: F = None
        self.y: A = None
        self.u: A = None
        self.o: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.s: H = None
        self.t: D = None
        self.r: F = None
        self.u: D = None
        self.w: E = None
        self.z: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: A = None
        self.u: G = None
        self.q: E = None
        self.s: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.w: G = None
        self.q: H = None
        self.r: F = None
        self.y: A = None
        self.u: A = None
        self.o: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.s: H = None
        self.t: D = None
        self.r: F = None
        self.u: D = None
        self.w: E = None
        self.z: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: A = None
        self.u: G = None
        self.q: E = None
        self.s: B = None
        self.txt = txt

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

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