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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.p: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: A = None
        self.v: D = None
        self.r: B = None
        self.q: G = None
        self.y: E = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.p: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: A = None
        self.v: D = None
        self.r: B = None
        self.q: G = None
        self.y: E = None
        self.txt = txt

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

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

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

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