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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.s: H = None
        self.u: E = None
        self.t: B = None
        self.x: A = None
        self.w: H = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.s: H = None
        self.u: E = None
        self.t: B = None
        self.x: A = None
        self.w: H = None
        self.txt = txt

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

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