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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: A = None
        self.x: A = None
        self.z: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: G = None
        self.s: A = None
        self.p: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: A = None
        self.x: A = None
        self.z: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: G = None
        self.s: A = None
        self.p: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

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

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

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

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