class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: H = None
        self.x: B = None
        self.u: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: G = None
        self.u: F = None
        self.p: H = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: E = None
        self.q: D = None
        self.s: B = None
        self.t: C = None
        self.u: G = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: G = None
        self.u: F = None
        self.p: H = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: E = None
        self.q: D = None
        self.s: B = None
        self.t: C = None
        self.u: G = None
        self.txt = txt

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

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

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

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