class A:
    def __init__(self, txt: str):
        self.o: H = None
        self.z: H = None
        self.t: A = None
        self.x: E = None
        self.q: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.s: F = None
        self.r: F = None
        self.q: H = None
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.q: H = None
        self.s: E = None
        self.p: E = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: H = None
        self.p: H = None
        self.x: H = None
        self.q: F = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: B = None
        self.t: A = None
        self.x: D = None
        self.s: G = None
        self.txt = txt

b = A("b")
n = B("n")
l = C("l")
j = D("j")
h = E("h")
i = F("i")
d = G("d")
m = H("m")
g = A("g")

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

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.s: F = None
        self.r: F = None
        self.q: H = None
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.q: H = None
        self.s: E = None
        self.p: E = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: H = None
        self.p: H = None
        self.x: H = None
        self.q: F = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: B = None
        self.t: A = None
        self.x: D = None
        self.s: G = None
        self.txt = txt

b = A("b")
n = B("n")
l = C("l")
j = D("j")
h = E("h")
i = F("i")
d = G("d")
m = H("m")
g = A("g")

b.o = m
b.z = m
b.t = g
b.x = h
b.q = n
n.y = m
n.q = m
n.s = i
n.r = i
n.t = h
l.z = d
l.q = m
l.s = h
l.p = h
l.w = i
j.w = g
j.r = m
j.p = m
j.x = m
j.q = i
h.q = d
i.s = h
i.z = d
d.z = j
d.t = h
d.s = n
d.r = i
d.q = b
m.o = l
m.q = n
m.t = b
m.x = j
m.s = d
g.o = m
g.z = m
g.t = b
g.x = h
g.q = n
assert l.q.t.t.q.y.q.y.s.txt == "d"