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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: G = None
        self.t: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: G = None
        self.s: H = None
        self.w: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: A = None
        self.t: B = None
        self.r: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: H = None
        self.z: B = None
        self.y: A = None
        self.p: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: G = None
        self.t: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: G = None
        self.s: H = None
        self.w: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: A = None
        self.t: B = None
        self.r: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: H = None
        self.z: B = None
        self.y: A = None
        self.p: B = None
        self.txt = txt

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

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