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

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

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

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

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

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

l.v = k
l.o = m
l.u = j
g.t = j
g.v = l
g.y = k
g.x = d
g.p = m
m.p = d
m.r = l
d.p = k
d.z = k
d.v = l
k.t = l
k.z = g
k.q = i
i.t = d
i.x = d
i.v = l
i.y = k
i.p = m
j.p = k
j.z = k
j.v = l
assert l.u.z.z.t.v.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: C = None
        self.u: D = None
        self.txt = txt

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

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

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

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

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

l.v = k
l.o = m
l.u = j
g.t = j
g.v = l
g.y = k
g.x = d
g.p = m
m.p = d
m.r = l
d.p = k
d.z = k
d.v = l
k.t = l
k.z = g
k.q = i
i.t = d
i.x = d
i.v = l
i.y = k
i.p = m
j.p = k
j.z = k
j.v = l
assert l.u.z.z.t.v.u.z.txt == "k"