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

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

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

f.v = c
f.y = b
g.s = j
g.o = c
g.v = f
d.u = j
d.s = i
c.z = j
l.o = g
i.v = c
i.y = l
b.o = n
n.s = d
n.o = c
n.v = f
j.u = d
j.s = f
assert d.u.u.s.y.o.v.y.o.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

f.v = c
f.y = b
g.s = j
g.o = c
g.v = f
d.u = j
d.s = i
c.z = j
l.o = g
i.v = c
i.y = l
b.o = n
n.s = d
n.o = c
n.v = f
j.u = d
j.s = f
assert d.u.u.s.y.o.v.y.o.txt == "n"