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

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

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

class D:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: D = None
        self.v: B = None
        self.txt = txt

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

d = A("d")
l = B("l")
b = C("b")
a = D("a")
n = E("n")
i = D("i")
g = C("g")
k = C("k")
e = A("e")
j = D("j")

d.v = n
l.v = k
l.x = e
l.z = e
l.t = e
l.q = n
b.p = g
a.w = i
a.p = i
a.v = l
n.z = k
i.w = j
i.p = a
i.v = l
g.p = k
k.p = b
e.v = n
j.w = a
j.p = i
j.v = l
assert l.v.p.p.p.p.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: D = None
        self.v: B = None
        self.txt = txt

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

d = A("d")
l = B("l")
b = C("b")
a = D("a")
n = E("n")
i = D("i")
g = C("g")
k = C("k")
e = A("e")
j = D("j")

d.v = n
l.v = k
l.x = e
l.z = e
l.t = e
l.q = n
b.p = g
a.w = i
a.p = i
a.v = l
n.z = k
i.w = j
i.p = a
i.v = l
g.p = k
k.p = b
e.v = n
j.w = a
j.p = i
j.v = l
assert l.v.p.p.p.p.txt == "b"