class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: H = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: C = None
        self.t: D = None
        self.q: D = None
        self.p: A = None
        self.u: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: C = None
        self.v: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: C = None
        self.x: C = None
        self.u: E = None
        self.q: F = None
        self.p: B = None
        self.z: H = None
        self.y: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.o: A = None
        self.q: E = None
        self.s: A = None
        self.x: G = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: C = None
        self.t: D = None
        self.q: D = None
        self.p: A = None
        self.u: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: C = None
        self.v: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: C = None
        self.x: C = None
        self.u: E = None
        self.q: F = None
        self.p: B = None
        self.z: H = None
        self.y: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.o: A = None
        self.q: E = None
        self.s: A = None
        self.x: G = None
        self.txt = txt

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

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