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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: H = None
        self.u: C = None
        self.x: C = None
        self.t: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.u: F = None
        self.s: H = None
        self.p: C = None
        self.r: F = None
        self.z: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: B = None
        self.t: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: B = None
        self.u: E = None
        self.t: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: H = None
        self.u: C = None
        self.x: C = None
        self.t: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.u: F = None
        self.s: H = None
        self.p: C = None
        self.r: F = None
        self.z: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: B = None
        self.t: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: B = None
        self.u: E = None
        self.t: F = None
        self.txt = txt

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

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