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

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

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

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

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

f = A("f")
k = B("k")
e = C("e")
c = D("c")
n = E("n")
h = E("h")
d = E("d")
l = E("l")
g = C("g")
i = C("i")

f.z = l
k.s = i
k.o = f
k.u = g
e.u = g
e.s = d
e.r = i
e.z = f
e.o = k
c.u = f
c.z = f
c.v = i
c.p = e
n.o = g
h.o = i
d.o = g
l.o = e
g.u = e
g.r = e
g.s = h
g.z = f
g.o = k
i.u = g
i.r = g
i.s = n
i.z = f
i.o = k
assert d.o.u.o.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

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

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

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

f = A("f")
k = B("k")
e = C("e")
c = D("c")
n = E("n")
h = E("h")
d = E("d")
l = E("l")
g = C("g")
i = C("i")

f.z = l
k.s = i
k.o = f
k.u = g
e.u = g
e.s = d
e.r = i
e.z = f
e.o = k
c.u = f
c.z = f
c.v = i
c.p = e
n.o = g
h.o = i
d.o = g
l.o = e
g.u = e
g.r = e
g.s = h
g.z = f
g.o = k
i.u = g
i.r = g
i.s = n
i.z = f
i.o = k
assert d.o.u.o.txt == "k"