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

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

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

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

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

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

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

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

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

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

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

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

l.v = k
l.p = k
l.t = b
l.o = n
k.v = c
k.z = c
k.q = b
b.x = k
b.z = l
b.y = l
b.w = i
n.t = b
n.q = l
i.z = g
i.x = g
i.r = k
i.u = n
j.v = i
j.z = i
j.q = b
g.t = b
g.q = l
c.z = g
c.r = k
c.x = n
c.u = n
assert k.z.z.q.v.q.x.q.txt == "b"