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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: C = None
        self.z: G = None
        self.q: D = None
        self.x: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.w: H = None
        self.y: A = None
        self.v: A = None
        self.x: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.v: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: D = None
        self.txt = txt

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

j = A("j")
l = B("l")
e = C("e")
m = D("m")
n = E("n")
d = F("d")
f = G("f")
c = H("c")
g = C("g")
h = H("h")

j.p = l
l.w = m
l.q = m
l.o = e
l.z = f
l.x = d
e.w = c
e.t = c
e.s = j
e.v = d
e.y = n
e.o = n
m.u = h
m.w = c
m.y = j
m.v = j
m.x = n
n.r = c
n.p = d
n.y = d
n.x = m
n.u = h
n.z = h
d.q = h
d.v = j
f.o = m
f.z = m
c.v = f
c.y = f
c.z = d
c.q = l
c.o = j
c.u = m
c.r = e
g.w = c
g.t = c
g.s = j
g.v = d
g.y = n
g.o = n
h.v = f
h.y = f
h.z = d
h.q = l
h.o = j
h.u = m
h.r = g
assert m.y.p.o.w.r.y.z.o.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: C = None
        self.z: G = None
        self.q: D = None
        self.x: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.w: H = None
        self.y: A = None
        self.v: A = None
        self.x: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.v: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: D = None
        self.txt = txt

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

j = A("j")
l = B("l")
e = C("e")
m = D("m")
n = E("n")
d = F("d")
f = G("f")
c = H("c")
g = C("g")
h = H("h")

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