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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: C = None
        self.o: H = None
        self.s: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: F = None
        self.t: D = None
        self.u: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.z: F = None
        self.y: E = None
        self.t: E = None
        self.p: G = None
        self.w: A = None
        self.o: H = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: B = None
        self.t: I = None
        self.w: I = None
        self.o: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: C = None
        self.z: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: C = None
        self.o: H = None
        self.s: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: F = None
        self.t: D = None
        self.u: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.z: F = None
        self.y: E = None
        self.t: E = None
        self.p: G = None
        self.w: A = None
        self.o: H = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: B = None
        self.t: I = None
        self.w: I = None
        self.o: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: C = None
        self.z: H = None
        self.txt = txt

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

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