class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.z: G = None
        self.q: G = None
        self.x: I = None
        self.v: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: I = None
        self.o: A = None
        self.s: D = None
        self.w: I = None
        self.t: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: H = None
        self.w: B = None
        self.x: I = None
        self.s: H = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: I = None
        self.o: A = None
        self.s: D = None
        self.w: I = None
        self.t: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: H = None
        self.w: B = None
        self.x: I = None
        self.s: H = None
        self.txt = txt

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

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

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

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