class A:
    def __init__(self, txt: str):
        self.r: I = None
        self.s: H = None
        self.z: B = None
        self.p: H = None
        self.q: B = None
        self.x: I = None
        self.v: G = None
        self.t: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: G = None
        self.q: I = None
        self.r: E = None
        self.y: I = None
        self.v: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: F = None
        self.q: G = None
        self.u: G = None
        self.w: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: F = None
        self.w: E = None
        self.x: B = None
        self.t: I = None
        self.s: B = None
        self.q: B = None
        self.v: E = None
        self.o: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: B = None
        self.u: G = None
        self.o: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: G = None
        self.q: I = None
        self.r: E = None
        self.y: I = None
        self.v: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: F = None
        self.q: G = None
        self.u: G = None
        self.w: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: F = None
        self.w: E = None
        self.x: B = None
        self.t: I = None
        self.s: B = None
        self.q: B = None
        self.v: E = None
        self.o: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: B = None
        self.u: G = None
        self.o: B = None
        self.txt = txt

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

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

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