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

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

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

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

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

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