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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: D = None
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: E = None
        self.o: B = None
        self.q: G = None
        self.t: E = None
        self.u: E = None
        self.x: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: C = None
        self.t: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

m = A("m")
i = B("i")
n = C("n")
d = D("d")
e = E("e")
a = F("a")
l = G("l")
h = H("h")

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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: D = None
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: E = None
        self.o: B = None
        self.q: G = None
        self.t: E = None
        self.u: E = None
        self.x: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: C = None
        self.t: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

m = A("m")
i = B("i")
n = C("n")
d = D("d")
e = E("e")
a = F("a")
l = G("l")
h = H("h")

m.r = i
i.z = d
i.q = d
i.v = e
n.z = d
n.r = e
n.t = e
n.u = e
n.x = e
n.o = i
n.q = l
d.o = i
d.q = e
d.p = l
d.s = h
e.r = i
e.p = n
e.t = a
a.s = m
l.w = i
h.s = i
h.v = i
h.w = a
h.q = a
h.z = a
h.r = d
h.t = l
assert d.p.w.v.txt == "e"