class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.q: D = None
        self.p: B = None
        self.s: D = None
        self.r: I = None
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.v: F = None
        self.y: D = None
        self.o: D = None
        self.z: A = None
        self.t: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: I = None
        self.p: I = None
        self.y: A = None
        self.w: E = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.v: F = None
        self.y: D = None
        self.o: D = None
        self.z: A = None
        self.t: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: I = None
        self.p: I = None
        self.y: A = None
        self.w: E = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: B = None
        self.txt = txt

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

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

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