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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: D = None
        self.x: H = None
        self.q: D = None
        self.o: G = None
        self.u: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: C = None
        self.v: C = None
        self.x: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: D = None
        self.o: A = None
        self.r: C = None
        self.w: A = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: D = None
        self.x: H = None
        self.q: D = None
        self.o: G = None
        self.u: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: C = None
        self.v: C = None
        self.x: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: D = None
        self.o: A = None
        self.r: C = None
        self.w: A = None
        self.txt = txt

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

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