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

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

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.z: I = None
        self.y: E = None
        self.v: I = None
        self.w: I = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.w: A = None
        self.y: G = None
        self.v: A = None
        self.p: H = None
        self.o: C = None
        self.u: C = None
        self.x: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: C = None
        self.w: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.z: I = None
        self.y: E = None
        self.v: I = None
        self.w: I = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.w: A = None
        self.y: G = None
        self.v: A = None
        self.p: H = None
        self.o: C = None
        self.u: C = None
        self.x: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: C = None
        self.w: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

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