class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.u: A = None
        self.r: C = None
        self.z: E = None
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: D = None
        self.o: G = None
        self.w: H = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.u: A = None
        self.r: C = None
        self.z: E = None
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: D = None
        self.o: G = None
        self.w: H = None
        self.txt = txt

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

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

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