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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: H = None
        self.w: G = None
        self.x: H = None
        self.u: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: H = None
        self.v: H = None
        self.o: G = None
        self.u: H = None
        self.y: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: I = None
        self.p: H = None
        self.u: G = None
        self.r: G = None
        self.t: I = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: D = None
        self.t: G = None
        self.q: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: H = None
        self.s: C = None
        self.y: F = None
        self.q: H = None
        self.w: C = None
        self.o: F = None
        self.p: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: H = None
        self.w: G = None
        self.x: H = None
        self.u: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: H = None
        self.v: H = None
        self.o: G = None
        self.u: H = None
        self.y: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: I = None
        self.p: H = None
        self.u: G = None
        self.r: G = None
        self.t: I = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: D = None
        self.t: G = None
        self.q: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: H = None
        self.s: C = None
        self.y: F = None
        self.q: H = None
        self.w: C = None
        self.o: F = None
        self.p: D = None
        self.txt = txt

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

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