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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: F = None
        self.v: F = None
        self.s: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.q: C = None
        self.o: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.q: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: C = None
        self.y: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: F = None
        self.v: F = None
        self.s: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.q: C = None
        self.o: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.q: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: C = None
        self.y: E = None
        self.txt = txt

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

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