class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.x: G = None
        self.s: C = None
        self.r: B = None
        self.t: D = None
        self.v: B = None
        self.o: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: E = None
        self.o: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: A = None
        self.x: G = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: D = None
        self.q: F = None
        self.y: B = None
        self.v: C = None
        self.p: F = None
        self.w: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: E = None
        self.q: B = None
        self.u: E = None
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: E = None
        self.o: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: A = None
        self.x: G = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: D = None
        self.q: F = None
        self.y: B = None
        self.v: C = None
        self.p: F = None
        self.w: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: E = None
        self.q: B = None
        self.u: E = None
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

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