class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.r: H = None
        self.y: H = None
        self.v: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: E = None
        self.q: G = None
        self.p: H = None
        self.y: D = None
        self.o: F = None
        self.s: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: A = None
        self.o: E = None
        self.y: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: A = None
        self.w: D = None
        self.y: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: G = None
        self.x: G = None
        self.o: G = None
        self.p: C = None
        self.s: D = None
        self.v: C = None
        self.t: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: E = None
        self.q: G = None
        self.p: H = None
        self.y: D = None
        self.o: F = None
        self.s: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: A = None
        self.o: E = None
        self.y: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: A = None
        self.w: D = None
        self.y: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: G = None
        self.x: G = None
        self.o: G = None
        self.p: C = None
        self.s: D = None
        self.v: C = None
        self.t: A = None
        self.txt = txt

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

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