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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: A = None
        self.o: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: B = None
        self.o: C = None
        self.w: E = None
        self.txt = txt

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

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

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

i.u = b
a.z = h
a.s = i
a.o = g
n.s = g
n.y = d
n.o = b
n.w = j
h.v = l
l.p = n
g.v = j
j.p = n
d.z = g
d.s = i
d.o = h
b.s = g
b.y = d
b.o = n
b.w = l
assert b.y.o.v.p.w.p.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: A = None
        self.o: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: B = None
        self.o: C = None
        self.w: E = None
        self.txt = txt

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

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

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

i.u = b
a.z = h
a.s = i
a.o = g
n.s = g
n.y = d
n.o = b
n.w = j
h.v = l
l.p = n
g.v = j
j.p = n
d.z = g
d.s = i
d.o = h
b.s = g
b.y = d
b.o = n
b.w = l
assert b.y.o.v.p.w.p.txt == "n"