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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: D = None
        self.s: H = None
        self.y: D = None
        self.o: B = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.y: B = None
        self.z: B = None
        self.p: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: G = None
        self.u: D = None
        self.r: G = None
        self.t: A = None
        self.txt = txt

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

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

a = A("a")
m = B("m")
e = C("e")
n = D("n")
d = E("d")
f = F("f")
g = G("g")
i = H("i")
l = G("l")

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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: D = None
        self.s: H = None
        self.y: D = None
        self.o: B = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.y: B = None
        self.z: B = None
        self.p: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: G = None
        self.u: D = None
        self.r: G = None
        self.t: A = None
        self.txt = txt

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

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

a = A("a")
m = B("m")
e = C("e")
n = D("n")
d = E("d")
f = F("f")
g = G("g")
i = H("i")
l = G("l")

a.v = d
m.r = d
m.w = d
m.v = e
m.z = l
m.q = f
m.p = i
m.x = i
m.t = g
e.w = m
e.o = m
e.v = n
e.y = n
e.z = n
e.s = i
n.t = i
n.y = m
n.z = m
n.p = l
d.u = m
d.o = l
d.y = e
f.s = n
f.u = n
f.z = g
f.r = g
f.t = a
g.t = l
i.x = n
i.p = a
i.w = e
l.t = g
assert n.t.x.y.t.t.t.t.t.txt == "g"