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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: G = None
        self.p: D = None
        self.u: F = None
        self.x: E = None
        self.r: F = None
        self.t: D = None
        self.o: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: G = None
        self.z: I = None
        self.s: A = None
        self.w: A = None
        self.x: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.t: D = None
        self.x: A = None
        self.v: H = None
        self.p: A = None
        self.u: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: C = None
        self.o: E = None
        self.u: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.w: A = None
        self.v: A = None
        self.o: H = None
        self.q: D = None
        self.p: B = None
        self.x: A = None
        self.y: D = None
        self.u: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: B = None
        self.u: H = None
        self.y: A = None
        self.p: D = None
        self.o: A = None
        self.z: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: G = None
        self.p: D = None
        self.u: F = None
        self.x: E = None
        self.r: F = None
        self.t: D = None
        self.o: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: G = None
        self.z: I = None
        self.s: A = None
        self.w: A = None
        self.x: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.t: D = None
        self.x: A = None
        self.v: H = None
        self.p: A = None
        self.u: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: C = None
        self.o: E = None
        self.u: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.w: A = None
        self.v: A = None
        self.o: H = None
        self.q: D = None
        self.p: B = None
        self.x: A = None
        self.y: D = None
        self.u: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: B = None
        self.u: H = None
        self.y: A = None
        self.p: D = None
        self.o: A = None
        self.z: A = None
        self.txt = txt

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

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