class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: H = None
        self.w: G = None
        self.s: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: A = None
        self.q: B = None
        self.r: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: I = None
        self.s: H = None
        self.w: A = None
        self.v: F = None
        self.p: A = None
        self.t: C = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: A = None
        self.z: H = None
        self.r: B = None
        self.v: B = None
        self.y: G = None
        self.o: B = None
        self.s: F = None
        self.txt = txt

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

a.q = l
a.r = h
a.w = m
a.s = b
j.v = h
j.y = c
j.u = a
j.w = a
j.s = m
j.x = f
g.t = m
g.z = a
g.q = j
g.r = h
c.s = g
c.w = m
c.o = l
l.u = f
l.s = h
l.w = a
l.p = a
l.v = b
l.t = g
b.w = h
m.r = a
m.u = a
m.w = l
m.s = l
m.v = g
m.y = g
m.o = h
m.t = c
h.t = g
f.q = b
f.s = b
f.u = a
f.z = h
f.r = j
f.v = j
f.o = j
f.y = m
assert c.s.t.t.w.s.t.z.w.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: H = None
        self.w: G = None
        self.s: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: A = None
        self.q: B = None
        self.r: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: I = None
        self.s: H = None
        self.w: A = None
        self.v: F = None
        self.p: A = None
        self.t: C = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: A = None
        self.z: H = None
        self.r: B = None
        self.v: B = None
        self.y: G = None
        self.o: B = None
        self.s: F = None
        self.txt = txt

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

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