class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: G = None
        self.q: B = None
        self.x: G = None
        self.o: E = None
        self.u: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.r: C = None
        self.u: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.u: D = None
        self.s: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: H = None
        self.u: D = None
        self.txt = txt

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

m.s = i
m.u = e
i.o = m
i.r = c
i.w = e
e.y = g
e.u = g
e.w = h
e.x = h
e.q = i
e.o = j
g.v = d
j.q = d
a.t = c
a.u = c
a.r = e
h.q = e
h.w = c
h.o = a
c.z = h
c.u = g
c.s = i
d.w = e
d.t = c
d.u = g
assert d.w.o.q.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: G = None
        self.q: B = None
        self.x: G = None
        self.o: E = None
        self.u: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.r: C = None
        self.u: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.u: D = None
        self.s: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: H = None
        self.u: D = None
        self.txt = txt

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

m.s = i
m.u = e
i.o = m
i.r = c
i.w = e
e.y = g
e.u = g
e.w = h
e.x = h
e.q = i
e.o = j
g.v = d
j.q = d
a.t = c
a.u = c
a.r = e
h.q = e
h.w = c
h.o = a
c.z = h
c.u = g
c.s = i
d.w = e
d.t = c
d.u = g
assert d.w.o.q.txt == "d"