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

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

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

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

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

n = A("n")
l = B("l")
k = C("k")
d = D("d")
g = E("g")
m = D("m")
b = B("b")

n.s = d
n.p = g
n.v = g
n.u = g
l.p = d
l.x = k
l.v = b
l.o = n
k.w = n
d.v = n
d.u = k
d.y = m
g.z = l
g.s = n
g.p = k
m.v = n
m.u = k
m.y = d
b.p = m
b.x = k
b.v = l
b.o = n
assert g.z.o.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: E = None
        self.v: E = None
        self.u: E = None
        self.txt = txt

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

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

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

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

n = A("n")
l = B("l")
k = C("k")
d = D("d")
g = E("g")
m = D("m")
b = B("b")

n.s = d
n.p = g
n.v = g
n.u = g
l.p = d
l.x = k
l.v = b
l.o = n
k.w = n
d.v = n
d.u = k
d.y = m
g.z = l
g.s = n
g.p = k
m.v = n
m.u = k
m.y = d
b.p = m
b.x = k
b.v = l
b.o = n
assert g.z.o.u.z.txt == "l"