class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: I = None
        self.u: B = None
        self.w: A = None
        self.z: F = None
        self.v: D = None
        self.r: C = None
        self.p: B = None
        self.t: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.y: G = None
        self.w: I = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: I = None
        self.u: B = None
        self.w: A = None
        self.z: F = None
        self.v: D = None
        self.r: C = None
        self.p: B = None
        self.t: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.y: G = None
        self.w: I = None
        self.txt = txt

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

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

m.z = d
n.s = g
n.o = d
g.r = f
d.v = f
d.y = g
c.y = i
c.u = n
c.p = n
c.w = m
c.z = f
c.v = b
c.r = g
c.t = e
f.x = h
f.y = m
f.v = c
h.u = e
h.z = g
h.v = i
e.y = h
e.w = i
i.t = f
b.v = f
b.y = g
assert i.t.x.v.t.x.v.t.x.txt == "h"