class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: D = None
        self.s: E = None
        self.txt = txt

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

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

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

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

d = A("d")
g = B("g")
k = C("k")
h = D("h")
m = E("m")
n = D("n")
i = E("i")
l = D("l")

d.q = m
d.s = m
d.t = l
g.o = i
g.t = d
k.r = g
k.t = g
k.v = l
k.o = d
h.y = n
m.y = k
m.q = k
m.r = d
n.y = h
i.y = k
i.q = k
i.r = d
l.y = h
assert n.y.y.y.y.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: D = None
        self.s: E = None
        self.txt = txt

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

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

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

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

d = A("d")
g = B("g")
k = C("k")
h = D("h")
m = E("m")
n = D("n")
i = E("i")
l = D("l")

d.q = m
d.s = m
d.t = l
g.o = i
g.t = d
k.r = g
k.t = g
k.v = l
k.o = d
h.y = n
m.y = k
m.q = k
m.r = d
n.y = h
i.y = k
i.q = k
i.r = d
l.y = h
assert n.y.y.y.y.y.y.txt == "n"