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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: D = None
        self.z: H = None
        self.y: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: I = None
        self.q: E = None
        self.z: I = None
        self.o: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: H = None
        self.u: I = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: A = None
        self.p: C = None
        self.r: B = None
        self.q: H = None
        self.v: B = None
        self.z: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: D = None
        self.z: H = None
        self.y: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: I = None
        self.q: E = None
        self.z: I = None
        self.o: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: H = None
        self.u: I = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: A = None
        self.p: C = None
        self.r: B = None
        self.q: H = None
        self.v: B = None
        self.z: G = None
        self.txt = txt

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

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