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

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

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: C = None
        self.z: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: D = None
        self.t: D = None
        self.x: F = None
        self.s: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: C = None
        self.x: B = None
        self.z: D = None
        self.w: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: C = None
        self.z: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: D = None
        self.t: D = None
        self.x: F = None
        self.s: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: C = None
        self.x: B = None
        self.z: D = None
        self.w: E = None
        self.txt = txt

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

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