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

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: A = None
        self.r: D = None
        self.o: A = None
        self.y: E = None
        self.txt = txt

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

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

k = A("k")
l = B("l")
n = C("n")
b = D("b")
c = E("c")
i = E("i")

k.s = l
k.r = n
k.t = b
l.u = k
l.y = k
l.z = b
l.s = c
n.t = b
n.r = b
n.x = k
n.o = k
n.y = c
b.p = k
b.x = n
c.x = l
c.y = l
c.r = l
c.u = b
i.x = l
i.y = l
i.r = l
i.u = b
assert c.u.p.r.t.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: C = None
        self.t: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: A = None
        self.r: D = None
        self.o: A = None
        self.y: E = None
        self.txt = txt

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

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

k = A("k")
l = B("l")
n = C("n")
b = D("b")
c = E("c")
i = E("i")

k.s = l
k.r = n
k.t = b
l.u = k
l.y = k
l.z = b
l.s = c
n.t = b
n.r = b
n.x = k
n.o = k
n.y = c
b.p = k
b.x = n
c.x = l
c.y = l
c.r = l
c.u = b
i.x = l
i.y = l
i.r = l
i.u = b
assert c.u.p.r.t.txt == "b"