class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: F = None
        self.s: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: H = None
        self.o: F = None
        self.v: I = None
        self.z: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: A = None
        self.s: H = None
        self.r: B = None
        self.o: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.y: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: H = None
        self.o: F = None
        self.v: I = None
        self.z: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: A = None
        self.s: H = None
        self.r: B = None
        self.o: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.y: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: G = None
        self.txt = txt

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

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