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

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: G = None
        self.v: G = None
        self.u: B = None
        self.y: B = None
        self.p: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: C = None
        self.o: B = None
        self.w: D = None
        self.z: E = None
        self.q: D = None
        self.v: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: G = None
        self.v: G = None
        self.u: B = None
        self.y: B = None
        self.p: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: C = None
        self.o: B = None
        self.w: D = None
        self.z: E = None
        self.q: D = None
        self.v: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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