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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: A = None
        self.y: A = None
        self.t: A = None
        self.r: D = None
        self.u: F = None
        self.p: F = None
        self.s: I = None
        self.o: G = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: E = None
        self.o: E = None
        self.r: D = None
        self.p: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: F = None
        self.p: C = None
        self.x: F = None
        self.s: F = None
        self.t: A = None
        self.w: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: A = None
        self.y: A = None
        self.t: A = None
        self.r: D = None
        self.u: F = None
        self.p: F = None
        self.s: I = None
        self.o: G = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: E = None
        self.o: E = None
        self.r: D = None
        self.p: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: F = None
        self.p: C = None
        self.x: F = None
        self.s: F = None
        self.t: A = None
        self.w: A = None
        self.txt = txt

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

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

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