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

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

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

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

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

j = A("j")
k = B("k")
i = C("i")
e = D("e")
g = E("g")
b = E("b")
l = B("l")
m = C("m")
f = C("f")

j.y = l
j.z = b
j.p = k
k.x = g
k.v = g
k.y = l
i.v = e
i.p = e
i.u = k
e.x = j
e.p = k
g.z = m
g.p = l
g.u = j
b.z = f
b.p = l
b.u = j
l.x = b
l.v = b
l.y = k
m.v = e
m.p = e
m.u = l
f.v = e
f.p = e
f.u = l
assert b.z.u.y.x.z.p.x.z.p.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.z: E = None
        self.p: B = None
        self.txt = txt

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

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

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

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

j = A("j")
k = B("k")
i = C("i")
e = D("e")
g = E("g")
b = E("b")
l = B("l")
m = C("m")
f = C("f")

j.y = l
j.z = b
j.p = k
k.x = g
k.v = g
k.y = l
i.v = e
i.p = e
i.u = k
e.x = j
e.p = k
g.z = m
g.p = l
g.u = j
b.z = f
b.p = l
b.u = j
l.x = b
l.v = b
l.y = k
m.v = e
m.p = e
m.u = l
f.v = e
f.p = e
f.u = l
assert b.z.u.y.x.z.p.x.z.p.txt == "l"