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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: D = None
        self.q: B = None
        self.r: A = None
        self.v: E = None
        self.s: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: H = None
        self.y: C = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: C = None
        self.r: C = None
        self.q: A = None
        self.z: B = None
        self.u: C = None
        self.s: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: G = None
        self.o: A = None
        self.y: A = None
        self.t: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: A = None
        self.q: A = None
        self.z: E = None
        self.x: I = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: D = None
        self.q: B = None
        self.r: A = None
        self.v: E = None
        self.s: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: H = None
        self.y: C = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: C = None
        self.r: C = None
        self.q: A = None
        self.z: B = None
        self.u: C = None
        self.s: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: G = None
        self.o: A = None
        self.y: A = None
        self.t: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: A = None
        self.q: A = None
        self.z: E = None
        self.x: I = None
        self.txt = txt

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

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

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