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

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

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

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: A = None
        self.w: H = None
        self.z: H = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: B = None
        self.r: G = None
        self.y: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: C = None
        self.r: A = None
        self.z: B = None
        self.s: G = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: A = None
        self.w: H = None
        self.z: H = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: B = None
        self.r: G = None
        self.y: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: C = None
        self.r: A = None
        self.z: B = None
        self.s: G = None
        self.txt = txt

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

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