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

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

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

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

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

m = A("m")
l = B("l")
h = C("h")
b = D("b")
k = E("k")
g = B("g")
n = C("n")
a = A("a")
j = D("j")

m.y = a
l.w = g
l.y = g
l.o = m
l.v = k
h.y = n
h.z = k
b.q = j
b.y = a
b.x = m
b.o = k
b.w = n
k.p = b
k.z = n
g.w = l
g.y = l
g.o = m
g.v = k
n.y = h
n.z = k
a.y = m
j.q = b
j.y = m
j.x = a
j.o = k
j.w = h
assert m.y.y.y.y.y.y.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

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

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

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

m = A("m")
l = B("l")
h = C("h")
b = D("b")
k = E("k")
g = B("g")
n = C("n")
a = A("a")
j = D("j")

m.y = a
l.w = g
l.y = g
l.o = m
l.v = k
h.y = n
h.z = k
b.q = j
b.y = a
b.x = m
b.o = k
b.w = n
k.p = b
k.z = n
g.w = l
g.y = l
g.o = m
g.v = k
n.y = h
n.z = k
a.y = m
j.q = b
j.y = m
j.x = a
j.o = k
j.w = h
assert m.y.y.y.y.y.y.y.y.txt == "m"