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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

c = A("c")
a = B("a")
g = C("g")
d = D("d")
h = E("h")
e = A("e")
n = D("n")
i = D("i")

c.v = a
c.o = e
c.p = h
a.t = g
a.v = e
g.o = a
g.z = a
g.u = h
g.p = i
d.u = n
h.x = a
e.v = a
e.o = c
e.p = h
n.u = d
i.u = n
assert d.u.u.u.u.u.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: A = None
        self.p: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

c = A("c")
a = B("a")
g = C("g")
d = D("d")
h = E("h")
e = A("e")
n = D("n")
i = D("i")

c.v = a
c.o = e
c.p = h
a.t = g
a.v = e
g.o = a
g.z = a
g.u = h
g.p = i
d.u = n
h.x = a
e.v = a
e.o = c
e.p = h
n.u = d
i.u = n
assert d.u.u.u.u.u.u.u.txt == "n"