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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: F = None
        self.y: A = None
        self.s: A = None
        self.x: F = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: D = None
        self.q: I = None
        self.s: F = None
        self.z: B = None
        self.p: D = None
        self.v: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: I = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: I = None
        self.u: B = None
        self.t: C = None
        self.w: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: D = None
        self.t: B = None
        self.o: G = None
        self.x: A = None
        self.p: E = None
        self.z: D = None
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: I = None
        self.q: D = None
        self.y: I = None
        self.r: A = None
        self.v: E = None
        self.w: G = None
        self.z: E = None
        self.x: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: F = None
        self.y: A = None
        self.s: A = None
        self.x: F = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: D = None
        self.q: I = None
        self.s: F = None
        self.z: B = None
        self.p: D = None
        self.v: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: I = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: I = None
        self.u: B = None
        self.t: C = None
        self.w: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: D = None
        self.t: B = None
        self.o: G = None
        self.x: A = None
        self.p: E = None
        self.z: D = None
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: I = None
        self.q: D = None
        self.y: I = None
        self.r: A = None
        self.v: E = None
        self.w: G = None
        self.z: E = None
        self.x: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.txt = txt

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

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

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