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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: G = None
        self.r: E = None
        self.x: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: D = None
        self.w: A = None
        self.y: E = None
        self.txt = txt

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

k.y = c
f.o = i
f.z = c
m.z = c
m.x = c
m.u = l
h.o = k
h.z = l
a.z = k
a.v = k
a.y = h
a.u = d
a.r = d
a.p = m
d.v = m
d.o = c
d.r = a
d.x = a
c.x = l
c.p = h
c.w = k
c.y = a
l.z = c
l.x = c
l.u = m
j.o = k
j.z = m
i.o = f
i.z = c
assert m.z.p.o.y.p.o.y.p.o.txt == "
class A:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: G = None
        self.r: E = None
        self.x: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: D = None
        self.w: A = None
        self.y: E = None
        self.txt = txt

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

k.y = c
f.o = i
f.z = c
m.z = c
m.x = c
m.u = l
h.o = k
h.z = l
a.z = k
a.v = k
a.y = h
a.u = d
a.r = d
a.p = m
d.v = m
d.o = c
d.r = a
d.x = a
c.x = l
c.p = h
c.w = k
c.y = a
l.z = c
l.x = c
l.u = m
j.o = k
j.z = m
i.o = f
i.z = c
assert m.z.p.o.y.p.o.y.p.o.txt == "k"