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

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

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

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

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

k = A("k")
f = B("f")
l = C("l")
a = D("a")
h = E("h")
b = C("b")

k.s = f
k.z = f
k.y = h
f.x = l
f.p = h
f.v = h
f.u = b
l.r = f
l.x = f
l.o = h
a.u = h
a.r = f
h.p = l
h.o = l
h.v = k
h.z = f
b.r = f
b.x = f
b.o = h
assert f.x.o.p.o.p.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: B = None
        self.y: E = None
        self.txt = txt

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

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

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

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

k = A("k")
f = B("f")
l = C("l")
a = D("a")
h = E("h")
b = C("b")

k.s = f
k.z = f
k.y = h
f.x = l
f.p = h
f.v = h
f.u = b
l.r = f
l.x = f
l.o = h
a.u = h
a.r = f
h.p = l
h.o = l
h.v = k
h.z = f
b.r = f
b.x = f
b.o = h
assert f.x.o.p.o.p.txt == "l"