class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: I = None
        self.y: C = None
        self.r: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: A = None
        self.y: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: H = None
        self.v: D = None
        self.r: E = None
        self.p: G = None
        self.o: F = None
        self.x: I = None
        self.s: E = None
        self.u: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: I = None
        self.v: C = None
        self.s: C = None
        self.r: F = None
        self.p: I = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: A = None
        self.y: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: H = None
        self.v: D = None
        self.r: E = None
        self.p: G = None
        self.o: F = None
        self.x: I = None
        self.s: E = None
        self.u: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: I = None
        self.v: C = None
        self.s: C = None
        self.r: F = None
        self.p: I = None
        self.txt = txt

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

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

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

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

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

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

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