class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: H = None
        self.o: C = None
        self.u: F = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: A = None
        self.q: A = None
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: B = None
        self.v: F = None
        self.o: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: H = None
        self.o: C = None
        self.u: F = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: A = None
        self.q: A = None
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: B = None
        self.v: F = None
        self.o: B = None
        self.txt = txt

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

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