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

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

class C:
    def __init__(self, txt: str):
        self.x: E = 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.v: A = None
        self.q: D = None
        self.z: B = None
        self.o: D = None
        self.txt = txt

e = A("e")
f = B("f")
i = C("i")
a = D("a")
c = E("c")
n = D("n")
l = B("l")
g = C("g")

e.y = c
f.x = e
f.p = e
f.u = l
i.x = c
a.y = n
c.v = e
c.q = a
c.z = l
c.o = n
n.y = a
l.x = e
l.p = e
l.u = f
g.x = c
assert a.y.y.y.y.y.y.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: E = 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.v: A = None
        self.q: D = None
        self.z: B = None
        self.o: D = None
        self.txt = txt

e = A("e")
f = B("f")
i = C("i")
a = D("a")
c = E("c")
n = D("n")
l = B("l")
g = C("g")

e.y = c
f.x = e
f.p = e
f.u = l
i.x = c
a.y = n
c.v = e
c.q = a
c.z = l
c.o = n
n.y = a
l.x = e
l.p = e
l.u = f
g.x = c
assert a.y.y.y.y.y.y.y.y.txt == "a"