class A:
    def __init__(self, txt: str):
        self.z: I = None
        self.u: D = None
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: G = None
        self.y: H = None
        self.v: E = None
        self.p: E = None
        self.z: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.r: A = None
        self.s: I = None
        self.q: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.w: G = None
        self.r: I = None
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: A = None
        self.v: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: B = None
        self.u: E = None
        self.o: B = None
        self.p: C = None
        self.y: C = None
        self.s: F = None
        self.v: A = None
        self.x: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.o: G = None
        self.y: E = None
        self.q: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: G = None
        self.y: H = None
        self.v: E = None
        self.p: E = None
        self.z: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.r: A = None
        self.s: I = None
        self.q: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.w: G = None
        self.r: I = None
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: A = None
        self.v: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: B = None
        self.u: E = None
        self.o: B = None
        self.p: C = None
        self.y: C = None
        self.s: F = None
        self.v: A = None
        self.x: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.o: G = None
        self.y: E = None
        self.q: D = None
        self.txt = txt

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

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