class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: H = None
        self.y: G = None
        self.p: E = None
        self.o: G = None
        self.v: F = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: E = None
        self.z: F = None
        self.o: B = None
        self.q: B = None
        self.v: A = None
        self.t: B = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: E = None
        self.z: F = None
        self.o: B = None
        self.q: B = None
        self.v: A = None
        self.t: B = None
        self.txt = txt

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

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

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

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