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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: I = None
        self.o: E = None
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: I = None
        self.p: C = None
        self.t: B = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.w: B = None
        self.v: I = None
        self.x: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: E = None
        self.s: B = None
        self.y: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: I = None
        self.o: E = None
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: I = None
        self.p: C = None
        self.t: B = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.w: B = None
        self.v: I = None
        self.x: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: E = None
        self.s: B = None
        self.y: F = None
        self.txt = txt

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

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