class A:
    def __init__(self, txt: str):
        self.u: H = None
        self.q: I = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: I = None
        self.o: B = None
        self.w: F = None
        self.r: I = None
        self.y: I = None
        self.v: E = None
        self.u: D = None
        self.x: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: D = None
        self.y: A = None
        self.t: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: I = None
        self.o: B = None
        self.w: F = None
        self.r: I = None
        self.y: I = None
        self.v: E = None
        self.u: D = None
        self.x: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: D = None
        self.y: A = None
        self.t: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: A = None
        self.txt = txt

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

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

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