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

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.r: B = None
        self.s: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: A = None
        self.o: F = None
        self.r: E = None
        self.s: I = None
        self.u: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.r: B = None
        self.s: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: A = None
        self.o: F = None
        self.r: E = None
        self.s: I = None
        self.u: B = None
        self.txt = txt

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

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

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