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

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

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

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

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

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

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

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

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

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

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

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

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