class A:
    def __init__(self, txt: str):
        self.u: H = None
        self.o: H = None
        self.q: C = None
        self.z: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: G = None
        self.o: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: E = None
        self.u: E = None
        self.o: A = None
        self.r: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

m.u = g
m.o = g
m.q = k
m.z = a
c.s = m
k.o = g
k.r = f
k.p = f
k.v = m
e.s = m
e.u = n
e.o = g
j.r = a
a.q = e
a.r = n
a.s = c
n.t = k
n.z = j
n.u = j
n.o = m
n.r = m
g.p = f
g.z = a
f.u = k
i.s = m
i.u = n
i.o = g
assert g.p.u.v.q.p.u.o.z.q.txt == "
class A:
    def __init__(self, txt: str):
        self.u: H = None
        self.o: H = None
        self.q: C = None
        self.z: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: G = None
        self.o: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: E = None
        self.u: E = None
        self.o: A = None
        self.r: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

m.u = g
m.o = g
m.q = k
m.z = a
c.s = m
k.o = g
k.r = f
k.p = f
k.v = m
e.s = m
e.u = n
e.o = g
j.r = a
a.q = e
a.r = n
a.s = c
n.t = k
n.z = j
n.u = j
n.o = m
n.r = m
g.p = f
g.z = a
f.u = k
i.s = m
i.u = n
i.o = g
assert g.p.u.v.q.p.u.o.z.q.txt == "e"