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

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

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.u: H = None
        self.v: I = None
        self.t: D = None
        self.y: H = None
        self.q: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: C = None
        self.u: A = None
        self.p: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: E = None
        self.p: D = None
        self.z: C = None
        self.x: B = None
        self.t: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: I = None
        self.o: I = None
        self.w: E = None
        self.x: I = None
        self.y: G = None
        self.v: C = None
        self.t: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: E = None
        self.q: G = None
        self.v: F = None
        self.z: H = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.u: H = None
        self.v: I = None
        self.t: D = None
        self.y: H = None
        self.q: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: C = None
        self.u: A = None
        self.p: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: E = None
        self.p: D = None
        self.z: C = None
        self.x: B = None
        self.t: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: I = None
        self.o: I = None
        self.w: E = None
        self.x: I = None
        self.y: G = None
        self.v: C = None
        self.t: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: E = None
        self.q: G = None
        self.v: F = None
        self.z: H = None
        self.txt = txt

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

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