class A:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: C = None
        self.o: H = None
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: F = None
        self.p: A = None
        self.w: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: C = None
        self.p: E = None
        self.t: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: F = None
        self.r: D = None
        self.q: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: C = None
        self.o: H = None
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: F = None
        self.p: A = None
        self.w: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: C = None
        self.p: E = None
        self.t: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: F = None
        self.r: D = None
        self.q: E = None
        self.txt = txt

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

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