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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: H = None
        self.w: C = None
        self.z: F = None
        self.q: G = None
        self.v: I = None
        self.u: E = None
        self.y: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: I = None
        self.z: C = None
        self.v: G = None
        self.o: H = None
        self.p: C = None
        self.s: I = None
        self.t: E = None
        self.u: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: I = None
        self.r: H = None
        self.u: B = None
        self.p: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: A = None
        self.x: H = None
        self.r: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: C = None
        self.r: C = None
        self.o: C = None
        self.p: G = None
        self.z: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: H = None
        self.w: C = None
        self.z: F = None
        self.q: G = None
        self.v: I = None
        self.u: E = None
        self.y: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: I = None
        self.z: C = None
        self.v: G = None
        self.o: H = None
        self.p: C = None
        self.s: I = None
        self.t: E = None
        self.u: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: I = None
        self.r: H = None
        self.u: B = None
        self.p: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: A = None
        self.x: H = None
        self.r: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: C = None
        self.r: C = None
        self.o: C = None
        self.p: G = None
        self.z: G = None
        self.txt = txt

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

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