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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: B = None
        self.v: C = None
        self.y: C = None
        self.txt = txt

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

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

k = A("k")
a = B("a")
c = C("c")
h = D("h")
f = E("f")
n = C("n")

k.y = c
k.x = n
k.u = n
a.o = h
c.r = a
c.w = a
c.v = n
c.y = n
h.u = f
h.s = a
f.z = a
f.v = k
n.r = a
n.w = a
n.v = c
n.y = c
assert h.s.o.u.z.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: C = None
        self.u: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: B = None
        self.v: C = None
        self.y: C = None
        self.txt = txt

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

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

k = A("k")
a = B("a")
c = C("c")
h = D("h")
f = E("f")
n = C("n")

k.y = c
k.x = n
k.u = n
a.o = h
c.r = a
c.w = a
c.v = n
c.y = n
h.u = f
h.s = a
f.z = a
f.v = k
n.r = a
n.w = a
n.v = c
n.y = c
assert h.s.o.u.z.o.s.txt == "a"