class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: F = None
        self.t: F = None
        self.p: H = None
        self.y: F = None
        self.q: C = None
        self.u: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.r: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: I = None
        self.p: H = None
        self.u: A = None
        self.t: A = None
        self.q: G = None
        self.y: C = None
        self.x: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: I = None
        self.z: F = None
        self.w: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.q: F = None
        self.w: A = None
        self.o: I = None
        self.x: E = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.r: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: I = None
        self.p: H = None
        self.u: A = None
        self.t: A = None
        self.q: G = None
        self.y: C = None
        self.x: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: I = None
        self.z: F = None
        self.w: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.q: F = None
        self.w: A = None
        self.o: I = None
        self.x: E = None
        self.txt = txt

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

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

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