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

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

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

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

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

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

b.u = i
b.o = d
c.z = j
c.q = k
c.u = i
c.y = n
n.q = j
i.x = k
i.t = n
j.v = c
j.u = i
j.t = n
j.r = k
k.u = i
k.o = j
d.v = c
d.u = i
d.t = n
d.r = k
assert i.t.q.t.q.t.q.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: E = None
        self.txt = txt

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

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

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

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

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

b.u = i
b.o = d
c.z = j
c.q = k
c.u = i
c.y = n
n.q = j
i.x = k
i.t = n
j.v = c
j.u = i
j.t = n
j.r = k
k.u = i
k.o = j
d.v = c
d.u = i
d.t = n
d.r = k
assert i.t.q.t.q.t.q.txt == "j"