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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: G = None
        self.x: C = None
        self.u: H = None
        self.r: C = None
        self.t: G = None
        self.z: D = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: E = None
        self.r: D = None
        self.u: D = None
        self.x: F = None
        self.o: H = None
        self.t: B = None
        self.s: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: E = None
        self.t: A = None
        self.u: E = None
        self.v: B = None
        self.y: D = None
        self.w: F = None
        self.x: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.s: H = None
        self.z: F = None
        self.y: E = None
        self.v: A = None
        self.x: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: G = None
        self.x: C = None
        self.u: H = None
        self.r: C = None
        self.t: G = None
        self.z: D = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: E = None
        self.r: D = None
        self.u: D = None
        self.x: F = None
        self.o: H = None
        self.t: B = None
        self.s: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: E = None
        self.t: A = None
        self.u: E = None
        self.v: B = None
        self.y: D = None
        self.w: F = None
        self.x: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.s: H = None
        self.z: F = None
        self.y: E = None
        self.v: A = None
        self.x: G = None
        self.txt = txt

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

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